Back to projects
aiProductionAGENTIC AI

Agentic RAG PDF Chatbot

Agent-Orchestrated Document Intelligence

Advanced agent-orchestrated retrieval-augmented generation (Agentic RAG) chatbot that intelligently reasons over user queries, decides when to retrieve document context, and generates grounded answers. Unlike traditional RAG systems that blindly retrieve for every query, this agent uses an LLM-driven decision engine to selectively invoke document retrieval tools. Supports multiple document formats (PDF, TXT, DOCX) with semantic chunking, vector similarity search using FAISS and Sentence-Transformer embeddings, and maintains conversational memory. Features source-aware answers with page numbers, voice-enabled AI (STT + TTS), query analytics, and real-time streaming responses. Built with OpenAI Agents SDK, LangChain, and Groq LLMs.

Case study snapshot
Role
AI systems engineer
Audience
Recruiters, document-AI users, and builders comparing RAG patterns
Timeline
2025-02
Role
AI systems engineer
Audience
Recruiters, document-AI users, and builders comparing RAG patterns
Date
2025-02
Problem

Why it mattered

Traditional RAG systems retrieve context for every question, even when retrieval is unnecessary or the question needs reasoning first.

Solution

What shipped

An agentic RAG chatbot where the agent decides whether to retrieve documents, use memory, ask for clarification, or answer directly.

Impact

Proof signal

Agent-orchestrated decision making; Multi-format document support; Real-time streaming; Voice-enabled interaction; Source attribution with page numbers

< architecture />

System flow

The user query enters an agent decision layer. The agent can call document retrieval tools, stream an answer, use conversational memory, and return source-aware responses.

Query Understanding
Agent Reasoning
Tool Selection
Document Retrieval
Context Augmentation
Answer Generation
Visual architecture
01
Query Understanding
02
Agent Reasoning
03
Tool Selection
04
Document Retrieval
05
Context Augmentation
06
Answer Generation
quality score

Honest maturity snapshot

Code Quality9/10
UI / UX6/10
Scalability8/10
Production Ready9/10
Before

Manual questions, scattered context, and slow follow-up.

After

An agent workflow that routes intent, calls tools, and returns useful next actions.

capabilities

Features

  • LLM-driven retrieval decision making.
  • PDF, TXT, and DOCX support.
  • FAISS and sentence-transformer retrieval.
  • Streaming responses for better UX.
  • Voice-enabled interaction with STT/TTS.
  • Source attribution with page references.
tradeoffs

Engineering challenges

  • Designing tool rules that make retrieval useful instead of noisy.
  • Keeping responses grounded while preserving conversational flow.
  • Managing multi-format ingestion without breaking the user experience.
proof

Results

  • Demonstrates a mature leap from standard RAG into agentic retrieval.
  • Strong fit for legal, academic, and internal knowledge-base use cases.
  • Shows end-to-end AI product thinking, not only notebook experimentation.
reflection

What I learned

  • Tradeoff learned: Designing tool rules that make retrieval useful instead of noisy.
  • Proof learned: Demonstrates a mature leap from standard RAG into agentic retrieval.
  • Next iteration: Add document-level access permissions.
< stack />
PythonOpenAI Agents SDKLangChainFAISSSentence-TransformersGroq LLMStreamlitSTT/TTS
< next iteration />

Future improvements

Add document-level access permissions.
Add evaluation traces for retrieval precision and answer faithfulness.
Add persistent project workspaces for teams.