# souzalrns/network-agents-setup architecture

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

- Interactive diagram: https://gitdiagram.com/souzalrns/network-agents-setup
- Repository: https://github.com/souzalrns/network-agents-setup

## Overview

This repository’s live product is a Python runtime for governed, declarative multi-agent workflows; the TypeScript applications and packages are archived. A request is routed to an area and agent, represented as a validated plan, then executed sequentially or in parallel waves. Steps load agent skills and run through a worker, with human approval and budget controls able to pause execution. Runs produce resumable status, events, and artifacts; optional persistent memory, retrieval knowledge, and council deliberation extend the workflow. Edges reflect README statements and indexed source references; some runtime details are unsampled.

Main entry points: [`runner/plan_runner/engine.py`](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/engine.py) (Sequential engine), [`runner/plan_runner/langgraph_engine.py`](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/langgraph_engine.py) (Parallel engine), [`runner/plan_runner/executor.py`](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/executor.py) (Step executor), [`runner/plan_runner/models.py`](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/models.py) (Plan model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Planning and routing"]
  node_router["Request router<br/>[router.py]"]
  node_plan["Plan model<br/>[models.py]"]
  node_plan_validation["Plan validation<br/>[plan_schema.py]"]
end

subgraph group_execution["Plan execution"]
  node_native_engine["Sequential engine<br/>[engine.py]"]
  node_parallel_engine["Parallel engine"]
  node_step_executor["Step executor<br/>[executor.py]"]
  node_worker["External worker<br/>[external_worker.py]"]
  node_skill_loader["Skill loading<br/>[skills.py]"]
end

subgraph group_governance["Controls and knowledge"]
  node_human_gate["Approval gates<br/>[hitl.py]"]
  node_budget["Token and cost limits<br/>[cost.py]"]
  node_completion["Completion checks<br/>[done_when.py]"]
  node_l4_memory[("Persistent memory<br/>[memory_l4.py]")]
  node_l5_knowledge["Knowledge retrieval"]
  node_council["Council deliberation<br/>[council_session.py]"]
end

subgraph group_records["Run records"]
  node_event_log["Append-only events<br/>[events.py]"]
  node_run_outputs["Status and artifacts<br/>[engine.py]"]
end

node_request(("User request"))
node_human(("Human reviewer"))

node_request -->|"routes request"| node_router
node_router -->|"maps to plan"| node_plan
node_plan -->|"validates schema"| node_plan_validation
node_plan -->|"runs sequentially"| node_native_engine
node_plan -->|"runs in waves"| node_parallel_engine
node_native_engine -->|"executes steps"| node_step_executor
node_parallel_engine -->|"runs step nodes"| node_step_executor
node_step_executor -->|"delegates work"| node_worker
node_step_executor -->|"loads skill"| node_skill_loader
node_step_executor -->|"checks approval"| node_human_gate
node_human -->|"approves or edits"| node_human_gate
node_worker -->|"checks ceilings"| node_budget
node_native_engine -->|"checks criteria"| node_completion
node_parallel_engine -->|"checks criteria"| node_completion
node_native_engine -->|"appends events"| node_event_log
node_parallel_engine -->|"appends events"| node_event_log
node_native_engine -->|"writes run state"| node_run_outputs
node_parallel_engine -->|"writes run state"| node_run_outputs
node_native_engine -.->|"wires memory"| node_l4_memory
node_native_engine -->|"wires retrieval"| node_l5_knowledge
node_request -.->|"requests deliberation"| node_council

click node_router "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/router.py"
click node_plan "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/models.py"
click node_plan_validation "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/plan_schema.py"
click node_native_engine "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/engine.py"
click node_parallel_engine "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/langgraph_engine.py"
click node_step_executor "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/executor.py"
click node_worker "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/external_worker.py"
click node_skill_loader "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/skills.py"
click node_human_gate "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/hitl.py"
click node_budget "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/cost.py"
click node_completion "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/done_when.py"
click node_l4_memory "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/memory_l4.py"
click node_l5_knowledge "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/knowledge_wiring.py"
click node_council "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/council_session.py"
click node_event_log "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/events.py"
click node_run_outputs "https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/engine.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_router,node_plan,node_plan_validation,node_request,node_human toneBlue
class node_native_engine,node_parallel_engine,node_step_executor,node_worker,node_skill_loader toneAmber
class node_human_gate,node_budget,node_completion,node_l4_memory,node_l5_knowledge,node_council toneMint
class node_event_log,node_run_outputs toneRose
```

## Components

### Planning and routing

- [Request router](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/router.py): `runner/plan_runner/router.py`
- [Plan model](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/models.py): `runner/plan_runner/models.py`
- [Plan validation](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/plan_schema.py): `runner/plan_runner/plan_schema.py`

### Plan execution

- [Sequential engine](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/engine.py): `runner/plan_runner/engine.py`
- [Parallel engine](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/langgraph_engine.py): `runner/plan_runner/langgraph_engine.py`
- [Step executor](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/executor.py): `runner/plan_runner/executor.py`
- [External worker](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/external_worker.py): `runner/plan_runner/external_worker.py`
- [Skill loading](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/skills.py): `runner/plan_runner/skills.py`

### Controls and knowledge

- [Approval gates](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/hitl.py): `runner/plan_runner/hitl.py`
- [Token and cost limits](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/cost.py): `runner/plan_runner/cost.py`
- [Completion checks](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/done_when.py): `runner/plan_runner/done_when.py`
- [Persistent memory](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/memory_l4.py): `runner/plan_runner/memory_l4.py`
- [Knowledge retrieval](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/knowledge_wiring.py): `runner/plan_runner/knowledge_wiring.py`
- [Council deliberation](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/council_session.py): `runner/plan_runner/council_session.py`

### Run records

- [Append-only events](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/events.py): `runner/plan_runner/events.py`
- [Status and artifacts](https://github.com/souzalrns/network-agents-setup/blob/main/runner/plan_runner/engine.py): `runner/plan_runner/engine.py`

### Other components

- **User request**
- **Human reviewer**

## Connections

- User request → Request router: routes request
- Request router → Plan model: maps to plan
- Plan model → Plan validation: validates schema
- Plan model → Sequential engine: runs sequentially (evidence: `runner/plan_runner/engine.py`)
- Plan model → Parallel engine: runs in waves (evidence: `runner/plan_runner/langgraph_engine.py`)
- Sequential engine → Step executor: executes steps (evidence: `runner/plan_runner/engine.py`)
- Parallel engine → Step executor: runs step nodes (evidence: `runner/plan_runner/langgraph_engine.py`)
- Step executor → External worker: delegates work (evidence: `runner/plan_runner/executor.py`)
- Step executor → Skill loading: loads skill (evidence: `runner/plan_runner/executor.py`)
- Step executor → Approval gates: checks approval
- Human reviewer → Approval gates: approves or edits
- External worker → Token and cost limits: checks ceilings (evidence: `runner/plan_runner/external_worker.py`)
- Sequential engine → Completion checks: checks criteria (evidence: `runner/plan_runner/engine.py`)
- Parallel engine → Completion checks: checks criteria (evidence: `runner/plan_runner/langgraph_engine.py`)
- Sequential engine → Append-only events: appends events (evidence: `runner/plan_runner/engine.py`)
- Parallel engine → Append-only events: appends events (evidence: `runner/plan_runner/langgraph_engine.py`)
- Sequential engine → Status and artifacts: writes run state (evidence: `runner/plan_runner/engine.py`)
- Parallel engine → Status and artifacts: writes run state (evidence: `runner/plan_runner/langgraph_engine.py`)
- Sequential engine → Persistent memory: wires memory (evidence: `runner/plan_runner/engine.py`)
- Sequential engine → Knowledge retrieval: wires retrieval (evidence: `runner/plan_runner/engine.py`)
- User request → Council deliberation: requests deliberation
