How shivam-83/rag-agentic-ai works
This is a document-grounded RAG chatbot for the Agentic AI eBook. Its main workflow ingests the PDF into a Pinecone index, then retrieves relevant chunks and generates a strictly grounded answer with a fallback for unsupported questions. Users can query through either the FastAPI endpoint or the Streamlit chat, which displays confidence and retrieved citations. The graph reflects documented calls and README capabilities; unsampled subsystems are represented only where the README supports them.
Main entry points: graph.py LangGraph Workflow · app.py FastAPI Chat API · streamlit_app.py Streamlit Chat · ingestion.py PDF Loading
Components 16
Document Ingestion
- PDF Loading
src/ingestion.py - Text Chunking
src/ingestion.py - Gemini Embeddings
src/ingestion.py - Index Setup
src/ingestion.py - Chunk Upsert
src/ingestion.py
Knowledge Retrieval
- Pinecone Index
- Document Retrieval
src/retrieval.py
Answer Workflow
- Runtime Configuration
src/config.py - LangGraph Workflow
src/graph.py - Retrieve Node
src/graph.py - Generate Node
src/graph.py
User Interfaces
- FastAPI Chat API
app.py - Streamlit Chat
streamlit_app.py
Other components
- User
- Agentic AI eBook
data/Ebook-Agentic-AI.pdf - Gemini Chat Model
Connections 18
- Agentic AI eBook → PDF Loading: loads
src/ingestion.py - PDF Loading → Text Chunking: splits pages
src/ingestion.py - Text Chunking → Gemini Embeddings: embeds chunks
src/ingestion.py - Gemini Embeddings → Chunk Upsert: provides vectors
src/ingestion.py - Index Setup → Pinecone Index: creates index
src/ingestion.py - Chunk Upsert → Pinecone Index: upserts chunks
src/ingestion.py - User → FastAPI Chat API: submits query
README.md - User → Streamlit Chat: asks question
README.md - FastAPI Chat API → LangGraph Workflow: invokes
app.py - Streamlit Chat → LangGraph Workflow: invokes
streamlit_app.py - LangGraph Workflow → Retrieve Node: dispatches
src/graph.py - Retrieve Node → Document Retrieval: queries
src/graph.py - Document Retrieval → Pinecone Index: searches index
src/retrieval.py - Retrieve Node → Generate Node: passes context
src/graph.py - Generate Node → Gemini Chat Model: invokes
src/graph.py - LangGraph Workflow → Runtime Configuration: reads settings
src/graph.py - FastAPI Chat API → User: returns answer
app.py - Streamlit Chat → User: shows answer and citations
streamlit_app.py