How battulayaswanth/rag works
Advanced RAG ingests PDF/DOCX documents, cleans and deduplicates their text, chunks it, embeds it, and indexes it in Chroma. For a question, the serving API delegates to the RAG application, which retrieves and reranks candidate chunks, prepares grounded context, generates an answer, and optionally evaluates it; the React chat UI presents answers and sources. The README documents batch evaluation and local/cloud and model-provider options. Edges reflect shown calls or documented relationships; some integrations are documented but their full implementation was not sampled.
Main entry points: main.py Ingestion pipeline · app.py RAG application · retriever.py Hybrid retrieval and rerank · api.py FastAPI service
Components 23
Document ingestion
- Ingestion pipeline
src/advanced_rag/main.py - Document loading
src/advanced_rag/Loaders/data_loader.py - Cleaning and dedup
src/advanced_rag/Loaders/data_cleaner.py - Text chunking
src/advanced_rag/Chunker/text_chunker.py - Vector indexing
src/advanced_rag/Vector/vector_store.py - Chroma client
src/advanced_rag/Vector/chroma_client.py
Retrieval and grounding
- Hybrid retrieval and rerank
src/advanced_rag/Retrieval/retriever.py - Context and citations
src/advanced_rag/Augmentor/augmentor.py - Grounded generation
src/advanced_rag/Generator/generator.py
Serving and chat
- FastAPI service
src/advanced_rag/api.py - RAG application
src/advanced_rag/app.py - React chat UI
frontend/src/App.jsx - Frontend API client
frontend/src/api.js
Evaluation
- Claim-level evaluation
src/advanced_rag/Evaluation/evaluator.py - Batch evaluation
src/advanced_rag/Evaluation/run_batch.py
Other components
- User
- PDF/DOCX documents
- Chroma store
- Question
- Voyage embeddings
- Cohere reranker
- Ollama or Groq
- Evaluation LLM
Connections 24
- PDF/DOCX documents → Ingestion pipeline: ingests
README.md - Ingestion pipeline → Document loading: loads
src/advanced_rag/main.py - Ingestion pipeline → Cleaning and dedup: cleans and deduplicates
src/advanced_rag/main.py - Ingestion pipeline → Text chunking: chunks
src/advanced_rag/main.py - Ingestion pipeline → Vector indexing: indexes chunks
src/advanced_rag/main.py - Vector indexing → Chroma client: gets client
src/advanced_rag/Vector/vector_store.py - Chroma client → Chroma store: connects
src/advanced_rag/Vector/chroma_client.py - User → React chat UI: asks
README.md - React chat UI → Frontend API client: calls
frontend/src/App.jsx - Frontend API client → FastAPI service: HTTP query
README.md - Question → FastAPI service: submits
README.md - FastAPI service → RAG application: delegates
src/advanced_rag/api.py - RAG application → Hybrid retrieval and rerank: retrieves
src/advanced_rag/app.py - Hybrid retrieval and rerank → Chroma store: searches
src/advanced_rag/Retrieval/retriever.py - Hybrid retrieval and rerank → Voyage embeddings: embeds query
README.md - Hybrid retrieval and rerank → Cohere reranker: reranks
README.md - RAG application → Context and citations: prepares context
src/advanced_rag/app.py - RAG application → Grounded generation: generates answer
src/advanced_rag/app.py - Grounded generation → Ollama or Groq: invokes
README.md - RAG application → Claim-level evaluation: optionally evaluates
src/advanced_rag/app.py - Claim-level evaluation → Evaluation LLM: judges claims
README.md - Batch evaluation → Hybrid retrieval and rerank: runs queries
src/advanced_rag/Evaluation/run_batch.py - Batch evaluation → Claim-level evaluation: evaluates results
src/advanced_rag/Evaluation/run_batch.py - FastAPI service → React chat UI: returns answer and sources
README.md