How vinodbavage31/agentic-rag- works
WMF QA is a FastAPI-backed agentic RAG platform for answering Vrutti FPO questions, with a Streamlit interface and a document-ingestion capability. The main workflow routes a query, optionally retrieves and grades evidence, rewrites weak searches, then synthesizes a persona-aware answer and verifies citations. Separate trace data supports execution inspection. The graph follows the README and available excerpts; ingestion internals and some runtime wiring are not shown, so uncertain connections are omitted or marked unverified.
Main entry points: agent.py RAG orchestrator · main.py FastAPI API · llm.py LLM client · database.py Corpus database
Components 20
User access
- Streamlit UI
streamlit_app.py - FastAPI API
app/main.py
RAG workflow
- RAG orchestrator
app/pipeline/agent.py - Query router
app/pipeline/router.py - Hybrid retrieval
app/pipeline/retrieval.py - Relevance grader
app/pipeline/grader.py - RAG prompts
app/pipeline/prompts.py
Document corpus
- Embedding model
app/pipeline/embedding.py - Document ingestion
app/pipeline/ingestion.py
Persistence
- Document records
app/models/document.py - Chunk records
app/models/document_chunk.py - Corpus database
app/core/database.py - Trace records
app/models/trace.py - Trace database
app/core/trace_database.py
Model services
- Runtime settings
app/core/config.py - LLM client
app/pipeline/llm.py
Other components
- Questioner
- LLM provider
- Docling parser
- PostgreSQL
Connections 26
- Questioner → Streamlit UI: asks
- Streamlit UI → FastAPI API: submits query
- FastAPI API → RAG orchestrator: runs pipeline
app/main.py - FastAPI API → Query router: routes query
app/main.py - RAG orchestrator → Query router: classifies
app/pipeline/agent.py - RAG orchestrator → Hybrid retrieval: retrieves chunks
app/pipeline/agent.py - RAG orchestrator → Relevance grader: grades chunks
app/pipeline/agent.py - RAG orchestrator → RAG prompts: uses prompts
app/pipeline/agent.py - Query router → LLM client: classifies with
app/pipeline/router.py - Relevance grader → LLM client: grades with
app/pipeline/grader.py - RAG orchestrator → LLM client: synthesizes with
app/pipeline/agent.py - LLM client → LLM provider: calls
app/pipeline/llm.py - Hybrid retrieval → Corpus database: searches
app/pipeline/retrieval.py - Document ingestion → Docling parser: extracts with
readme.md - Document ingestion → Embedding model: embeds chunks
readme.md - Embedding model → Chunk records: stores vectors
readme.md - Document records → Corpus database: persists in
app/models/document.py - Chunk records → Corpus database: persists in
app/models/document_chunk.py - RAG orchestrator → Trace records: records stages
app/pipeline/agent.py - Trace records → Trace database: stored in
readme.md - FastAPI API → Corpus database: opens session
app/main.py - FastAPI API → Trace database: opens session
app/main.py - Corpus database → PostgreSQL: stores corpus
readme.md - Trace database → PostgreSQL: stores traces
readme.md - Query router → Runtime settings: reads config
app/pipeline/router.py - LLM client → Runtime settings: selects provider
app/pipeline/llm.py