A full Agentic RAG system built with LangChain, FAISS, Streamlit, and voice support, capable of:
- 📄 Answering from private documents (RAG)
- 🌐 Accessing the live internet (web search)
- 🧠 Making intelligent decisions using an AI agent
- 🎤 Supporting voice-to-voice and text-to-text interaction
This is not a basic RAG — it's an Agentic RAG pipeline.
LLM decides when to use:
- Private documents (FAISS)
- Live web search
- Tools (calculator, APIs)
- Direct reasoning
- Overcomes outdated knowledge problem
- Uses Google Serper for real-time search
- FAISS vector store
- HuggingFace embeddings
- Document-grounded answers
- Speech-to-text (Whisper via Groq)
- Text-to-speech (Edge TTS)
- Real-time voice conversations
- Clean chat interface
- Text & voice mode toggle
- Chat history display
User (Text / Voice)
↓
Speech-to-Text (if voice)
↓
AI Agent (Decision Maker)
↓
┌───────────────────────────────────┐
│ Tools │
│ • document_search (RAG / FAISS) │
│ • web_search (Internet) │
│ • calculator / APIs │
└───────────────────────────────────┘
↓
Final Answer
↓
Text-to-Speech (if voice)
↓
User
AGENTIC_RAG/
│
├── app.py # Streamlit app (UI + Voice)
│
├── agent/
│ ├── __init__.py
│ ├── agent.py # Agent (brain)
│ ├── test_agent.py # CLI test
│ └── tools/
│ ├── __init__.py
│ ├── rag_tool.py # RAG as a tool
│ ├── web_tool.py # Web search tool
│ └── misc_tools.py # Calculator etc.
│
├── src/
│ ├── embedding.py # HuggingFace embeddings
│ ├── vectorstore.py # FAISS loader
│ └── chain.py # RAG chain creation
│
├── faiss_index/ # Vector database
├── .env # API keys
├── requirements.txt
└── README.md
Use Python 3.11
❌ Python 3.14 is NOT supported by LangChain yet.
python --version
# Python 3.11.xpython -m venv .venv
.venv\Scripts\activate # Windowspip install -r requirements.txtCreate a .env file:
GROQ_API_KEY=your_groq_key
SERPER_API_KEY=your_google_serper_key
WEATHER_API_KEY=optional
CURRENCY_API_KEY=optionalpython -m agent.test_agentExample queries:
- "What does my document say about transformers?"
- "Who won yesterday's match?"
- "(12 + 8) * 3"
streamlit run app.py| User Query | Tool Used |
|---|---|
| "What does my PDF say about X?" | 📄 RAG |
| "Latest news about AI" | 🌐 Web Search |
| "25 * (4 + 6)" | 🧮 Calculator |
| "Explain PCA" | 🧠 Direct LLM |
The agent does NOT blindly run RAG.
Voice Input
→ Speech-to-Text (Whisper)
→ Agentic RAG
→ Text Answer
→ Text-to-Speech (Edge TTS)
→ Audio Output
Voice is just an interface, not logic.
✅ Real Agentic RAG, not hardcoded logic
✅ Solves outdated knowledge problem
✅ Clean separation of concerns
✅ Production-style architecture
✅ Portfolio & interview ready
- 🔖 Source citations (RAG vs Web)
- 🧠 Memory summarization
- ⚡ Streaming responses + partial TTS
- 🔐 Rate limiting & security
- 🌍 Multi-language voice support
Yashodeep
Computer Science Student | Data Scientist | AI Engineer
Built with ❤️ and a lot of debugging 😄