A Retrieval-Augmented Generation (RAG) chatbot that answers questions strictly grounded in an Agentic AI eBook (PDF) using:
- Groq - llama-3.1-8b-instant (LLM)
- LangGraph (pipeline orchestration)
- Pinecone (vector database)
- SentenceTransformers (embeddings)
- Flask + Bootstrap (UI)
The assistant retrieves relevant document chunks, reasons over them, and streams answers live with source citations and confidence.
- PDF ingestion → chunk → embed → Pinecone
- LangGraph RAG pipeline
- Streaming token responses (typewriter effect)
- Sources + confidence score
- Conversation memory
- Dark UI
- Fully Python (no low-code / no vibe tools)
User Question
↓
Flask API (/chat)
↓
LangGraph Pipeline
↓
Retriever (Pinecone similarity search)
↓
Top-k context chunks
↓
Groq (grounded generation)
↓
Streaming answer → UI
↓
Sources + confidence- PDF → chunked
- Chunks → embeddings
- Stored in Pinecone
- Query → similar chunks retrieved
- LLM answers using ONLY retrieved context
- Response streamed to UI
app/
│
├── main.py → Flask server & API routes
├── graph.py → LangGraph RAG pipeline
├── retriever.py → Pinecone search
├── embeddings.py → SentenceTransformer embeddings
├── llm.py → Groq wrapper
├── ingest.py → PDF ingestion script
│
├── templates/
│ └── index.html → Chat UI
│
├── static/
│ └── script.js → Frontend logic
│
data/
└── Ebook-Agentic-AI.pdf
|
requirements.txt
|
READme.mdgit clone https://github.com/Mfaj-cod/RAG-chatbot
cd RAG-chatbotpython -m venv venv
venv\Scripts\activatepip install -r requirements.txtPINECONE_API_KEY=xxxx
GROQ_API_KEY=xxxxpython app/ingest.pyThis will:
- read PDF
- split into chunks
- create embeddings
- upload to Pinecone
python app/main.pyhttp://127.0.0.1:5000Try:
- What is Agentic AI?
- What are the components of an agentic system?
- How does planning work in agent architectures?
- Explain perception and execution in agents
- What are challenges in building autonomous agents?
- Summarize the key ideas of the book
Request:
{
"question": "What is agentic AI?"
}Streaming response:
- tokens
- confidence score
- retrieved contexts
| Layer | Tool |
| ---------- | ---------------- |
| Frontend | Bootstrap + JS |
| Backend | Flask |
| Pipeline | LangGraph |
| LLM | Groq(llama-3.1-8b-instant) |
| Embeddings | all-MiniLM-L6-v2 |
| Vector DB | Pinecone |- RAG + Agents + LangGraph implementation in pure Python.