Skip to content

Repository files navigation

Multi-Agent Research Assistant

An AI-powered multi-agent system that automatically analyzes academic research papers using Retrieval-Augmented Generation (RAG), hybrid search, and specialized AI agents.

The system extracts information from research papers, retrieves relevant context, generates structured summaries, critiques research quality, and produces comprehensive reports.


🚀 Features

  • 📄 Upload research papers (PDF)
  • 🔍 Hybrid Retrieval (Dense Embeddings + BM25)
  • 🧠 Multi-Agent Architecture
  • 📑 Automatic metadata extraction
  • 📖 OCR support for scanned PDFs
  • ✂️ Section-aware document chunking
  • 🚫 Reference page filtering
  • 📂 Parent-child chunking strategy
  • 🤖 Gemini with automatic Groq fallback
  • 📝 Structured research report generation
  • ⚡ FastAPI REST APIs
  • 🗄️ ChromaDB Vector Database

System Architecture

                                User Uploads PDF
                                        │
                                        ▼
                              PDF Processing Service
                                        │
          ┌─────────────────────────────┼─────────────────────────────┐
          │                             │                             │
          ▼                             ▼                             ▼
     PyMuPDF Loader               OCR Fallback             Metadata Extraction
                                                      (Title, Authors, Abstract)
          │
          ▼
   Reference Page Filtering
          │
          ▼
     Section Detection
          │
          ▼
 Parent → Child Chunking
          │
          ▼
 Metadata Enrichment
          │
          ▼
      ChromaDB Vector Store
          │
      ┌───┴─────────────┐
      ▼                 ▼
 Dense Retrieval     BM25 Retrieval
      │                 │
      └────── Hybrid Retrieval ───────┘
                      │
                      ▼
            Parent Context Expansion
                      │
                      ▼
                Multi-Agent Pipeline
                      │
      ┌─────────────────────────────────────────────┐
      │                                             │
      ▼                                             ▼
 Planner Agent                               Search Agent
      │                                             │
      ▼                                             ▼
 Research Agent ----------------------------► Review.py
      │                                             │
      ▼                                             ▼
 Summarizer Agent --------------------------► Critic Agent
      │
      ▼
 Writer Agent
      │
      ▼
 Final Research Report

Project Structure

multi_agent_research_assistant/
│
├── agents/                # AI agents
│   ├── planner_agent.py
│   ├── search_agent.py
│   ├── research_agent.py
│   ├── summarizer_agent.py
│   ├── writer_agent.py
│   ├── critic_agent.py
│   └── review_agent.py
│
├── api/                   # FastAPI endpoints
│
├── core/                  # Configuration & utilities
│
├── database/              # Database operations
│
├── orchestration/         # Multi-agent workflow
│
├── prompts/               # Agent prompts
│
├── reports/               # Generated reports
│
├── schemas/               # Pydantic schemas
│
├── services/
│   ├── rag_service.py
│   ├── pdf_processor.py
│   └── embedding_service.py
│
├── tests/
│
├── tools/
│
├── uploads/
│
├── vectorstore/
│
├── logs/
│
├── .env
├── Dockerfile
├── requirements.txt
└── main.py

Workflow

1. Upload PDF

The user uploads a research paper through the FastAPI endpoint.

2. PDF Processing

The system

  • extracts text using PyMuPDF
  • performs OCR if necessary
  • extracts metadata
  • removes reference pages
  • identifies document sections

3. Chunking

The processed document is converted into

  • parent documents
  • child chunks

Each chunk is enriched with metadata.

4. Indexing

The chunks are stored inside ChromaDB while BM25 indexes are built for lexical retrieval.

5. Query Processing

For every user query the system

  • checks metadata cache
  • performs hybrid retrieval
  • expands parent context
  • prepares context for the LLM

6. Multi-Agent Analysis

The retrieved context flows through specialized agents.

Planner

Search

Research

Summarizer

Critic

Writer

Final Report


AI Agents

Planner Agent

Plans the research workflow and determines the execution order.


Search Agent

Retrieves relevant document chunks using hybrid retrieval.


Research Agent

Analyzes retrieved content and extracts key information.


Summarizer Agent

Produces structured summaries and highlights important findings.


Critic Agent

Evaluates limitations, weaknesses, and missing information.


Writer Agent

Combines outputs from all agents into a structured research report.


Review Agent

Performs quality validation before generating the final response.


Tech Stack

Backend

  • FastAPI
  • Python

LLMs

  • Google Gemini
  • Groq (Fallback)

Retrieval

  • LangChain
  • ChromaDB
  • BM25
  • Sentence Transformers

PDF Processing

  • PyMuPDF
  • OCR

AI

  • Retrieval-Augmented Generation (RAG)
  • Hybrid Search
  • Multi-Agent Systems

Current Features

✅ PDF Upload

✅ OCR Support

✅ Metadata Extraction

✅ Hybrid Retrieval

✅ ChromaDB Integration

✅ BM25 Search

✅ Parent-Child Chunking

✅ Reference Filtering

✅ Multi-Agent Workflow

✅ Structured Report Generation

✅ Gemini → Groq Fallback


Future Improvements

  • Query routing
  • Multi-document analysis
  • Citation-aware retrieval
  • Agent memory
  • Streaming responses
  • Web research integration
  • Research paper comparison
  • Knowledge graph generation

Author

Prerna Mishra

About

AI-powered Multi-Agent Research Assistant built with FastAPI, Gemini, Tavily, and RAG. Supports automated research, PDF-based Q&A, report generation, history tracking, and system monitoring.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages