# hemanthreddykunduru/multi-agent-orchestration-system architecture

> Architecture diagram of the GitHub repository hemanthreddykunduru/multi-agent-orchestration-system, 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/hemanthreddykunduru/multi-agent-orchestration-system
- Repository: https://github.com/hemanthreddykunduru/multi-agent-orchestration-system

## Overview

The implemented product is an interactive command-line assistant that selects one Ollama model per query, returns its response, and records the exchange. The README describes collaboration and aggregation, but the sampled runtime instead routes each query to a single model; those unsupported capabilities are not shown as implemented. The standalone agent scripts provide separate model-specific entry points. The diagram reflects the sampled MAS.py flow and documented model specializations.

Main entry points: [`MAS.py`](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/MAS.py) (Interactive CLI), [`individuals/chat.py`](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/individuals/chat.py) (Mistral), [`individuals/code.py`](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/individuals/code.py) (Qwen Coder), [`individuals/img.py`](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/individuals/img.py) (LLaMA Vision)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Interaction"]
  node_cli["Interactive CLI<br/>[MAS.py]"]
  node_response["Printed Response<br/>[MAS.py]"]
end

subgraph group_routing["Routing and Inference"]
  node_router["Task Router<br/>[MAS.py]"]
  node_inference["Ollama Invocation<br/>[MAS.py]"]
end

subgraph group_agents["Model Agents"]
  node_mistral["Mistral<br/>[chat.py]"]
  node_qwen["Qwen Coder<br/>[code.py]"]
  node_vision["LLaMA Vision<br/>[img.py]"]
  node_mathstral["Mathstral<br/>[mat.py]"]
end

subgraph group_state["Session and History"]
  node_context["Recent Context<br/>[MAS.py]"]
  node_history[("Chat History<br/>[history.db]")]
end

node_user(("User"))
node_ollama["Ollama Runtime"]

node_user -->|"enters query"| node_cli
node_cli -->|"classifies task"| node_router
node_cli -->|"invokes model"| node_inference
node_inference -->|"reads recent turns"| node_context
node_inference -->|"runs selected model"| node_ollama
node_ollama -->|"returns response"| node_inference
node_cli -->|"saves exchange"| node_history
node_cli -->|"prints response"| node_response
node_response -->|"shows result"| node_user
node_ollama -.->|"runs general tasks"| node_mistral
node_ollama -.->|"runs code tasks"| node_qwen
node_ollama -.->|"runs image tasks"| node_vision
node_ollama -.->|"runs math tasks"| node_mathstral

click node_cli "https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/MAS.py"
click node_response "https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/MAS.py"
click node_router "https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/MAS.py"
click node_inference "https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/MAS.py"
click node_mistral "https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/individuals/chat.py"
click node_qwen "https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/individuals/code.py"
click node_vision "https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/individuals/img.py"
click node_mathstral "https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/individuals/mat.py"
click node_context "https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/MAS.py"
click node_history "https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/history.db"

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_response,node_user toneBlue
class node_router,node_inference toneAmber
class node_mistral,node_qwen,node_vision,node_mathstral toneMint
class node_context,node_history toneRose
class node_ollama toneIndigo
```

## Components

### Interaction

- [Interactive CLI](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/MAS.py): `MAS.py`
- [Printed Response](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/MAS.py): `MAS.py`

### Routing and Inference

- [Task Router](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/MAS.py): `MAS.py`
- [Ollama Invocation](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/MAS.py): `MAS.py`

### Model Agents

- [Mistral](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/individuals/chat.py): `individuals/chat.py`
- [Qwen Coder](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/individuals/code.py): `individuals/code.py`
- [LLaMA Vision](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/individuals/img.py): `individuals/img.py`
- [Mathstral](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/individuals/mat.py): `individuals/mat.py`

### Session and History

- [Recent Context](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/MAS.py): `MAS.py`
- [Chat History](https://github.com/hemanthreddykunduru/multi-agent-orchestration-system/blob/main/history.db): `history.db`

### Other components

- **User**
- **Ollama Runtime**

## Connections

- User → Interactive CLI: enters query
- Interactive CLI → Task Router: classifies task
- Interactive CLI → Ollama Invocation: invokes model
- Ollama Invocation → Recent Context: reads recent turns
- Ollama Invocation → Ollama Runtime: runs selected model
- Ollama Runtime → Ollama Invocation: returns response
- Interactive CLI → Chat History: saves exchange
- Interactive CLI → Printed Response: prints response
- Printed Response → User: shows result
- Ollama Runtime → Mistral: runs general tasks
- Ollama Runtime → Qwen Coder: runs code tasks
- Ollama Runtime → LLaMA Vision: runs image tasks
- Ollama Runtime → Mathstral: runs math tasks
