How mugil0095/verity-rag works
VerityRAG is a real-time, agentic retrieval-augmented question-answering system. Users submit questions through the Streamlit app or FastAPI backend; the pipeline delegates bounded retrieval and reformulation to an agent, which checks evidence sufficiency, generates an answer when warranted, and verifies grounding before returning an answer or abstaining. Documents enter through bulk or streaming ingestion and are chunked, embedded, and indexed for hybrid search. Evaluation and optional model/index backends are separate capabilities. The map follows the README and supplied excerpts; unsampled API and agent internals are represented only at documented subsystem level.
Main entry points: agent.py Agent Controller · pipeline.py RAG Pipeline · indexing.py Live Index · app.py Streamlit UI
Components 19
Serving
- Streamlit UI
app.py - FastAPI API
src/verityrag/api.py - RAG Pipeline
src/verityrag/pipeline.py
Ingestion
- Live Stream
src/verityrag/streaming.py - Chunking
src/verityrag/chunking.py - Embedding
src/verityrag/embedding.py - Live Index
src/verityrag/indexing.py - Elasticsearch Backend
src/verityrag/elasticsearch_index.py
Retrieval
- Agent Controller
src/verityrag/agent.py - Query Reformulation
src/verityrag/agent_reformulate.py - Hybrid Retrieval
src/verityrag/retrieval.py - Reranker
src/verityrag/reranker.py - Sufficiency Gate
src/verityrag/sufficiency.py
Answering
- Answer Generation
src/verityrag/generation.py - LLM Providers
src/verityrag/llm_providers.py - Grounding Check
src/verityrag/grounding.py - Answer or Abstention
Evaluation
- Evaluation Harness
src/verityrag/eval.py
Other components
- Questioner
Connections 24
- Questioner → Streamlit UI: asks
- Questioner → FastAPI API: asks
- Streamlit UI → RAG Pipeline: queries
- FastAPI API → RAG Pipeline: delegates
- RAG Pipeline → Agent Controller: queries
- RAG Pipeline → Chunking: chunks documents
- RAG Pipeline → Live Index: adds chunks
- Live Stream → RAG Pipeline: ingests documents
- Chunking → Embedding: produces text chunks
- Live Index → Embedding: embeds chunks
- Live Index → Elasticsearch Backend: optional lexical backend
- Agent Controller → Hybrid Retrieval: retrieves candidates
- Hybrid Retrieval → Live Index: reads snapshot
- Hybrid Retrieval → Embedding: embeds query
- Agent Controller → Reranker: reranks candidates
- Agent Controller → Sufficiency Gate: checks evidence
- Agent Controller → Query Reformulation: reformulates query
- Agent Controller → Answer Generation: generates answer
- Answer Generation → LLM Providers: optional model calls
- Agent Controller → Grounding Check: checks answer
- Agent Controller → Answer or Abstention: returns answer or abstention
- Streamlit UI → Answer or Abstention: renders
- FastAPI API → Answer or Abstention: returns
- Evaluation Harness → RAG Pipeline: evaluates queries