Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

research-agent

Autonomous Multi-Agent Research Scientist — type a topic, get a full academic report.

Architecture

User Query
    │
    ▼
[Planner] ──► structured outline + search queries
    │
    ▼
[Researcher] ──► arXiv + Semantic Scholar → PDF extraction → text chunks
    │
    ▼
[Coder] ──► generates research structure diagram (PNG)
    │
    ▼
[Writer] ──► drafts each section from retrieved sources
    │
    ▼
[Reviewer] ──► fact-checks draft vs. sources
    │
    ├── issues found ──► [Critic] rewrites weak sections ──► back to Reviewer
    │                    (max 2 revision cycles)
    │
    └── APPROVED ──► [Citation Manager] formats APA bibliography
                          │
                          ▼
                    [Exporter] ──► .docx + .pdf

Agents

Agent Role
Planner Breaks topic into outline sections with search queries
Researcher Fetches papers from arXiv + Semantic Scholar, extracts PDF text
Coder Generates a structural diagram (Matplotlib PNG)
Writer Drafts each section using retrieved source material
Reviewer Fact-checks draft, flags hallucinations and unsupported claims
Critic Rewrites weak sections based on reviewer feedback
Citation Manager Formats APA bibliography from all sources

Setup

pip install -r requirements.txt

cp .env.example .env
# Edit .env and add your OPENAI_API_KEY

Usage

# Default query
python main.py

# Custom query
python main.py "Research transformer architectures in NLP."
python main.py "Survey of CRISPR gene editing techniques."

Output

Each run produces:

  • <topic>_report.docx — styled Word document with diagram, sections, and references
  • <topic>_report.pdf — PDF version
  • research_diagram.png — research structure diagram

File Structure

research-agent/
├── main.py          # CLI entry point
├── workflow.py      # LangGraph state graph
├── agents.py        # All 6 agents
├── state.py         # Pydantic ResearchState schema
├── exporter.py      # .docx and .pdf export
├── requirements.txt
└── .env.example

Configuration

Variable Description
GEMINI_API_KEY Required. gemini-2.5-flash is used for all agents.
SEMANTIC_SCHOLAR_API_KEY Optional. Increases Semantic Scholar rate limits.

The refinement loop runs at most 2 revision cycles (configurable via MAX_REVISIONS in workflow.py).

About

Autonomous multi-agent research scientist — type a topic, get a full academic report (.docx + .pdf) powered by LangGraph and Gemini.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages