# theallkeeeymist/multi-agent-researcher-report-generator architecture

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

- Interactive diagram: https://gitdiagram.com/theallkeeeymist/multi-agent-researcher-report-generator
- Repository: https://github.com/theallkeeeymist/multi-agent-researcher-report-generator

## Overview

This is a web-based research and report generator. A user signs in and submits a question through the Streamlit UI; the FastAPI endpoint queues a Celery task, which runs a LangGraph workflow: planning, parallel source gathering and synthesis, critique with bounded revision, then report writing. The UI polls for completion and displays the report. The excerpts show the task running the graph in-process and Redis-backed Celery dispatch, but do not show separate workers or the README-described PostgreSQL checkpointer, so those are not represented as implemented components.

Main entry points: [`src/agent/build_graph.py`](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/build_graph.py) (Graph Builder), [`src/agent/nodes.py`](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/nodes.py) (Research Synthesizer), [`src/tools/tools.py`](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/tools/tools.py) (Search Tools), [`frontend/app.py`](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/frontend/app.py) (Streamlit UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_ui["Streamlit UI<br/>[app.py]"]
  node_ui_client["API Polling Client<br/>[api.py]"]
end

subgraph group_backend["API and Execution"]
  node_auth["Google Sign-in<br/>[routes.py]"]
  node_api["FastAPI Routes<br/>[routes.py]"]
  node_queue["Celery Task Queue<br/>[routes.py]"]
  node_task["Research Task<br/>[routes.py]"]
end

subgraph group_workflow["Research Workflow"]
  node_graph["Graph Builder<br/>[build_graph.py]"]
  node_state["Research State<br/>[state.py]"]
  node_planner["Topic Planner<br/>[nodes.py]"]
  node_researcher["Research Synthesizer<br/>[nodes.py]"]
  node_critic["Quality Critic<br/>[nodes.py]"]
  node_routing["Critic Routing<br/>[edges.py]"]
  node_writer["Report Writer<br/>[nodes.py]"]
  node_helpers["Research Helpers<br/>[helpers.py]"]
end

subgraph group_integrations["Models and Sources"]
  node_llm["Groq LLMs<br/>[llm_client.py]"]
  node_mcp_client["MCP Client<br/>[mcp_client.py]"]
  node_mcp_server["MCP Tool Server<br/>[server.py]"]
  node_search_tools["Search Tools<br/>[tools.py]"]
end

node_user(("Researcher"))
node_redis[("Redis Broker")]
node_web["DuckDuckGo"]
node_arxiv["arXiv"]
node_semantic["Semantic Scholar"]

node_user -->|"submits question"| node_ui
node_ui -->|"starts sign-in"| node_auth
node_auth -->|"returns token"| node_ui
node_ui -->|"calls"| node_ui_client
node_ui_client -->|"submits and polls"| node_api
node_api -->|"dispatches task"| node_queue
node_queue -->|"uses broker"| node_redis
node_queue -->|"runs task"| node_task
node_task -->|"invokes graph"| node_graph
node_task -->|"starts and stops session"| node_mcp_client
node_graph -->|"routes workflow"| node_planner
node_graph -->|"routes workflow"| node_researcher
node_graph -->|"routes workflow"| node_critic
node_graph -->|"routes workflow"| node_writer
node_graph -->|"routes after critique"| node_routing
node_planner -->|"generates topics"| node_llm
node_researcher -->|"researches topics"| node_helpers
node_researcher -->|"synthesizes findings"| node_llm
node_researcher -->|"loads tools"| node_mcp_client
node_helpers -->|"requests tool calls"| node_llm
node_helpers -->|"invokes selected tools"| node_search_tools
node_critic -->|"scores draft"| node_llm
node_critic -->|"provides rating"| node_routing
node_routing -->|"retries if needed"| node_researcher
node_routing -->|"accepts draft"| node_writer
node_writer -->|"writes report"| node_llm
node_mcp_client -->|"opens stdio session"| node_mcp_server
node_mcp_server -->|"loads server tools"| node_search_tools
node_search_tools -->|"searches web"| node_web
node_search_tools -->|"searches papers"| node_arxiv
node_search_tools -->|"searches papers"| node_semantic
node_api -->|"returns task status and result"| node_ui_client
node_ui_client -->|"returns report"| node_ui
node_graph -->|"uses workflow state"| node_state
node_planner -->|"reads and updates"| node_state
node_researcher -->|"reads and updates"| node_state
node_critic -->|"reads and updates"| node_state
node_writer -->|"reads and updates"| node_state

click node_ui "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/frontend/app.py"
click node_ui_client "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/frontend/api.py"
click node_auth "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/api/routes.py"
click node_api "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/api/routes.py"
click node_queue "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/api/routes.py"
click node_task "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/api/routes.py"
click node_graph "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/build_graph.py"
click node_state "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/state.py"
click node_planner "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/nodes.py"
click node_researcher "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/nodes.py"
click node_critic "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/nodes.py"
click node_routing "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/edges.py"
click node_writer "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/nodes.py"
click node_helpers "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/utils/helpers.py"
click node_llm "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/models/llm_client.py"
click node_mcp_client "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/tools/mcp_client.py"
click node_mcp_server "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/tools/server.py"
click node_search_tools "https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/tools/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_ui,node_ui_client toneBlue
class node_auth,node_api,node_queue,node_task,node_redis toneAmber
class node_graph,node_state,node_planner,node_researcher,node_critic,node_routing,node_writer,node_helpers toneMint
class node_llm,node_mcp_client,node_mcp_server,node_search_tools toneRose
class node_user,node_web,node_arxiv,node_semantic toneIndigo
```

## Components

### User Interface

- [Streamlit UI](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/frontend/app.py): `frontend/app.py`
- [API Polling Client](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/frontend/api.py): `frontend/api.py`

### API and Execution

- [Google Sign-in](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/api/routes.py): `src/api/routes.py`
- [FastAPI Routes](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/api/routes.py): `src/api/routes.py`
- [Celery Task Queue](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/api/routes.py): `src/api/routes.py`
- [Research Task](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/api/routes.py): `src/api/routes.py`

### Research Workflow

- [Graph Builder](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/build_graph.py): `src/agent/build_graph.py`
- [Research State](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/state.py): `src/agent/state.py`
- [Topic Planner](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/nodes.py): `src/agent/nodes.py`
- [Research Synthesizer](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/nodes.py): `src/agent/nodes.py`
- [Quality Critic](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/nodes.py): `src/agent/nodes.py`
- [Critic Routing](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/edges.py): `src/agent/edges.py`
- [Report Writer](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/agent/nodes.py): `src/agent/nodes.py`
- [Research Helpers](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/utils/helpers.py): `src/utils/helpers.py`

### Models and Sources

- [Groq LLMs](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/models/llm_client.py): `src/models/llm_client.py`
- [MCP Client](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/tools/mcp_client.py): `src/tools/mcp_client.py`
- [MCP Tool Server](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/tools/server.py): `src/tools/server.py`
- [Search Tools](https://github.com/theallkeeeymist/multi-agent-researcher-report-generator/blob/main/src/tools/tools.py): `src/tools/tools.py`

### Other components

- **Researcher**
- **Redis Broker**
- **DuckDuckGo**
- **arXiv**
- **Semantic Scholar**

## Connections

- Researcher → Streamlit UI: submits question (evidence: `frontend/app.py`)
- Streamlit UI → Google Sign-in: starts sign-in (evidence: `frontend/app.py`)
- Google Sign-in → Streamlit UI: returns token (evidence: `src/api/routes.py`)
- Streamlit UI → API Polling Client: calls (evidence: `frontend/app.py`)
- API Polling Client → FastAPI Routes: submits and polls (evidence: `frontend/api.py`)
- FastAPI Routes → Celery Task Queue: dispatches task (evidence: `src/api/routes.py`)
- Celery Task Queue → Redis Broker: uses broker (evidence: `src/api/routes.py`)
- Celery Task Queue → Research Task: runs task (evidence: `src/api/routes.py`)
- Research Task → Graph Builder: invokes graph (evidence: `src/api/routes.py`)
- Research Task → MCP Client: starts and stops session (evidence: `src/api/routes.py`)
- Graph Builder → Topic Planner: routes workflow (evidence: `src/agent/build_graph.py`)
- Graph Builder → Research Synthesizer: routes workflow (evidence: `src/agent/build_graph.py`)
- Graph Builder → Quality Critic: routes workflow (evidence: `src/agent/build_graph.py`)
- Graph Builder → Report Writer: routes workflow (evidence: `src/agent/build_graph.py`)
- Graph Builder → Critic Routing: routes after critique (evidence: `src/agent/build_graph.py`)
- Topic Planner → Groq LLMs: generates topics (evidence: `src/agent/nodes.py`)
- Research Synthesizer → Research Helpers: researches topics (evidence: `src/agent/nodes.py`)
- Research Synthesizer → Groq LLMs: synthesizes findings (evidence: `src/agent/nodes.py`)
- Research Synthesizer → MCP Client: loads tools (evidence: `src/agent/nodes.py`)
- Research Helpers → Groq LLMs: requests tool calls (evidence: `src/utils/helpers.py`)
- Research Helpers → Search Tools: invokes selected tools (evidence: `src/utils/helpers.py`)
- Quality Critic → Groq LLMs: scores draft (evidence: `src/agent/nodes.py`)
- Quality Critic → Critic Routing: provides rating (evidence: `src/agent/build_graph.py`)
- Critic Routing → Research Synthesizer: retries if needed (evidence: `src/agent/edges.py`)
- Critic Routing → Report Writer: accepts draft (evidence: `src/agent/edges.py`)
- Report Writer → Groq LLMs: writes report (evidence: `src/agent/nodes.py`)
- MCP Client → MCP Tool Server: opens stdio session (evidence: `src/tools/mcp_client.py`)
- MCP Tool Server → Search Tools: loads server tools (evidence: `src/tools/server.py`)
- Search Tools → DuckDuckGo: searches web (evidence: `src/tools/tools.py`)
- Search Tools → arXiv: searches papers (evidence: `src/tools/tools.py`)
- Search Tools → Semantic Scholar: searches papers (evidence: `src/tools/tools.py`)
- FastAPI Routes → API Polling Client: returns task status and result (evidence: `src/api/routes.py`)
- API Polling Client → Streamlit UI: returns report (evidence: `frontend/api.py`)
- Graph Builder → Research State: uses workflow state (evidence: `src/agent/build_graph.py`)
- Topic Planner → Research State: reads and updates (evidence: `src/agent/nodes.py`)
- Research Synthesizer → Research State: reads and updates (evidence: `src/agent/nodes.py`)
- Quality Critic → Research State: reads and updates (evidence: `src/agent/nodes.py`)
- Report Writer → Research State: reads and updates (evidence: `src/agent/nodes.py`)
