How vivek5143/rag-chatbot works
This is a document-grounded RAG chatbot: operators index the canonical eBook, then users submit questions through the chat API. The runtime retrieves candidate passages, grades whether they are sufficient, generates only from approved evidence, and independently validates grounding; insufficient or ungrounded answers are refused. The README documents the major workflow stages, while sampled source supports the API, orchestration, and adapter relationships shown here. Some implementation details, especially unsampled runtime wiring, are represented only where the README establishes them.
Main entry points: graph.py RAG Workflow · indexing.py Chunk Indexing · api.py Chat API · retrieval.py Evidence Retrieval
Components 15
Chat API
- Chat API
src/api.py
Answer Workflow
- RAG Workflow
src/graph.py - Evidence Retrieval
src/retrieval.py - Evidence Grader
src/grading.py - Answer Generation
src/generation.py - Grounding Validator
src/validation.py
Knowledge Indexing
- Canonical eBook
data/Ebook-Agentic-AI.pdf - PDF Ingestion
src/ingestion.py - Chunk Indexing
src/indexing.py
Models And Services
- Runtime Settings
src/config.py - Domain Contracts
src/models.py - Embedding Adapter
src/embeddings.py - Pinecone Index
Other components
- Questioner
- OpenAI API
Connections 18
- Questioner → Chat API: asks
README.md - Chat API → RAG Workflow: invokes
src/api.py - Chat API → Runtime Settings: loads settings
src/api.py - RAG Workflow → Evidence Retrieval: retrieves candidates
src/graph.py - RAG Workflow → Evidence Grader: grades evidence
src/graph.py - RAG Workflow → Answer Generation: generates answer
src/graph.py - RAG Workflow → Grounding Validator: validates grounding
src/graph.py - RAG Workflow → Runtime Settings: uses settings
src/graph.py - Evidence Retrieval → Embedding Adapter: embeds query
src/retrieval.py - Evidence Retrieval → Pinecone Index: queries
README.md - PDF Ingestion → Canonical eBook: extracts pages
src/ingestion.py - Chunk Indexing → PDF Ingestion: chunks document
src/indexing.py - Chunk Indexing → Embedding Adapter: embeds chunks
src/indexing.py - Chunk Indexing → Pinecone Index: upserts vectors
README.md - Embedding Adapter → OpenAI API: requests vectors
src/embeddings.py - Answer Generation → OpenAI API: requests answer
src/generation.py - Evidence Grader → OpenAI API: grades evidence
README.md - Grounding Validator → OpenAI API: checks claims
src/validation.py