# anveshrai09/multi-agent-ai-researcher architecture

> Architecture diagram of the GitHub repository anveshrai09/multi-agent-ai-researcher, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anveshrai09/multi-agent-ai-researcher
- Repository: https://github.com/anveshrai09/multi-agent-ai-researcher

## Overview

ResearchMind accepts a topic through a Streamlit interface or a command-line pipeline, searches for sources, scrapes a selected page, drafts a report, and critiques it. Agent construction and report chains live in agents.py; tools.py implements Tavily search and page scraping. The README is empty, so capabilities and relationships here are based on the provided source excerpts and index; app.py is only partially excerpted.

Main entry points: [`app.py`](https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/app.py) (Streamlit interface), [`pipeline.py`](https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/pipeline.py) (CLI pipeline), [`agents.py`](https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/agents.py) (Reader stage), [`tools.py`](https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/tools.py) (Web search tool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_streamlit["Streamlit interface<br/>[app.py]"]
  node_cli["CLI pipeline<br/>[pipeline.py]"]
end

subgraph group_flow["Research workflow"]
  node_search_stage["Search stage<br/>[agents.py]"]
  node_reader_stage["Reader stage<br/>[agents.py]"]
end

subgraph group_agents["Agents and writing"]
  node_writer["Report writer<br/>[agents.py]"]
  node_critic["Report critic<br/>[agents.py]"]
end

subgraph group_retrieval["Web retrieval"]
  node_search_tool["Web search tool<br/>[tools.py]"]
  node_scrape_tool["Page scraper<br/>[tools.py]"]
end

node_user(("Researcher"))
node_tavily{{"Tavily Search"}}
node_web{{"Web pages"}}
node_llm{{"OpenAI model"}}

node_user -->|"enters topic"| node_streamlit
node_user -->|"enters topic"| node_cli
node_streamlit -->|"builds and invokes"| node_search_stage
node_streamlit -->|"builds and invokes"| node_reader_stage
node_streamlit -->|"invokes"| node_writer
node_streamlit -->|"invokes"| node_critic
node_cli -->|"builds and invokes"| node_search_stage
node_cli -->|"builds and invokes"| node_reader_stage
node_cli -->|"invokes"| node_writer
node_cli -->|"invokes"| node_critic
node_search_stage -->|"registers tool"| node_search_tool
node_reader_stage -->|"registers tool"| node_scrape_tool
node_search_tool -->|"searches via"| node_tavily
node_scrape_tool -->|"fetches page"| node_web
node_search_stage -->|"uses model"| node_llm
node_reader_stage -->|"uses model"| node_llm
node_writer -->|"uses model"| node_llm
node_critic -->|"uses model"| node_llm
node_streamlit -->|"passes search results"| node_reader_stage
node_streamlit -->|"passes research"| node_writer
node_streamlit -->|"passes report"| node_critic
node_cli -->|"passes search results"| node_reader_stage
node_cli -->|"passes research"| node_writer
node_cli -->|"passes report"| node_critic

click node_streamlit "https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/app.py"
click node_cli "https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/pipeline.py"
click node_search_stage "https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/agents.py"
click node_reader_stage "https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/agents.py"
click node_writer "https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/agents.py"
click node_critic "https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/agents.py"
click node_search_tool "https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/tools.py"
click node_scrape_tool "https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/tools.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_streamlit,node_cli toneBlue
class node_search_stage,node_reader_stage toneAmber
class node_writer,node_critic toneMint
class node_search_tool,node_scrape_tool toneRose
class node_user,node_tavily,node_web,node_llm toneIndigo
```

## Components

### Entry points

- [Streamlit interface](https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/app.py): `app.py`
- [CLI pipeline](https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/pipeline.py): `pipeline.py`

### Research workflow

- [Search stage](https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/agents.py): `agents.py`
- [Reader stage](https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/agents.py): `agents.py`

### Agents and writing

- [Report writer](https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/agents.py): `agents.py`
- [Report critic](https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/agents.py): `agents.py`

### Web retrieval

- [Web search tool](https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/tools.py): `tools.py`
- [Page scraper](https://github.com/anveshrai09/multi-agent-ai-researcher/blob/main/tools.py): `tools.py`

### Other components

- **Researcher**
- **Tavily Search**
- **Web pages**
- **OpenAI model**

## Connections

- Researcher → Streamlit interface: enters topic (evidence: `app.py`)
- Researcher → CLI pipeline: enters topic (evidence: `pipeline.py`)
- Streamlit interface → Search stage: builds and invokes (evidence: `app.py`)
- Streamlit interface → Reader stage: builds and invokes (evidence: `app.py`)
- Streamlit interface → Report writer: invokes (evidence: `app.py`)
- Streamlit interface → Report critic: invokes (evidence: `app.py`)
- CLI pipeline → Search stage: builds and invokes (evidence: `pipeline.py`)
- CLI pipeline → Reader stage: builds and invokes (evidence: `pipeline.py`)
- CLI pipeline → Report writer: invokes (evidence: `pipeline.py`)
- CLI pipeline → Report critic: invokes (evidence: `pipeline.py`)
- Search stage → Web search tool: registers tool (evidence: `agents.py`)
- Reader stage → Page scraper: registers tool (evidence: `agents.py`)
- Web search tool → Tavily Search: searches via (evidence: `tools.py`)
- Page scraper → Web pages: fetches page (evidence: `tools.py`)
- Search stage → OpenAI model: uses model (evidence: `agents.py`)
- Reader stage → OpenAI model: uses model (evidence: `agents.py`)
- Report writer → OpenAI model: uses model (evidence: `agents.py`)
- Report critic → OpenAI model: uses model (evidence: `agents.py`)
- Streamlit interface → Reader stage: passes search results (evidence: `app.py`)
- Streamlit interface → Report writer: passes research (evidence: `app.py`)
- Streamlit interface → Report critic: passes report (evidence: `app.py`)
- CLI pipeline → Reader stage: passes search results (evidence: `pipeline.py`)
- CLI pipeline → Report writer: passes research (evidence: `pipeline.py`)
- CLI pipeline → Report critic: passes report (evidence: `pipeline.py`)
