02 · GENAI · AGENTS · RESEARCH
AI Research Agent
Repository codename · ResearchGPT
An agentic research platform that takes any topic and returns a fully-cited report — gathering evidence from 13 verified sources, cross-checking claims against each other, scoring confidence, and voicing the result as a two-host podcast.
01 — THE PROBLEM
Most research tools sit at one of two extremes. Chatbots write fluent summaries but invent citations. Search engines return links and leave the synthesis to you. Neither one verifies anything.
I wanted a system where every paragraph traces back to a real source, and where disagreement between sources is surfaced rather than quietly averaged away. That constraint — traceability first — drove almost every architectural decision below.
The result is deliberately not a chatbot. It is an agentic pipeline with discrete, inspectable stages.
02 — ARCHITECTURE
Planner → Research → Retriever → Fact Checker → Writer → Visualization → Podcast → Report
03 — BUILD LOG
The decisions that shaped the system, and why each one was made.
-
Thirteen sources behind one interface
Wikipedia, SerpAPI, Tavily, arXiv, Semantic Scholar, CrossRef, GitHub, HuggingFace, Kaggle, GNews, NewsAPI, PubMed and OpenAlex each live behind a single
SourceAdaptercontract. Adding a fourteenth is one new file plus one line in the registry — no changes to the agents that consume them. -
Provider failover instead of a single LLM
Gemini → OpenRouter → Groq → Ollama, with automatic failover down the chain. Swapping the model that powers any stage is pure configuration, so a rate limit or an outage degrades the run instead of ending it.
-
Hybrid retrieval, not vectors alone
Pure vector search misses exact terms; pure keyword search misses paraphrase. The retriever runs both — ChromaDB with sentence-transformer embeddings alongside BM25 — and merges them with reciprocal rank fusion. Chunking is sentence-aware, so citations never land mid-sentence.
-
Fact checking as its own pipeline stage
Verification is a stage, not a prompt suffix. Claims are cross-checked across sources, conflicts are detected and resolved to a “likely correct” reading, and both per-claim and overall confidence scores travel with the finished report.
-
Charts built from data, never from the model
Publication trends, GitHub stars and model-download figures are computed deterministically from the raw API responses. The LLM is trusted only with the knowledge graph and the Mermaid mind map — the places where being generative is actually the point.
-
Production hygiene from the start
Structured logging that records latency and token usage per stage, Redis caching that degrades gracefully when Redis is absent, exponential-backoff retries, JWT auth, Celery workers and Docker Compose. The test suite mocks every external API, so
pytestruns with no network and no keys.
04 — WALKTHROUGH
Running it end to end.
-
Configure
Copy the example env file and add keys. Wikipedia, arXiv, CrossRef, OpenAlex, PubMed, Semantic Scholar, GitHub and HuggingFace all work with no key at all — a single LLM key is enough for a working system.
cp .env.example .env -
Run the backend
SQLite is the default database, so there is no setup step. Redis is optional in development; without it the cache simply no-ops, and jobs run in-process unless
USE_CELERY=true.cd backend python -m venv .venv && .venv\Scripts\activate pip install -r requirements.txt uvicorn app.main:app --reload # http://localhost:8000/docs -
Run the frontend
cd frontend npm install npm run dev # http://localhost:3000 -
Or skip both with Docker
docker compose up --build -
Start a research job
The API returns a
job_idimmediately. Polling that job shows progress moving through each agent stage, so a long run stays observable instead of becoming a spinner.POST /api/v1/research {"topic": "Quantum Computing in Healthcare", "depth": "standard", "language": "en"} -
Collect the output
Download the cited report as Markdown, HTML, PDF or DOCX — or stream the generated podcast.
GET /api/v1/research/{job_id} GET /api/v1/research/{job_id}/report?format=pdf
05 — STACK