Autonomous Multi-Agent Research Scientist — type a topic, get a full academic report.
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
| 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 |
pip install -r requirements.txt
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY# Default query
python main.py
# Custom query
python main.py "Research transformer architectures in NLP."
python main.py "Survey of CRISPR gene editing techniques."Each run produces:
<topic>_report.docx— styled Word document with diagram, sections, and references<topic>_report.pdf— PDF versionresearch_diagram.png— research structure diagram
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
| 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).