How naresh1401/agenticragchatbot works
Agentic RAG chatbot: users chat through the web UI, while the FastAPI backend runs guarded agent reasoning over vector and SQL retrieval, uses session memory, verifies answers, and returns citations. Separate upload, URL-ingest, and scrape routes feed documents through loading, chunking, embedding, and indexing. The graph preserves the documented API and ingestion capabilities; several endpoint details and the agent’s internal routing are unsampled, so uncertain links are omitted.
Main entry points: main.py FastAPI API · graph.py LangGraph agent · indexer.py Ingestion indexer · tools.py Agent tools
Components 19
User interaction
- Chat UI
frontend/chat.html - FastAPI API
backend/main.py - API schemas
backend/models/schemas.py
Agent workflow
- LangGraph agent
backend/agents/graph.py - Agent tools
backend/agents/tools.py - Input guardrails
backend/guardrails/injection_detector.py - PII redaction
backend/guardrails/pii_redactor.py - Answer verification
backend/guardrails/answer_verifier.py
Knowledge ingestion
- Ingestion indexer
backend/ingestion/indexer.py - Document loaders
backend/ingestion/document_loader.py - Chunking
backend/ingestion/chunker.py - Embedding
backend/ingestion/embedder.py
Retrieval and state
- Session memory
backend/memory/session_store.py - Chroma vector store
backend/retrieval/vector_store.py - SQLite store
backend/retrieval/sql_store.py
Shared services
- Configuration
backend/config.py - Structured logging
backend/utils/logger.py
Other components
- User
- OpenAI-compatible LLM
Connections 22
- User → Chat UI: uses
README.md - Chat UI → FastAPI API: sends chat
README.md - FastAPI API → LangGraph agent: runs chat
backend/main.py - FastAPI API → Session memory: manages sessions
backend/main.py - FastAPI API → Ingestion indexer: starts ingestion
backend/main.py - FastAPI API → Chroma vector store: lists sources
backend/main.py - FastAPI API → API schemas: validates requests
backend/main.py - LangGraph agent → Input guardrails: checks input
backend/agents/graph.py - LangGraph agent → PII redaction: redacts input
backend/agents/graph.py - LangGraph agent → Agent tools: binds tools
backend/agents/graph.py - LangGraph agent → Answer verification: verifies answer
backend/agents/graph.py - LangGraph agent → OpenAI-compatible LLM: invokes model
README.md - Agent tools → Chroma vector store: retrieves documents
backend/agents/tools.py - Agent tools → SQLite store: queries tables
backend/agents/tools.py - Ingestion indexer → Document loaders: loads files
backend/ingestion/indexer.py - Ingestion indexer → Chunking: chunks text
backend/ingestion/indexer.py - Ingestion indexer → Embedding: embeds chunks
backend/ingestion/indexer.py - Ingestion indexer → Chroma vector store: writes vectors
backend/ingestion/indexer.py - Ingestion indexer → SQLite store: loads structured data
backend/ingestion/indexer.py - Embedding → OpenAI-compatible LLM: requests embeddings
README.md - FastAPI API → Configuration: uses settings
backend/main.py - LangGraph agent → Configuration: reads settings
backend/agents/graph.py