How sricharanredd/enterprise-rag-assistant works
This is an enterprise-policy RAG chat application: users ask questions through Chainlit, the app delegates answering to the RAG pipeline, and retrieved policy passages inform a Gemini response. A separate CLI ingests PDFs through loading, chunking, embedding, and persistent vector storage. The repository also contains query transformation, hybrid retrieval, reranking, compression, evaluation, and persistent chat history. The main pipeline implementation and several advanced modules were not excerpted, so their internal call relationships are left unasserted or marked unverified.
Main entry points: rag.py RAG pipeline · ingestion.py Incremental ingestion · app.py Chainlit app · vector_store.py Chroma vector store
Components 20
Chat and persistence
- Chainlit app
app.py - SQLite data layer
src/data_layer.py - Chat database
Document ingestion
- Ingestion CLI
ingest.py - Incremental ingestion
src/ingestion.py - Policy PDFs
data - PDF loader
src/loader.py - Chunk splitter
src/splitter.py
Retrieval and answering
- Chroma vector store
src/vector_store.py - RAG pipeline
src/rag.py - Query transformation
src/query_transform.py - Hybrid retrievers
src/retrievers.py - Result reranking
src/reranker.py - Context compression
src/compression.py - RAG evaluation
src/evaluation.py
Models and configuration
- Gemini embeddings
src/embeddings.py - Gemini chat model
src/llm.py - RAG configuration
src/config.py
Other components
- Chat user
- Google Gemini
Connections 20
- Chat user → Chainlit app: asks
README.md - Chainlit app → RAG pipeline: asks
app.py - Chainlit app → SQLite data layer: persists chats
app.py - SQLite data layer → Chat database: reads and writes
src/data_layer.py - Ingestion CLI → Incremental ingestion: runs ingestion
ingest.py - Incremental ingestion → Policy PDFs: discovers
src/ingestion.py - Incremental ingestion → PDF loader: loads PDFs
src/ingestion.py - Incremental ingestion → Chunk splitter: splits documents
src/ingestion.py - Incremental ingestion → Chroma vector store: adds chunks
src/ingestion.py - Chroma vector store → Gemini embeddings: creates embeddings
src/vector_store.py - Query transformation → Gemini chat model: invokes model
src/query_transform.py - Hybrid retrievers → Chroma vector store: searches vectors
src/retrievers.py - Gemini embeddings → Google Gemini: embeds text
src/embeddings.py - Gemini chat model → Google Gemini: generates answers
src/llm.py - RAG pipeline → Query transformation: may transform
- RAG pipeline → Hybrid retrievers: may retrieve
- RAG pipeline → Result reranking: may rerank
- RAG pipeline → Context compression: may compress
- RAG pipeline → Gemini chat model: may generate
- RAG evaluation → RAG pipeline: evaluates
src/evaluation.py