How batrabhavye/ai-document-assistant works
This is a local, PDF-focused RAG assistant. The main user workflow runs from Streamlit upload through PDF extraction and chunking, hybrid indexing, fused retrieval, and citation-grounded Ollama answers. A separate evaluation script measures faithfulness and answer relevancy with RAGAS and records results. The README documents these capabilities; implementation detail is available for the app, retrieval engine, and evaluation script, but no separate source files for the individual retrieval stages exist.
Main entry points: app.py Streamlit assistant · evaluate.py RAGAS evaluation · utils.py RRF search · evaluation_results.csv Evaluation results
Components 10
User interface
- Streamlit assistant
app.py
Document ingestion
- PDF extraction
utils.py - Semantic chunking
utils.py
Hybrid retrieval
- FAISS index
utils.py - BM25 index
utils.py - RRF search
utils.py
Answer quality
- RAGAS evaluation
evaluate.py - Evaluation results
evaluation_results.csv
Other components
- User
- Local Ollama models
Connections 16
- User → Streamlit assistant: uploads and asks
app.py - Streamlit assistant → PDF extraction: processes PDF
app.py - PDF extraction → Semantic chunking: extracts and splits
utils.py - Streamlit assistant → FAISS index: builds index
app.py - Streamlit assistant → BM25 index: builds index
app.py - FAISS index → RRF search: ranks semantically
utils.py - BM25 index → RRF search: ranks keywords
utils.py - Streamlit assistant → RRF search: requests retrieval
app.py - RRF search → Streamlit assistant: returns chunks
utils.py - Streamlit assistant → Local Ollama models: generates grounded answer
app.py - RAGAS evaluation → PDF extraction: loads test document
evaluate.py - RAGAS evaluation → FAISS index: builds index
evaluate.py - RAGAS evaluation → BM25 index: builds index
evaluate.py - RAGAS evaluation → RRF search: retrieves context
evaluate.py - RAGAS evaluation → Local Ollama models: generates test answers
evaluate.py - RAGAS evaluation → Evaluation results: writes scores
evaluate.py