# cuiyuheng/multi-agent-orchestrator architecture

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

- Interactive diagram: https://gitdiagram.com/cuiyuheng/multi-agent-orchestrator
- Repository: https://github.com/cuiyuheng/multi-agent-orchestrator

## Overview

Multi-Agent Orchestrator is a Python and TypeScript framework for routing multi-turn conversations among specialized AI agents. The principal workflow loads conversation context, classifies the user’s intent against available agents, dispatches the request, and saves the exchange before returning the response. The graph preserves both language implementations, built-in agent and classifier families, retrieval, and pluggable conversation storage. Relationships follow the README’s workflow and the shown orchestrator calls or imports; unsampled agent details are represented at their existing directories rather than inferred individually.

Main entry points: [`typescript/src/orchestrator.ts`](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/orchestrator.ts) (TS orchestrator), [`python/src/multi_agent_orchestrator/orchestrator.py`](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/orchestrator.py) (Python orchestrator), [`typescript/src/storage/chatStorage.ts`](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/storage/chatStorage.ts) (TS chat storage), [`python/src/multi_agent_orchestrator/storage/chat_storage.py`](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/storage/chat_storage.py) (Python chat storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flow["Orchestration"]
  node_ts_orch["TS orchestrator<br/>[orchestrator.ts]"]
  node_py_orch["Python orchestrator<br/>[orchestrator.py]"]
  node_ts_stream["Streaming helpers<br/>[helpers.ts]"]
end

subgraph group_routing["Intent routing"]
  node_ts_classifier["TS classifier base<br/>[classifier.ts]"]
  node_ts_classifiers["TS classifier variants"]
  node_py_classifier["Python classifier base<br/>[classifier.py]"]
  node_py_classifiers["Python classifier variants"]
  node_ts_overlap["Agent overlap analysis"]
end

subgraph group_agents["Agent execution"]
  node_ts_agent_base["TS agent contract<br/>[agent.ts]"]
  node_ts_agents["TS agent implementations"]
  node_py_agent_base["Python agent contract<br/>[agent.py]"]
  node_py_agents["Python agent implementations"]
end

subgraph group_context["Context and retrieval"]
  node_ts_storage["TS chat storage<br/>[chatStorage.ts]"]
  node_ts_memory[("TS memory storage")]
  node_ts_dynamo[("TS DynamoDB storage")]
  node_py_storage["Python chat storage<br/>[chat_storage.py]"]
  node_py_memory[("Python memory storage")]
  node_py_dynamo[("Python DynamoDB storage")]
  node_ts_retriever["TS knowledge retrieval"]
  node_py_retriever["Python knowledge retrieval"]
end

node_user(("User"))

node_user -->|"submits request"| node_ts_orch
node_user -->|"submits request"| node_py_orch
node_ts_orch -->|"loads history"| node_ts_storage
node_ts_orch -->|"classifies intent"| node_ts_classifier
node_ts_orch -->|"dispatches request"| node_ts_agents
node_ts_orch -->|"saves exchange"| node_ts_storage
node_ts_orch -->|"defaults to"| node_ts_memory
node_ts_orch -->|"analyzes overlap"| node_ts_overlap
node_ts_classifier -->|"uses agent descriptions"| node_ts_agent_base
node_ts_classifiers -->|"extends classifier"| node_ts_classifier
node_ts_agent_base -->|"uses stream accumulator"| node_ts_stream
node_ts_agents -->|"retrieves knowledge"| node_ts_retriever
node_ts_storage -->|"implemented by"| node_ts_memory
node_ts_storage -->|"implemented by"| node_ts_dynamo
node_py_orch -->|"uses storage"| node_py_storage
node_py_orch -->|"uses classifier"| node_py_classifier
node_py_orch -->|"dispatches request"| node_py_agents
node_py_classifier -->|"uses agent descriptions"| node_py_agent_base
node_py_classifiers -->|"extends classifier"| node_py_classifier
node_py_agent_base -->|"implemented by"| node_py_agents
node_py_agents -->|"retrieves knowledge"| node_py_retriever
node_py_storage -->|"implemented by"| node_py_memory
node_py_storage -->|"implemented by"| node_py_dynamo

click node_ts_orch "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/orchestrator.ts"
click node_py_orch "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/orchestrator.py"
click node_ts_classifier "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/classifiers/classifier.ts"
click node_ts_classifiers "https://github.com/cuiyuheng/multi-agent-orchestrator/tree/main/typescript/src/classifiers"
click node_py_classifier "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/classifiers/classifier.py"
click node_py_classifiers "https://github.com/cuiyuheng/multi-agent-orchestrator/tree/main/python/src/multi_agent_orchestrator/classifiers"
click node_ts_agent_base "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/agents/agent.ts"
click node_ts_agents "https://github.com/cuiyuheng/multi-agent-orchestrator/tree/main/typescript/src/agents"
click node_py_agent_base "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/agents/agent.py"
click node_py_agents "https://github.com/cuiyuheng/multi-agent-orchestrator/tree/main/python/src/multi_agent_orchestrator/agents"
click node_ts_storage "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/storage/chatStorage.ts"
click node_ts_memory "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/storage/memoryChatStorage.ts"
click node_ts_dynamo "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/storage/dynamoDbChatStorage.ts"
click node_py_storage "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/storage/chat_storage.py"
click node_py_memory "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/storage/in_memory_chat_storage.py"
click node_py_dynamo "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/storage/dynamodb_chat_storage.py"
click node_ts_retriever "https://github.com/cuiyuheng/multi-agent-orchestrator/tree/main/typescript/src/retrievers"
click node_py_retriever "https://github.com/cuiyuheng/multi-agent-orchestrator/tree/main/python/src/multi_agent_orchestrator/retrievers"
click node_ts_overlap "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/agentOverlapAnalyzer.ts"
click node_ts_stream "https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/utils/helpers.ts"

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_ts_orch,node_py_orch,node_ts_stream,node_user toneBlue
class node_ts_classifier,node_ts_classifiers,node_py_classifier,node_py_classifiers,node_ts_overlap toneAmber
class node_ts_agent_base,node_ts_agents,node_py_agent_base,node_py_agents toneMint
class node_ts_storage,node_ts_memory,node_ts_dynamo,node_py_storage,node_py_memory,node_py_dynamo,node_ts_retriever,node_py_retriever toneRose
```

## Components

### Orchestration

- [TS orchestrator](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/orchestrator.ts): `typescript/src/orchestrator.ts`
- [Python orchestrator](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/orchestrator.py): `python/src/multi_agent_orchestrator/orchestrator.py`
- [Streaming helpers](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/utils/helpers.ts): `typescript/src/utils/helpers.ts`

### Intent routing

- [TS classifier base](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/classifiers/classifier.ts): `typescript/src/classifiers/classifier.ts`
- [TS classifier variants](https://github.com/cuiyuheng/multi-agent-orchestrator/tree/main/typescript/src/classifiers): `typescript/src/classifiers`
- [Python classifier base](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/classifiers/classifier.py): `python/src/multi_agent_orchestrator/classifiers/classifier.py`
- [Python classifier variants](https://github.com/cuiyuheng/multi-agent-orchestrator/tree/main/python/src/multi_agent_orchestrator/classifiers): `python/src/multi_agent_orchestrator/classifiers`
- [Agent overlap analysis](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/agentOverlapAnalyzer.ts): `typescript/src/agentOverlapAnalyzer.ts`

### Agent execution

- [TS agent contract](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/agents/agent.ts): `typescript/src/agents/agent.ts`
- [TS agent implementations](https://github.com/cuiyuheng/multi-agent-orchestrator/tree/main/typescript/src/agents): `typescript/src/agents`
- [Python agent contract](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/agents/agent.py): `python/src/multi_agent_orchestrator/agents/agent.py`
- [Python agent implementations](https://github.com/cuiyuheng/multi-agent-orchestrator/tree/main/python/src/multi_agent_orchestrator/agents): `python/src/multi_agent_orchestrator/agents`

### Context and retrieval

- [TS chat storage](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/storage/chatStorage.ts): `typescript/src/storage/chatStorage.ts`
- [TS memory storage](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/storage/memoryChatStorage.ts): `typescript/src/storage/memoryChatStorage.ts`
- [TS DynamoDB storage](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/typescript/src/storage/dynamoDbChatStorage.ts): `typescript/src/storage/dynamoDbChatStorage.ts`
- [Python chat storage](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/storage/chat_storage.py): `python/src/multi_agent_orchestrator/storage/chat_storage.py`
- [Python memory storage](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/storage/in_memory_chat_storage.py): `python/src/multi_agent_orchestrator/storage/in_memory_chat_storage.py`
- [Python DynamoDB storage](https://github.com/cuiyuheng/multi-agent-orchestrator/blob/main/python/src/multi_agent_orchestrator/storage/dynamodb_chat_storage.py): `python/src/multi_agent_orchestrator/storage/dynamodb_chat_storage.py`
- [TS knowledge retrieval](https://github.com/cuiyuheng/multi-agent-orchestrator/tree/main/typescript/src/retrievers): `typescript/src/retrievers`
- [Python knowledge retrieval](https://github.com/cuiyuheng/multi-agent-orchestrator/tree/main/python/src/multi_agent_orchestrator/retrievers): `python/src/multi_agent_orchestrator/retrievers`

### Other components

- **User**

## Connections

- User → TS orchestrator: submits request
- User → Python orchestrator: submits request
- TS orchestrator → TS chat storage: loads history (evidence: `typescript/src/orchestrator.ts`)
- TS orchestrator → TS classifier base: classifies intent (evidence: `typescript/src/orchestrator.ts`)
- TS orchestrator → TS agent implementations: dispatches request (evidence: `typescript/src/orchestrator.ts`)
- TS orchestrator → TS chat storage: saves exchange (evidence: `typescript/src/orchestrator.ts`)
- TS orchestrator → TS memory storage: defaults to (evidence: `typescript/src/orchestrator.ts`)
- TS orchestrator → Agent overlap analysis: analyzes overlap (evidence: `typescript/src/orchestrator.ts`)
- TS classifier base → TS agent contract: uses agent descriptions (evidence: `typescript/src/classifiers/classifier.ts`)
- TS classifier variants → TS classifier base: extends classifier (evidence: `typescript/src/classifiers/bedrockClassifier.ts`)
- TS agent contract → Streaming helpers: uses stream accumulator (evidence: `typescript/src/agents/agent.ts`)
- TS agent implementations → TS knowledge retrieval: retrieves knowledge (evidence: `typescript/src/agents/bedrockLLMAgent.ts`)
- TS chat storage → TS memory storage: implemented by (evidence: `typescript/src/storage/memoryChatStorage.ts`)
- TS chat storage → TS DynamoDB storage: implemented by (evidence: `typescript/src/storage/dynamoDbChatStorage.ts`)
- Python orchestrator → Python chat storage: uses storage (evidence: `python/src/multi_agent_orchestrator/orchestrator.py`)
- Python orchestrator → Python classifier base: uses classifier (evidence: `python/src/multi_agent_orchestrator/orchestrator.py`)
- Python orchestrator → Python agent implementations: dispatches request (evidence: `python/src/multi_agent_orchestrator/orchestrator.py`)
- Python classifier base → Python agent contract: uses agent descriptions (evidence: `python/src/multi_agent_orchestrator/classifiers/classifier.py`)
- Python classifier variants → Python classifier base: extends classifier (evidence: `python/src/multi_agent_orchestrator/classifiers/__init__.py`)
- Python agent contract → Python agent implementations: implemented by (evidence: `python/src/multi_agent_orchestrator/agents/__init__.py`)
- Python agent implementations → Python knowledge retrieval: retrieves knowledge (evidence: `python/src/multi_agent_orchestrator/agents/bedrock_llm_agent.py`)
- Python chat storage → Python memory storage: implemented by (evidence: `python/src/multi_agent_orchestrator/storage/in_memory_chat_storage.py`)
- Python chat storage → Python DynamoDB storage: implemented by (evidence: `python/src/multi_agent_orchestrator/storage/dynamodb_chat_storage.py`)
