Skip to content

mrittickdeb/ResearchGPT

Repository files navigation

ResearchGPT — Autonomous Research Intelligence

ResearchGPT is a production-grade autonomous research system designed to synthesize complex information across documents and the web using a 6-agent pipeline. It performs deep research, data extraction, parallel reasoning, and synthesis with automated knowledge graph generation.

Built with FastAPI, React, MongoDB Vector Search, and Ollama, powered by grok-3 / grok-3-mini (with Gemini Flash fallback).


🏗️ Architecture: The 6-Agent Pipeline

The core of ResearchGPT is a deliberate, sequential agentic pipeline that maximizes reasoning depth while minimizing context window fatigue and hallucinations.

1. Planner Agent (agents/planner.py)

  • Takes raw user queries and decomposes them into a structured ResearchPlan.
  • Determines research scope, required domains, search strategies, and analytical depth.
  • Injects insights from past user sessions (Memory Agent feedback loop).

2. Retrieval Agent (agents/retrieval.py)

  • Executes multi-source parallel searches across MongoDB Vector Search, Full-Text Search, arXiv, and Semantic Scholar.
  • Ranks, deduplicates, and fuses results using Reciprocal Rank Fusion (RRF).
  • Fetches raw PDF content and local Nomic embeddings for precise semantic matching.

3. Analysis Agent (agents/analysis.py)

  • Reads raw retrieved documents and extracts structured Findings.
  • Identifies core claims, methodologies, limitations, and recurring themes.
  • Runs in highly parallelized batches using bounded concurrency with grok-3-mini.

4. Reasoning Agent (agents/reasoning.py)

  • Contradiction Detection: Cross-references all claims to detect consensus and conflict.
  • Evidence Graph: Constructs a node-link graph mapping documents to themes and claims.
  • Gap Analysis: Evaluates findings against the original ResearchPlan to identify what's missing.

5. Synthesis Agent (agents/synthesis.py)

  • Synthesizes all data into 4 simultaneous output formats:
    1. Narrative Literature Review (Markdown with inline citations)
    2. Actionable Research Gaps
    3. Comparative Analysis Matrix (JSON/Table)
    4. Document-Theme Citation Matrix (Boolean grid)

6. Memory Agent (agents/memory.py)

  • Summarizes the completed research session.
  • Extracts new nodes and edges for the global topic knowledge graph.
  • Updates the user's persistent "Expertise Vector" stored in MongoDB.

🛠️ Tech Stack

Frontend (Client)

  • React 18 + Vite
  • TypeScript + Tailwind CSS
  • Zustand (State management)
  • React Router DOM
  • Glassmorphism aesthetic

Backend (ML Service)

  • Python 3.11 + FastAPI
  • Anthropic / xAI / Google LLM Routers (Exponential Backoff + Fallbacks)
  • nomic-embed-text via Ollama (Local Embeddings)
  • Asyncio (Parallel agent execution)

Infrastructure & Data

  • MongoDB Atlas (Vector Search & Document Store)
  • WebSockets (Real-time agent streaming to UI)

🚀 Getting Started

  1. Launch MongoDB & Ollama Ensure MongoDB Atlas URI is set and Ollama is running nomic-embed-text.

  2. Start Backend ML Service

    cd ml_service
    uvicorn main:app --reload --port 8000
  3. Start Frontend

    cd frontend
    npm run dev

ResearchGPT — Built for deliberate, autonomous intelligence.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors