How vignesh-a04/rag-chatbot works
This is a full-stack, multi-PDF RAG chatbot. Users upload PDFs, which the API saves and indexes; questions go through retrieval, context construction, and Gemini generation, with answers and source metadata returned to the chat UI. The API also supports document listing and deletion, while the frontend provides chat and document management. Relationships among backend modules are supported by the sampled source; other capabilities and frontend-to-API wiring are documented in the README or visible in the page excerpt.
Main entry points: main.py FastAPI endpoints · pipeline.py Ingestion orchestration · page.tsx Chat and documents UI · loader.py PDF page extraction
Components 16
Web client
- Chat and documents UI
frontend/app/page.tsx
REST API
- FastAPI endpoints
app/main.py - Uploaded PDF files
app/main.py
Document ingestion
- Ingestion orchestration
app/rag/pipeline.py - PDF page extraction
app/ingestion/loader.py - Text chunking
app/ingestion/chunker.py - PyPDFLoader
- Recursive splitter
RAG and storage
- RAG orchestration
app/rag/pipeline.py - Search and context
app/rag/pipeline.py - Document lifecycle
app/rag/pipeline.py - Chroma vector store
AI services
- Embedding setup
app/retrieval/embeddings.py - Gemini embeddings
- Gemini answer model
Other components
- User
Connections 18
- User → Chat and documents UI: uses
README.md - Chat and documents UI → FastAPI endpoints: calls API
README.md - FastAPI endpoints → Uploaded PDF files: saves and removes
app/main.py - FastAPI endpoints → Ingestion orchestration: indexes upload
app/main.py - FastAPI endpoints → Document lifecycle: lists and deletes
app/main.py - FastAPI endpoints → RAG orchestration: submits question
app/main.py - Ingestion orchestration → PDF page extraction: loads pages
app/rag/pipeline.py - Ingestion orchestration → Text chunking: splits pages
app/rag/pipeline.py - PDF page extraction → PyPDFLoader: extracts pages
app/ingestion/loader.py - Text chunking → Recursive splitter: splits text
app/ingestion/chunker.py - Ingestion orchestration → Chroma vector store: stores chunks
app/rag/pipeline.py - Ingestion orchestration → Embedding setup: configures embeddings
app/rag/pipeline.py - Embedding setup → Gemini embeddings: creates embeddings
app/retrieval/embeddings.py - RAG orchestration → Search and context: retrieves and builds context
app/rag/pipeline.py - Search and context → Chroma vector store: searches top three
app/rag/pipeline.py - RAG orchestration → Gemini answer model: generates answer
app/rag/pipeline.py - Document lifecycle → Chroma vector store: reads and deletes chunks
app/rag/pipeline.py - FastAPI endpoints → Chat and documents UI: returns API results
README.md