# mohangattu/enterprise-langgraph-ai architecture

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

- Interactive diagram: https://gitdiagram.com/mohangattu/enterprise-langgraph-ai
- Repository: https://github.com/mohangattu/enterprise-langgraph-ai

## Overview

Enterprise LangGraph AI accepts chat requests through a REST API or streaming CLI, routes work through a CEO supervisor to research or coding departments, and returns a composed response. Department supervisors dispatch to specialized agents, whose drafts become department outputs for the CEO. The README documents provider support, streaming, retries, logging, and thread checkpointing; some wiring beyond the sampled source is therefore represented only where the tree or documentation supports it.

Main entry points: [`graphs/ceo_graph.py`](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/graphs/ceo_graph.py) (CEO graph), [`agents.py`](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/agents.py) (CEO supervisor), [`services/chat_services.py`](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/services/chat_services.py) (Chat service), [`departments/research/graph.py`](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/research/graph.py) (Research graph)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_api["REST API<br/>[api.py]"]
  node_request_schema["Chat request<br/>[request.py]"]
  node_chat_service["Chat service<br/>[chat_services.py]"]
  node_response_schema["Chat response<br/>[response.py]"]
  node_cli["Streaming CLI<br/>[app.py]"]
end

subgraph group_orchestration["CEO orchestration"]
  node_ceo_graph["CEO graph<br/>[ceo_graph.py]"]
  node_ceo_agents["CEO supervisor<br/>[agents.py]"]
  node_department_registry["Department registry<br/>[registry.py]"]
  node_ceo_state["CEO state<br/>[state.py]"]
end

subgraph group_research["Research department"]
  node_research_graph["Research graph<br/>[graph.py]"]
  node_research_registry["Research registry<br/>[registry.py]"]
  node_research_agents["Research agents<br/>[agents.py]"]
  node_research_state["Research state<br/>[state.py]"]
end

subgraph group_coding["Coding department"]
  node_coding_graph["Coding graph<br/>[graph.py]"]
  node_coding_registry["Coding registry<br/>[registry.py]"]
  node_coding_agents["Coding agents<br/>[agents.py]"]
  node_coding_state["Coding state<br/>[state.py]"]
end

subgraph group_runtime["Runtime services"]
  node_llm_factory["LLM factory<br/>[config.py]"]
  node_stream_helper["Stream helper<br/>[streaming.py]"]
  node_checkpointer[("Thread checkpoint<br/>[checkpoint.py]")]
  node_retry["Retry policy<br/>[retry.py]"]
end

node_user(("User"))
node_llm_providers["LLM providers"]

node_user -->|"submits request"| node_api
node_api -->|"validates"| node_request_schema
node_api -->|"calls"| node_chat_service
node_chat_service -->|"invokes"| node_ceo_graph
node_ceo_graph -->|"returns result"| node_chat_service
node_chat_service -->|"formats response"| node_response_schema
node_user -->|"enters query"| node_cli
node_cli -->|"streams through"| node_stream_helper
node_stream_helper -->|"streams graph"| node_ceo_graph
node_ceo_graph -->|"dispatches supervisor"| node_ceo_agents
node_ceo_agents -->|"looks up department"| node_department_registry
node_ceo_graph -->|"dispatches research"| node_research_graph
node_ceo_graph -->|"dispatches coding"| node_coding_graph
node_research_graph -->|"routes agents"| node_research_registry
node_research_registry -->|"selects agents"| node_research_agents
node_coding_graph -->|"routes agents"| node_coding_registry
node_coding_registry -->|"selects agents"| node_coding_agents
node_ceo_agents -->|"invokes department"| node_research_graph
node_ceo_agents -->|"invokes department"| node_coding_graph
node_ceo_graph -->|"updates state"| node_ceo_state
node_research_graph -->|"updates state"| node_research_state
node_coding_graph -->|"updates state"| node_coding_state
node_ceo_graph -->|"compiles with"| node_checkpointer
node_llm_factory -.->|"creates clients"| node_llm_providers
node_ceo_agents -->|"uses model"| node_llm_factory
node_research_agents -->|"uses model"| node_llm_factory
node_coding_agents -->|"uses model"| node_llm_factory
node_ceo_agents -->|"retries calls"| node_retry
node_research_agents -->|"retries calls"| node_retry
node_coding_agents -->|"retries calls"| node_retry

click node_api "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/api.py"
click node_request_schema "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/schemes/request.py"
click node_chat_service "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/services/chat_services.py"
click node_response_schema "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/schemes/response.py"
click node_cli "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/app.py"
click node_ceo_graph "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/graphs/ceo_graph.py"
click node_ceo_agents "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/agents.py"
click node_department_registry "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/registry.py"
click node_ceo_state "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/state.py"
click node_research_graph "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/research/graph.py"
click node_research_registry "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/research/registry.py"
click node_research_agents "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/research/agents.py"
click node_research_state "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/research/state.py"
click node_coding_graph "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/coding/graph.py"
click node_coding_registry "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/coding/registry.py"
click node_coding_agents "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/coding/agents.py"
click node_coding_state "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/coding/state.py"
click node_llm_factory "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/config.py"
click node_stream_helper "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/core/streaming.py"
click node_checkpointer "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/core/checkpoint.py"
click node_retry "https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/core/retry.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_api,node_request_schema,node_chat_service,node_response_schema,node_cli,node_user toneBlue
class node_ceo_graph,node_ceo_agents,node_department_registry,node_ceo_state toneAmber
class node_research_graph,node_research_registry,node_research_agents,node_research_state toneMint
class node_coding_graph,node_coding_registry,node_coding_agents,node_coding_state toneRose
class node_llm_factory,node_stream_helper,node_checkpointer,node_retry,node_llm_providers toneIndigo
```

## Components

### User interfaces

- [REST API](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/api.py): `api.py`
- [Chat request](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/schemes/request.py): `schemes/request.py`
- [Chat service](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/services/chat_services.py): `services/chat_services.py`
- [Chat response](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/schemes/response.py): `schemes/response.py`
- [Streaming CLI](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/app.py): `app.py`

### CEO orchestration

- [CEO graph](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/graphs/ceo_graph.py): `graphs/ceo_graph.py`
- [CEO supervisor](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/agents.py): `agents.py`
- [Department registry](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/registry.py): `registry.py`
- [CEO state](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/state.py): `state.py`

### Research department

- [Research graph](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/research/graph.py): `departments/research/graph.py`
- [Research registry](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/research/registry.py): `departments/research/registry.py`
- [Research agents](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/research/agents.py): `departments/research/agents.py`
- [Research state](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/research/state.py): `departments/research/state.py`

### Coding department

- [Coding graph](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/coding/graph.py): `departments/coding/graph.py`
- [Coding registry](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/coding/registry.py): `departments/coding/registry.py`
- [Coding agents](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/coding/agents.py): `departments/coding/agents.py`
- [Coding state](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/departments/coding/state.py): `departments/coding/state.py`

### Runtime services

- [LLM factory](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/config.py): `config.py`
- [Stream helper](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/core/streaming.py): `core/streaming.py`
- [Thread checkpoint](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/core/checkpoint.py): `core/checkpoint.py`
- [Retry policy](https://github.com/mohangattu/enterprise-langgraph-ai/blob/main/core/retry.py): `core/retry.py`

### Other components

- **User**
- **LLM providers**

## Connections

- User → REST API: submits request
- REST API → Chat request: validates
- REST API → Chat service: calls
- Chat service → CEO graph: invokes
- CEO graph → Chat service: returns result
- Chat service → Chat response: formats response
- User → Streaming CLI: enters query
- Streaming CLI → Stream helper: streams through
- Stream helper → CEO graph: streams graph
- CEO graph → CEO supervisor: dispatches supervisor
- CEO supervisor → Department registry: looks up department
- CEO graph → Research graph: dispatches research
- CEO graph → Coding graph: dispatches coding
- Research graph → Research registry: routes agents
- Research registry → Research agents: selects agents
- Coding graph → Coding registry: routes agents
- Coding registry → Coding agents: selects agents
- CEO supervisor → Research graph: invokes department
- CEO supervisor → Coding graph: invokes department
- CEO graph → CEO state: updates state
- Research graph → Research state: updates state
- Coding graph → Coding state: updates state
- CEO graph → Thread checkpoint: compiles with
- LLM factory → LLM providers: creates clients
- CEO supervisor → LLM factory: uses model
- Research agents → LLM factory: uses model
- Coding agents → LLM factory: uses model
- CEO supervisor → Retry policy: retries calls
- Research agents → Retry policy: retries calls
- Coding agents → Retry policy: retries calls
