# nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge architecture

> Architecture diagram of the GitHub repository nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge
- Repository: https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge

## Overview

This is a Python command-line multi-agent workflow: a user submits a task, the supervisor coordinates research, analysis, drafting, and critique, then returns an approved or bounded-unapproved answer and workflow summary. Shared state carries task data, agent outputs, counters, and the hop log; the workers use a configured local Ollama model. The README documents the review/revision loop and limits. The state module was not excerpted, so its fields and use are included only where supported by the README or shown callers; tests and setup files are omitted.

Main entry points: [`src/supervisor.py`](https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/supervisor.py) (Supervisor), [`main.py`](https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/main.py) (CLI entry), [`src/agents.py`](https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/agents.py) (Researcher), [`src/state.py`](https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/state.py) (Shared workflow state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interface"]
  node_cli["CLI entry<br/>[main.py]"]
end

subgraph group_control["Workflow control"]
  node_supervisor["Supervisor<br/>[supervisor.py]"]
  node_audit["Hop audit log<br/>[supervisor.py]"]
end

subgraph group_workers["Specialist agents"]
  node_researcher["Researcher<br/>[agents.py]"]
  node_analyst["Analyst<br/>[agents.py]"]
  node_writer["Writer<br/>[agents.py]"]
  node_critic["Critic<br/>[agents.py]"]
end

subgraph group_context["State and model"]
  node_state["Shared workflow state<br/>[state.py]"]
end

node_user(("Task submitter"))
node_ollama["Local Ollama model"]

node_user -->|"enters task"| node_cli
node_cli -->|"initializes"| node_state
node_cli -->|"runs workflow"| node_supervisor
node_supervisor -->|"updates and reads"| node_state
node_supervisor -->|"dispatches"| node_researcher
node_supervisor -->|"dispatches"| node_analyst
node_supervisor -->|"dispatches"| node_writer
node_supervisor -->|"dispatches"| node_critic
node_supervisor -->|"records events"| node_audit
node_researcher -->|"requests completion"| node_ollama
node_analyst -->|"requests completion"| node_ollama
node_writer -->|"requests completion"| node_ollama
node_critic -->|"requests completion"| node_ollama
node_supervisor -->|"returns result"| node_cli
node_cli -->|"displays answer"| node_user

click node_cli "https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/main.py"
click node_supervisor "https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/supervisor.py"
click node_audit "https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/supervisor.py"
click node_state "https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/state.py"
click node_researcher "https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/agents.py"
click node_analyst "https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/agents.py"
click node_writer "https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/agents.py"
click node_critic "https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/agents.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_cli toneBlue
class node_supervisor,node_audit toneAmber
class node_researcher,node_analyst,node_writer,node_critic toneMint
class node_state,node_user toneRose
class node_ollama toneIndigo
```

## Components

### User interface

- [CLI entry](https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/main.py): `main.py`

### Workflow control

- [Supervisor](https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/supervisor.py): `src/supervisor.py`
- [Hop audit log](https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/supervisor.py): `src/supervisor.py`

### Specialist agents

- [Researcher](https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/agents.py): `src/agents.py`
- [Analyst](https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/agents.py): `src/agents.py`
- [Writer](https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/agents.py): `src/agents.py`
- [Critic](https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/agents.py): `src/agents.py`

### State and model

- [Shared workflow state](https://github.com/nattar-kani/multiagent-system-with-supervisor-day46-10weekschallenge/blob/main/src/state.py): `src/state.py`

### Other components

- **Task submitter**
- **Local Ollama model**

## Connections

- Task submitter → CLI entry: enters task (evidence: `main.py`)
- CLI entry → Shared workflow state: initializes (evidence: `main.py`)
- CLI entry → Supervisor: runs workflow (evidence: `main.py`)
- Supervisor → Shared workflow state: updates and reads (evidence: `src/supervisor.py`)
- Supervisor → Researcher: dispatches (evidence: `src/supervisor.py`)
- Supervisor → Analyst: dispatches (evidence: `src/supervisor.py`)
- Supervisor → Writer: dispatches (evidence: `src/supervisor.py`)
- Supervisor → Critic: dispatches (evidence: `src/supervisor.py`)
- Supervisor → Hop audit log: records events (evidence: `src/supervisor.py`)
- Researcher → Local Ollama model: requests completion (evidence: `src/agents.py`)
- Analyst → Local Ollama model: requests completion (evidence: `src/agents.py`)
- Writer → Local Ollama model: requests completion (evidence: `src/agents.py`)
- Critic → Local Ollama model: requests completion (evidence: `src/agents.py`)
- Supervisor → CLI entry: returns result (evidence: `main.py`)
- CLI entry → Task submitter: displays answer (evidence: `main.py`)
