How kunal-thapliyal/rag-agentic-ai works
The Agentic AI Knowledge Assistant ingests one PDF into Qdrant, then answers each user question through a LangGraph RAG workflow: retrieve the five nearest chunks, use the best similarity score as confidence, and either refuse below the threshold or ask Groq for a context-only answer. Streamlit displays the answer, confidence, and retrieved sources. Offline ingestion and online querying are separate paths. The README documents the major stages; sampled source confirms their call ownership and branching.
Main entry points: graph.py RAG Workflow · ingest.py Ingestion Runner · retrieval.py Similarity Search · generation.py Grounded Generation
Components 16
PDF Ingestion
- Ingestion Runner
app/Scripts/ingest.py - PDF Extraction & Chunking
app/ingestion.py - Document Embeddings
app/embeddings.py - Collection & Upload
app/vectorstore.py
Knowledge Retrieval
- Query Embedding
app/embeddings.py - Similarity Search
app/retrieval.py - Qdrant Collection
- Runtime Configuration
app/config.py
Answer Workflow
- RAG Workflow
app/graph.py - Relevance Gate
app/graph.py - Refusal Result
app/graph.py - Grounded Generation
app/generation.py
User Interface
- Streamlit UI
app/streamlitapp.py
Other components
- User
- Agentic AI PDF
data/Ebook-Agentic-AI.pdf - Groq API
Connections 22
- Ingestion Runner → PDF Extraction & Chunking: loads and chunks
- PDF Extraction & Chunking → Agentic AI PDF: reads pages
- Ingestion Runner → Document Embeddings: embeds chunks
- Ingestion Runner → Collection & Upload: creates collection
- Ingestion Runner → Collection & Upload: uploads vectors
- Collection & Upload → Qdrant Collection: writes chunks
- User → Streamlit UI: asks question
- Streamlit UI → RAG Workflow: calls ask_question
- RAG Workflow → Similarity Search: searches question
- Similarity Search → Query Embedding: embeds query
- Similarity Search → Qdrant Collection: queries top five
- Qdrant Collection → Similarity Search: returns matches
- RAG Workflow → Relevance Gate: checks top score
- Relevance Gate → Grounded Generation: score at least 0.50
- Relevance Gate → Refusal Result: score below 0.50
- RAG Workflow → Grounded Generation: calls with question and matches
- Grounded Generation → Groq API: requests completion
- RAG Workflow → Streamlit UI: returns answer and sources
- Refusal Result → RAG Workflow: sets refusal result
- Runtime Configuration → Query Embedding: supplies model settings
- Runtime Configuration → Qdrant Collection: supplies collection settings
- Runtime Configuration → Grounded Generation: supplies API key