# ki11e6/langgraph-multi-agent architecture

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

- Interactive diagram: https://gitdiagram.com/ki11e6/langgraph-multi-agent
- Repository: https://github.com/ki11e6/langgraph-multi-agent

## Overview

A CLI research assistant turns a user query into a cited report or an explicit grounding refusal. The CLI builds and streams a LangGraph workflow; its supervisor dispatches research and initial drafting, then deterministic validation gates review and revision. Optional human review can override the reviewer's decision. Research uses DuckDuckGo and page fetching, while agent reasoning uses a configurable LLM provider. The graph and tool excerpts establish core calls; broader workflow routing and optional integrations are documented in the README, so those edges cite it.

Main entry points: [`agents/graph.py`](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py) (Writer), [`main.py`](https://github.com/ki11e6/langgraph-multi-agent/blob/main/main.py) (CLI runner), [`agents/tools.py`](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/tools.py) (Web search tool), [`agents/config.py`](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/config.py) (Provider configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Query interface"]
  node_cli["CLI runner<br/>[main.py]"]
end

subgraph group_workflow["Agent workflow"]
  node_graph["Graph builder<br/>[graph.py]"]
  node_supervisor["Supervisor<br/>[graph.py]"]
  node_researcher["Researcher<br/>[graph.py]"]
  node_writer["Writer<br/>[graph.py]"]
  node_validator["Grounding validator<br/>[graph.py]"]
  node_reviewer["Reviewer<br/>[graph.py]"]
  node_human_review["Human review pause<br/>[graph.py]"]
  node_state[("Shared agent state<br/>[graph.py]")]
end

subgraph group_research["Web research"]
  node_web_search["Web search tool<br/>[tools.py]"]
  node_duckduckgo["DuckDuckGo"]
  node_page_fetch["Page text fetch<br/>[tools.py]"]
  node_web_pages["Web pages"]
end

subgraph group_models["Model access"]
  node_llm_config["Provider configuration<br/>[config.py]"]
  node_llm_service["LLM providers"]
end

node_user(("Research user"))

node_user -->|"submits query"| node_cli
node_cli -->|"builds graph"| node_graph
node_cli -->|"streams updates"| node_state
node_graph -->|"registers node"| node_supervisor
node_supervisor -->|"routes research"| node_researcher
node_researcher -->|"searches sources"| node_web_search
node_web_search -->|"searches web"| node_duckduckgo
node_web_search -->|"fetches pages"| node_page_fetch
node_page_fetch -->|"reads text"| node_web_pages
node_researcher -->|"returns sources"| node_supervisor
node_supervisor -->|"routes drafting"| node_writer
node_writer -->|"submits draft"| node_validator
node_validator -->|"routes grounded draft"| node_reviewer
node_validator -->|"reports refusal"| node_cli
node_reviewer -->|"routes revision"| node_writer
node_reviewer -.->|"pauses optionally"| node_human_review
node_human_review -->|"requests revision"| node_writer
node_human_review -->|"returns decision"| node_cli
node_writer -->|"gets model"| node_llm_config
node_reviewer -->|"gets model"| node_llm_config
node_supervisor -->|"gets model"| node_llm_config
node_llm_config -->|"selects provider"| node_llm_service
node_web_search -->|"returns sources"| node_state
node_writer -->|"updates draft"| node_state
node_validator -->|"records validation"| node_state
node_reviewer -->|"records verdict"| node_state

click node_cli "https://github.com/ki11e6/langgraph-multi-agent/blob/main/main.py"
click node_graph "https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py"
click node_supervisor "https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py"
click node_researcher "https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py"
click node_writer "https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py"
click node_validator "https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py"
click node_reviewer "https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py"
click node_human_review "https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py"
click node_state "https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py"
click node_web_search "https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/tools.py"
click node_page_fetch "https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/tools.py"
click node_llm_config "https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/config.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_cli,node_user toneBlue
class node_graph,node_supervisor,node_researcher,node_writer,node_validator,node_reviewer,node_human_review,node_state toneAmber
class node_web_search,node_duckduckgo,node_page_fetch,node_web_pages toneMint
class node_llm_config,node_llm_service toneRose
```

## Components

### Query interface

- [CLI runner](https://github.com/ki11e6/langgraph-multi-agent/blob/main/main.py): `main.py`

### Agent workflow

- [Graph builder](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py): `agents/graph.py`
- [Supervisor](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py): `agents/graph.py`
- [Researcher](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py): `agents/graph.py`
- [Writer](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py): `agents/graph.py`
- [Grounding validator](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py): `agents/graph.py`
- [Reviewer](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py): `agents/graph.py`
- [Human review pause](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py): `agents/graph.py`
- [Shared agent state](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/graph.py): `agents/graph.py`

### Web research

- [Web search tool](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/tools.py): `agents/tools.py`
- **DuckDuckGo**
- [Page text fetch](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/tools.py): `agents/tools.py`
- **Web pages**

### Model access

- [Provider configuration](https://github.com/ki11e6/langgraph-multi-agent/blob/main/agents/config.py): `agents/config.py`
- **LLM providers**

### Other components

- **Research user**

## Connections

- Research user → CLI runner: submits query (evidence: `README.md`)
- CLI runner → Graph builder: builds graph (evidence: `main.py`)
- CLI runner → Shared agent state: streams updates (evidence: `main.py`)
- Graph builder → Supervisor: registers node (evidence: `README.md`)
- Supervisor → Researcher: routes research (evidence: `README.md`)
- Researcher → Web search tool: searches sources (evidence: `README.md`)
- Web search tool → DuckDuckGo: searches web (evidence: `agents/tools.py`)
- Web search tool → Page text fetch: fetches pages (evidence: `agents/tools.py`)
- Page text fetch → Web pages: reads text (evidence: `agents/tools.py`)
- Researcher → Supervisor: returns sources (evidence: `README.md`)
- Supervisor → Writer: routes drafting (evidence: `README.md`)
- Writer → Grounding validator: submits draft (evidence: `README.md`)
- Grounding validator → Reviewer: routes grounded draft (evidence: `README.md`)
- Grounding validator → CLI runner: reports refusal (evidence: `README.md`)
- Reviewer → Writer: routes revision (evidence: `README.md`)
- Reviewer → Human review pause: pauses optionally (evidence: `README.md`)
- Human review pause → Writer: requests revision (evidence: `README.md`)
- Human review pause → CLI runner: returns decision (evidence: `main.py`)
- Writer → Provider configuration: gets model (evidence: `agents/graph.py`)
- Reviewer → Provider configuration: gets model (evidence: `agents/graph.py`)
- Supervisor → Provider configuration: gets model (evidence: `agents/graph.py`)
- Provider configuration → LLM providers: selects provider (evidence: `agents/config.py`)
- Web search tool → Shared agent state: returns sources (evidence: `README.md`)
- Writer → Shared agent state: updates draft (evidence: `README.md`)
- Grounding validator → Shared agent state: records validation (evidence: `README.md`)
- Reviewer → Shared agent state: records verdict (evidence: `README.md`)
