# willierhart/langgraph-multi-agent architecture

> Architecture diagram of the GitHub repository willierhart/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/willierhart/langgraph-multi-agent
- Repository: https://github.com/willierhart/langgraph-multi-agent

## Overview

This repository is a single-script LangGraph research assistant. A user query enters shared state at the coordinator, which either finalizes immediately or dispatches a research → critique → writing cycle; the writer returns control to the coordinator for another decision. Agent responses come from GPT-4o via LangChain. The README describes the same capabilities, though its example script name differs from the actual tree. The graph below follows the sampled implementation; research is prompt-driven rather than a separately evidenced search integration.

Main entry points: [`multi-agent.py`](https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py) (Coordinator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Workflow"]
  node_entry["Script Entry<br/>[multi-agent.py]"]
  node_state["Research State<br/>[multi-agent.py]"]
  node_output["Output Node<br/>[multi-agent.py]"]
end

subgraph group_agents["Research Agents"]
  node_coordinator["Coordinator<br/>[multi-agent.py]"]
  node_researcher["Researcher<br/>[multi-agent.py]"]
  node_critic["Critic<br/>[multi-agent.py]"]
  node_writer["Writer<br/>[multi-agent.py]"]
end

subgraph group_model["LLM Service"]
  node_openai{{"GPT-4o"}}
end

node_user(("User"))

node_user -->|"submits query"| node_entry
node_entry -->|"initializes"| node_state
node_entry -->|"invokes graph"| node_coordinator
node_coordinator -->|"requests decision"| node_openai
node_coordinator -->|"routes if needed"| node_researcher
node_coordinator -->|"routes if done"| node_output
node_researcher -->|"requests research"| node_openai
node_researcher -->|"dispatches next"| node_critic
node_critic -->|"requests review"| node_openai
node_critic -->|"dispatches next"| node_writer
node_writer -->|"requests synthesis"| node_openai
node_writer -->|"returns control"| node_coordinator
node_output -->|"returns state"| node_user

click node_entry "https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py"
click node_state "https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py"
click node_coordinator "https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py"
click node_researcher "https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py"
click node_critic "https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py"
click node_writer "https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py"
click node_output "https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.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_entry,node_state,node_output,node_user toneBlue
class node_coordinator,node_researcher,node_critic,node_writer toneAmber
class node_openai toneMint
```

## Components

### Workflow

- [Script Entry](https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py): `multi-agent.py`
- [Research State](https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py): `multi-agent.py`
- [Output Node](https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py): `multi-agent.py`

### Research Agents

- [Coordinator](https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py): `multi-agent.py`
- [Researcher](https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py): `multi-agent.py`
- [Critic](https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py): `multi-agent.py`
- [Writer](https://github.com/willierhart/langgraph-multi-agent/blob/main/multi-agent.py): `multi-agent.py`

### LLM Service

- **GPT-4o**

### Other components

- **User**

## Connections

- User → Script Entry: submits query (evidence: `multi-agent.py`)
- Script Entry → Research State: initializes (evidence: `multi-agent.py`)
- Script Entry → Coordinator: invokes graph (evidence: `multi-agent.py`)
- Coordinator → GPT-4o: requests decision (evidence: `multi-agent.py`)
- Coordinator → Researcher: routes if needed (evidence: `multi-agent.py`)
- Coordinator → Output Node: routes if done (evidence: `multi-agent.py`)
- Researcher → GPT-4o: requests research (evidence: `multi-agent.py`)
- Researcher → Critic: dispatches next (evidence: `multi-agent.py`)
- Critic → GPT-4o: requests review (evidence: `multi-agent.py`)
- Critic → Writer: dispatches next (evidence: `multi-agent.py`)
- Writer → GPT-4o: requests synthesis (evidence: `multi-agent.py`)
- Writer → Coordinator: returns control (evidence: `multi-agent.py`)
- Output Node → User: returns state (evidence: `multi-agent.py`)
