How nitishkumarpidikiti457/enterprise_rag_and_agentic_ai works
This platform answers enterprise questions using document retrieval, read-only SQL, or both, and returns grounded answers with citations. The user-facing flow is client → authenticated FastAPI endpoint → single-shot RAG or the LangGraph agent → retrieval and/or SQL → routed model response. A separate ingestion flow turns uploaded or corpus documents into indexed chunks. The README documents streaming, conversation memory, model fallbacks, caching, and metrics; unsampled modules are shown at their documented boundaries, with uncertain wiring omitted.
Main entry points: main.py FastAPI service · pipeline.py Ingestion pipeline · retriever.py Hybrid retrieval · graph.py LangGraph workflow
Components 24
API service
- FastAPI service
src/app/api/main.py - JWT and limits
src/app/api/auth.py - Chat UI
src/app/api/static/index.html - Upload ingestion
src/app/api/main.py
Document ingestion
- Ingestion pipeline
src/app/ingestion/pipeline.py - Document loaders
src/app/ingestion/loaders.py - Semantic chunking
src/app/ingestion/chunking.py - Embedding
src/app/ingestion/embed.py
Retrieval and data
- Hybrid retrieval
src/app/retrieval/retriever.py - Cross-encoder reranker
src/app/retrieval/rerank.py - Chroma vector store
src/app/retrieval/vectorstore.py - SQLite business data
data/sample.db
Agent and answers
- Single-shot RAG
src/app/rag.py - LangGraph workflow
src/app/agent/graph.py - Agent tools
src/app/agent/tools.py - Thread memory
src/app/agent/graph.py
Models and operations
- LLM router
src/app/llm/router.py - LLM providers
src/app/llm/providers.py - Prompt templates
src/app/llm/prompts/templates.yaml - Response cache
src/app/llm/cache.py - Metrics and logs
src/app/observability/logging.py
Other components
- Client
- Redis cache
- Model services
Connections 31
- Client → FastAPI service: sends requests
- FastAPI service → JWT and limits: authenticates and limits
- FastAPI service → Chat UI: serves UI
- FastAPI service → Upload ingestion: routes uploads
- Upload ingestion → Ingestion pipeline: ingests files
- Ingestion pipeline → Document loaders: loads documents
- Ingestion pipeline → Semantic chunking: chunks documents
- Semantic chunking → Embedding: embeds sentences
- Ingestion pipeline → Embedding: embeds chunks
- Ingestion pipeline → Chroma vector store: upserts chunks
- Ingestion pipeline → Hybrid retrieval: invalidates BM25
- FastAPI service → Single-shot RAG: answers queries
- FastAPI service → LangGraph workflow: runs or streams chat
- LangGraph workflow → Agent tools: dispatches tools
- Agent tools → Hybrid retrieval: searches documents
- Agent tools → SQLite business data: queries read-only
- LangGraph workflow → LLM router: classifies and synthesizes
- LangGraph workflow → Thread memory: persists thread state
- Single-shot RAG → Hybrid retrieval: retrieves passages
- Single-shot RAG → LLM router: generates answers
- Hybrid retrieval → Embedding: embeds query
- Hybrid retrieval → Chroma vector store: searches dense index
- Hybrid retrieval → Cross-encoder reranker: reranks candidates
- LLM router → LLM providers: selects and calls
- LLM router → Response cache: reads and writes
- Response cache → Redis cache: uses optional backend
- LLM providers → Model services: calls model APIs
- Single-shot RAG → Prompt templates: renders prompts
- LangGraph workflow → Prompt templates: renders prompts
- LLM router → Metrics and logs: records calls and cost
- FastAPI service → Metrics and logs: records service metrics