Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”¬ IRPA : Intelligent Research Paper Assistant

Live Demo Python LangGraph Docker AWS EC2 LinkedIn

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


πŸ’‘ Why IRPA Exists

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.


✨ Key Features

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.

πŸ›οΈ System Architecture

                                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                β”‚   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.


πŸ› οΈ Tech Stack

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.

⚑ Local Installation & Setup

Prerequisites

  • Python 3.10+
  • Git
  • Qdrant Cloud Cluster & Google AI Studio API Key

1. Clone the Repository

git clone https://github.com/octorohan/IRPA.git
cd IRPA

2. Environment Setup

python -m venv venv
# On Windows:
.\venv\Scripts\activate
# On Linux/macOS:
source venv/bin/activate

pip install -r requirements.txt

3. Configure Credentials

Create 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"

4. Launch the Application

streamlit run app.py

Open your browser at http://localhost:8501.


🐳 Running with Docker

Option A: Pull from Docker Hub (Recommended)

# 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:latest

Option B: Build Locally

docker build -t irpa-app .
docker run -d -p 8501:8501 --env-file .env --name irpa-app irpa-app

πŸ“Š Evaluation & Benchmarking

IRPA 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.

πŸ“‚ Project Structure

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

πŸ“Œ Known Considerations

  • 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.

πŸ‘¨β€πŸ’» Author & Contact

Built with ❀️ by Rohan Datusalia

LinkedIn Email Live Demo


⭐ If you find this project helpful, please consider starring the repository!

About

An intelligent research paper assistant that uses Retrieval-Augmented Generation (RAG) to help users search, understand, and interact with research papers through contextual question answering

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages