A local RAG system for uploading documents, comparing chunking strategies, running hybrid search, and tracking retrieval quality.
- Upload PDF, DOCX, TXT, and Markdown files.
- Chunk documents with small, balanced, or large strategies.
- Store local embeddings in Chroma collections.
- Combine semantic search with BM25 keyword search.
- Answer questions with Mistral through Ollama.
- Inspect retrieved chunks and source citations.
- Run CSV-based evaluation for precision, recall, answer coverage, and hallucination risk.
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
ollama pull mistral
streamlit run app.pyChroma requires Python to be linked against SQLite 3.35.0 or newer. If your local Python has an older SQLite build, the app falls back to a lightweight local vector scorer so you can still use the UI while you upgrade Python.
In a separate terminal, make sure Ollama can serve Mistral:
ollama run mistralUpload a CSV with these columns:
question,expected_answer,expected_source
"What is the refund policy?","Refunds are available within 30 days","policy.pdf"Uploads
-> parsing
-> chunking strategy
-> Chroma embeddings
-> BM25 keyword index
-> hybrid retrieval
-> Mistral answer generation
-> citations + evaluation dashboard
The app exposes the retrieval layer, scoring weights, chunking choices, source chunks, and evaluation metrics. That makes it useful for debugging and improving a RAG system instead of only demoing a chatbot.