# skaslam1407/multi-agent-system architecture

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

- Interactive diagram: https://gitdiagram.com/skaslam1407/multi-agent-system
- Repository: https://github.com/skaslam1407/multi-agent-system

## Overview

This is a manager-led multi-agent system that accepts a task, optionally researches it, generates Python code, and reviews it; review feedback can trigger another coding pass until approval or the revision limit. The CLI presents the resulting research, code, and review. Supporting layers provide shared workflow state, task validation, permission demonstration, and a retrying LLM client configured for an OpenAI-compatible endpoint. The graph follows README-documented behavior and shown imports/calls; unsampled manager and CLI details are not inferred beyond those references.

Main entry points: [`llm.py`](https://github.com/skaslam1407/multi-agent-system/blob/main/llm.py) (LLM client), [`agent/manager.py`](https://github.com/skaslam1407/multi-agent-system/blob/main/agent/manager.py) (Workflow manager), [`main.py`](https://github.com/skaslam1407/multi-agent-system/blob/main/main.py) (CLI and results), [`workers/research_agent.py`](https://github.com/skaslam1407/multi-agent-system/blob/main/workers/research_agent.py) (Research agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_main["CLI and results<br/>[main.py]"]
  node_validation["Task validation<br/>[validation.py]"]
  node_permissions["Tool permissions<br/>[permissions.py]"]
end

subgraph group_workflow["Workflow orchestration"]
  node_manager["Workflow manager<br/>[manager.py]"]
  node_state["Shared workflow state<br/>[state.py]"]
end

subgraph group_agents["Task agents"]
  node_research["Research agent<br/>[research_agent.py]"]
  node_coding["Coding agent<br/>[coding_agent.py]"]
  node_reviewer["Review agent<br/>[reviewer_agent.py]"]
end

subgraph group_runtime["LLM runtime"]
  node_llm["LLM client<br/>[llm.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_animation["Thinking indicator<br/>[animation.py]"]
  node_logger["Agent logging<br/>[logger.py]"]
end

node_user(("Task submitter"))
node_endpoint{{"OpenAI-compatible LLM"}}

node_user -->|"submits task"| node_main
node_main -->|"runs workflow"| node_manager
node_main -->|"demonstrates permissions"| node_permissions
node_manager -->|"validates task"| node_validation
node_manager -->|"creates state"| node_state
node_manager -->|"calls research"| node_research
node_manager -->|"calls coding"| node_coding
node_manager -->|"calls review"| node_reviewer
node_research -->|"requests completion"| node_llm
node_coding -->|"requests completion"| node_llm
node_reviewer -->|"requests completion"| node_llm
node_llm -->|"reads settings"| node_config
node_llm -->|"logs requests"| node_logger
node_llm -->|"shows progress"| node_animation
node_llm -->|"sends completions"| node_endpoint

click node_main "https://github.com/skaslam1407/multi-agent-system/blob/main/main.py"
click node_validation "https://github.com/skaslam1407/multi-agent-system/blob/main/validation.py"
click node_permissions "https://github.com/skaslam1407/multi-agent-system/blob/main/permissions.py"
click node_manager "https://github.com/skaslam1407/multi-agent-system/blob/main/agent/manager.py"
click node_state "https://github.com/skaslam1407/multi-agent-system/blob/main/agent/state.py"
click node_research "https://github.com/skaslam1407/multi-agent-system/blob/main/workers/research_agent.py"
click node_coding "https://github.com/skaslam1407/multi-agent-system/blob/main/workers/coding_agent.py"
click node_reviewer "https://github.com/skaslam1407/multi-agent-system/blob/main/workers/reviewer_agent.py"
click node_llm "https://github.com/skaslam1407/multi-agent-system/blob/main/llm.py"
click node_config "https://github.com/skaslam1407/multi-agent-system/blob/main/config.py"
click node_animation "https://github.com/skaslam1407/multi-agent-system/blob/main/animation.py"
click node_logger "https://github.com/skaslam1407/multi-agent-system/blob/main/logger.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_main,node_validation,node_permissions toneBlue
class node_manager,node_state toneAmber
class node_research,node_coding,node_reviewer toneMint
class node_llm,node_config,node_animation,node_logger,node_user toneRose
class node_endpoint toneIndigo
```

## Components

### CLI entry

- [CLI and results](https://github.com/skaslam1407/multi-agent-system/blob/main/main.py): `main.py`
- [Task validation](https://github.com/skaslam1407/multi-agent-system/blob/main/validation.py): `validation.py`
- [Tool permissions](https://github.com/skaslam1407/multi-agent-system/blob/main/permissions.py): `permissions.py`

### Workflow orchestration

- [Workflow manager](https://github.com/skaslam1407/multi-agent-system/blob/main/agent/manager.py): `agent/manager.py`
- [Shared workflow state](https://github.com/skaslam1407/multi-agent-system/blob/main/agent/state.py): `agent/state.py`

### Task agents

- [Research agent](https://github.com/skaslam1407/multi-agent-system/blob/main/workers/research_agent.py): `workers/research_agent.py`
- [Coding agent](https://github.com/skaslam1407/multi-agent-system/blob/main/workers/coding_agent.py): `workers/coding_agent.py`
- [Review agent](https://github.com/skaslam1407/multi-agent-system/blob/main/workers/reviewer_agent.py): `workers/reviewer_agent.py`

### LLM runtime

- [LLM client](https://github.com/skaslam1407/multi-agent-system/blob/main/llm.py): `llm.py`
- [Runtime configuration](https://github.com/skaslam1407/multi-agent-system/blob/main/config.py): `config.py`
- [Thinking indicator](https://github.com/skaslam1407/multi-agent-system/blob/main/animation.py): `animation.py`
- [Agent logging](https://github.com/skaslam1407/multi-agent-system/blob/main/logger.py): `logger.py`

### Other components

- **Task submitter**
- **OpenAI-compatible LLM**

## Connections

- Task submitter → CLI and results: submits task (evidence: `README.md`)
- CLI and results → Workflow manager: runs workflow (evidence: `main.py`)
- CLI and results → Tool permissions: demonstrates permissions (evidence: `main.py`)
- Workflow manager → Task validation: validates task (evidence: `agent/manager.py`)
- Workflow manager → Shared workflow state: creates state (evidence: `agent/manager.py`)
- Workflow manager → Research agent: calls research (evidence: `agent/manager.py`)
- Workflow manager → Coding agent: calls coding (evidence: `agent/manager.py`)
- Workflow manager → Review agent: calls review (evidence: `agent/manager.py`)
- Research agent → LLM client: requests completion (evidence: `workers/research_agent.py`)
- Coding agent → LLM client: requests completion (evidence: `workers/coding_agent.py`)
- Review agent → LLM client: requests completion (evidence: `workers/reviewer_agent.py`)
- LLM client → Runtime configuration: reads settings (evidence: `llm.py`)
- LLM client → Agent logging: logs requests (evidence: `llm.py`)
- LLM client → Thinking indicator: shows progress (evidence: `llm.py`)
- LLM client → OpenAI-compatible LLM: sends completions (evidence: `llm.py`)
