An Agentic Retrieval-Augmented Generation (RAG) system that answers questions using PDFs, website content, and fallback web search through intelligent routing.
- Clean web scraping and extraction (ignores noisy HTML elements like navs/footers)
- Optimized semantic chunking strategy explicitly designed for technical documentation
- Advanced Query Preprocessing (Regex-based formatting strip for pure semantic retrieval)
- PDF-based question answering
- Website content extraction and processing
- Agent-based decision logic for source selection
- Semantic search using Qdrant vector database
- Local embeddings using SentenceTransformers
- Fallback search using DuckDuckGo
- Context-grounded, heavily structured, and dynamically formatted responses to minimize hallucination
- Modular, scalable software architecture
User Query
↓
Query Preprocessing (Regex formatting strip)
↓
Vector Search (Qdrant) → Context Retrieved → LLM Decision
↓ ↓
Found Not Found
↓ ↓
Answer from docs Web Search → LLM Answer
Python, Streamlit, Qdrant, SentenceTransformers, OpenRouter API, BeautifulSoup, PyPDF2, Docker
- Python 3.10 (recommended for compatibility)
- Docker installed and running
- OpenRouter API Key
git clone https://github.com/your-username/Agentic-RAG.git
cd Agentic-RAGOn macOS (Homebrew):
brew install --cask dockerOpen Docker Desktop and ensure it is running.
docker pull qdrant/qdrantdocker run -p 6333:6333 qdrant/qdrantKeep this terminal running while using the application.
Open in browser:
http://localhost:6333/dashboard
python3.10 -m venv venv
source venv/bin/activatepip install -r requirements.txtOpen a new terminal:
source venv/bin/activate
streamlit run app.pyAccess the app at:
http://localhost:8501
Generate an API key from:
Enter the key in the application UI.
- Enter your OpenRouter API key in the sidebar.
- Upload PDF files or provide website URLs.
- Click "Process Documents", "Crawl Website", or "Process Sources" (the button label adapts dynamically).
- Wait for the success message confirming the chunks are indexed.
- Ask questions! The LLM will respond with professionally formatted answers (bullet points, headings, etc.) based on the detected documentation.
- Search within PDF content
- If not found, search website content
- If still not found, perform fallback web search
- Generate final answer using LLM
- DuckDuckGo may rate limit frequent requests
- Ensure Docker is running before starting the app
- Python 3.10 is recommended for compatibility with ML libraries
- Chat history support
- Source citation display
- Deployment to cloud platforms
- Integration with production-grade search APIs