An Agentic RAG system for grounded research paper Q&A, real-time claim verification against modern literature, and multi-session literature review.
π Explore Live Demo β’ π Overview β’ β¨ Key Features β’ ποΈ Architecture β’ π οΈ Tech Stack β’ β‘ Quickstart
In AI & Machine Learning, research moves at breakneck speed. A foundational claim or benchmark established in a 2023 paper can be superseded within months by novel architectures and optimization techniques.
Standard RAG chatbots merely tell you what a paper argued they cannot tell you whether that argument still holds up today.
IRPA treats "Is this claim still true?" as a first class citizen. Instead of standard single hop retrieval, IRPA leverages an autonomous LangGraph agent loop to dynamically route queries, challenge assertions across live scientific publications via web search, detect retrieval degradation, and self correct on the fly.
| Capability | Description |
|---|---|
| β« Multi-Source Ingestion | Ingest local PDFs, Markdown, TXT, live web URLs, or directly pull papers from arXiv via paper ID / title. |
| β Autonomous Routing Loop | Agentic router categorizes intents into Direct Answer, Vector Store Retrieval, or Claim Verification. |
| β Live Claim Verification | Validates factual claims against recent literature via Tavily web search, highlighting superseded findings with direct citations. |
| βΊ Self Correcting Retrieval | A relevancy grading node detects poor chunks, triggering automated query rewrites and retries to avoid hallucinations. |
| β Isolated Multi Session Memory | Chat sessions maintain independent Qdrant vector collections and SQLite state checkpointers preventing context bleed across papers. |
β³ /btw Side Channel |
Ask quick, off-topic side queries without corrupting your active research session's conversational memory. |
| π² Disk Cached Embeddings | Content chunks are SHA-256 hashed and cached locally to prevent redundant, costly embedding API re calls. |
| β¦ Auto Named Threads | Context-aware LLM generates concise, descriptive session titles from your initial query. |
βββββββββββββββββββββββββββββ
β User / Streamlit UI β
βββββββββββββββ¬ββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββ
β LangGraph Agent Router β
ββββββββ¬βββββββ¬βββββββ¬βββββββ
β β β
βββββββββββββββββββββββββββ β ββββββββββββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββββββββββ ββββββββββββββββββββββ ββββββββββββββββββββββ
β Direct Answer Node β β Retrieval Agent β β Claim Verification β
ββββββββββββββββββββββ ββββββββββββ¬ββββββββββ ββββββββββββ¬ββββββββββ
β β
βββββββββββ΄ββββββββββ βΌ
βΌ βΌ βββββββββββββββββββββ
ββββββββββββββββββββ ββββββββββββββββββββ β Tavily Web Search β
β Qdrant Vector β β Tavily Search β βββββββββββββββββββββ
β Collection β β (Web Context) β
βββββββββββ¬βββββββββ ββββββββββββββββββββ
β
βΌ
[ Relevancy Evaluation ]
β
ββββββββββββββ΄βββββββββββββ
β (Pass) β (Fail / Low Confidence)
βΌ βΌ
βββββββββββββββββββββββ βββββββββββββββββββββββββ
β Generate Final β β Query Rewrite & Retry β
β Grounded Answer β ββββββββββββ¬βββββββββββββ
βββββββββββββββββββββββ β
β² β
βββββββββββββββββββββββββββ
State Persistence: Conversational history, agent state checkpoints, and session metadata are persisted through an embedded SQLite checkpoint database alongside isolated Qdrant vector spaces.
| Layer | Technology | Rationale & Highlights |
|---|---|---|
| Agentic Framework | LangGraph | Explicit cyclical graph state machine with dynamic routing, retries, and fallback handling. |
| LLM & Embeddings | Google Gemini | High throughput gemini-3.5-flash for reasoning paired with native text embeddings. |
| Vector Database | Qdrant Cloud | Low latency vector search with per session collection isolation and payload filtering. |
| Live Web Retrieval | Tavily Search API | Optimized for agent workflows to discover recent counter evidence and fresh research. |
| Evaluation Suite | DeepEval | LLM assisted evaluation for Faithfulness, Answer Relevancy, and Contextual Precision. |
| Frontend | Streamlit | Fast, responsive chat UI featuring word by word streaming and instant access to verified sources. |
| Container & Cloud | Docker + AWS EC2 | Fully containerized environment deployed on an AWS EC2 instance. |
- Python
3.10+ - Git
- Qdrant Cloud Cluster & Google AI Studio API Key
git clone https://github.com/octorohan/IRPA.git
cd IRPApython -m venv venv
# On Windows:
.\venv\Scripts\activate
# On Linux/macOS:
source venv/bin/activate
pip install -r requirements.txtCreate a .env file in the root directory:
GOOGLE_API_KEY="your_google_ai_studio_key"
TAVILY_API_KEY="your_tavily_search_key"
QDRANT_URL="https://your-cluster-id.eu-central-1-0.aws.cloud.qdrant.io"
QDRANT_API_KEY="your_qdrant_api_key"
APP_PASSWORD="your_secure_password"streamlit run app.pyOpen your browser at http://localhost:8501.
# 1. Create host storage directories
mkdir -p ~/irpa-data/embedding_cache
touch ~/irpa-data/sessions.json
touch ~/irpa-data/checkpoints.db
# 2. Run container
docker run -d \
-p 8501:8501 \
--env-file .env \
-v ~/irpa-data/embedding_cache:/app/embedding_cache \
-v ~/irpa-data/sessions.json:/app/sessions.json \
-v ~/irpa-data/checkpoints.db:/app/checkpoints.db \
--restart unless-stopped \
--name irpa-app \
octorohan/irpa-app:latestdocker build -t irpa-app .
docker run -d -p 8501:8501 --env-file .env --name irpa-app irpa-appIRPA integrates DeepEval to quantitatively grade RAG pipelines using LLM-as-a-Judge against synthetic golden datasets generated from ingested research papers:
python evaluate.py- Faithfulness Metric: Ensures answers are strictly grounded in retrieved research context.
- Answer Relevancy: Measures whether responses directly address user questions.
- Contextual Precision & Recall: Validates that retrieved chunks are dense in signal and noise-free.
IRPA/
βββ app.py # Streamlit application entry point & UI
βββ backend/
β βββ vector_store.py # Qdrant client, isolated collections & disk-caching
β βββ rag_graph.py # LangGraph state machine, agent nodes & dynamic router
β βββ paper_loader.py # Document loaders (PDF, Web scraping, arXiv API)
β βββ btw_handler.py # /btw side-channel conversational memory logic
β βββ models.py # Pydantic data schemas & state models
βββ documents/ # Sample research benchmarks & papers
βββ evaluate.py # DeepEval testing harness
βββ Dockerfile # Production container image specification
βββ DOCKER_GUIDE.md # Comprehensive AWS EC2 & Docker deployment guide
βββ requirements.txt # Project dependencies
βββ README.md
- Quota Throttling: Running on shared API free tiers may hit rate limits during heavy concurrent chunking.
- Qdrant Cloud Inactivity: Free-tier clusters may hibernate after extended inactivity.
- Session Teardown: Deleting a session from the UI currently retains historical checkpoint entries in SQLite.
Built with β€οΈ by Rohan Datusalia