# tonbistudio/hermes-multi-agent-workflow architecture

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

- Interactive diagram: https://gitdiagram.com/tonbistudio/hermes-multi-agent-workflow
- Repository: https://github.com/tonbistudio/hermes-multi-agent-workflow

## Overview

1. **What this repository is**
   - A Python template for a **multi-agent triage workflow** on Hermes.
   - It is not the domain app itself; it is the **generic engine + config + templates** that you adapt to your own workflow.

2. **Core architectural shape**
   - The pipeline is fixed: **sources → intake → dedup → score → research in parallel → route → human approval gate → fulfill → deliver**.
   - The repo’s main design principle is **“fat engine, thin skills”**: deterministic orchestration lives in `engine/`, while domain specifics live in `triage.yaml`, `paths/`, and `skills/templates/`.

3. **Primary control plane: `triage.yaml`**
   - `triage.yaml` is the central configuration boundary for the whole system.
   - It defines sources, scoring rubric, research lanes, routing rules, fulfillment paths, roles, and other domain-specific behavior.
   - The engine is intentionally generic and reads its behavior from this file rather than hardcoding workflow details.

4. **Orchestration engine**
   - `engine/engine.py` is the deterministic workflow coordinator.
   - Supporting modules split the orchestration concerns:
     - `engine/intake_parser.py` parses scout reports into tracked items.
     - `engine/dedup.py` handles similarity-based deduplication.
     - `engine/scoring.py` applies rubric scoring, with both LLM-assisted and deterministic modes.
     - `engine/routing.py` classifies items to the correct fulfillment path.
     - `engine/item_vault.py` stores item state as individual markdown files.
     - `engine/kanban_store.py` writes the Hermes Kanban board state.
     - `engine/frontmatter.py` handles YAML frontmatter in markdown item files.

5. **Data persistence model**
   - Items are persisted in a **markdown-based item vault**, not a database.
   - The Kanban board acts as the **system bus / coordination surface** for the workflow.
   - This means state is split between:
     - per-item markdown records,
     - board columns/cards,
     - and config/templates that define how items move.

6. **Human-in-the-loop boundary**
   - `proposal_actions.py` is the boundary at the **approval gate**.
   - The pipeline pauses for a human to **approve, shelve, or modify** proposals before fulfillment proceeds.
   - This is a major architectural control point: downstream actions are gated, so the workflow is autonomous but not fully unsupervised.

7. **Domain adaptation layers**
   - `paths/` contains the fulfillment-path templates:
     - `rails/` for scope/guardrails,
     - `specs/` for deliverable definitions,
     - `proposals/` for proposal formats.
   - `skills/templates/` contains Hermes `SKILL.md` templates for the scout and orchestrator roles.
   - These files are meant to be customized per domain; they are the “last mile” between generic engine and real-world use.

8. **Command-line boundary**
   - `cli/triage.py` provides operational commands like validation, scaffolding, initialization, and install planning.
   - This is the user-facing entry point for checking that a config is sound and for generating the setup plan.
   - The CLI keeps operational tasks separate from the engine’s core orchestration logic.

9. **Cost and operational reporting**
   - `scripts/cost_report.py` exists as an operational support tool for tracking **per-item spend**, likely tied to the cost gate mentioned in the README.
   - This is part of the workflow’s control surface, not the main business logic.

10. **Reference implementation and examples**
   - `examples/ai-agent-pain-points/` is a worked example showing how the template is instantiated for a concrete domain.
   - It demonstrates the intended usage pattern: clone the structure, then repoint the config/templates to your own problem space.

11. **Testing and validation**
   - `tests/test_engine_core.py` focuses on generic engine behavior.
   - The repository’s tests are designed to validate the reusable orchestration layer, not any one domain.
   - This reinforces the repo boundary: core mechanics should remain stable even as config and templates change.

12. **Technology and runtime constraints**
   - The project is a **Python** package with a very small dependency surface; `requirements.txt` indicates `PyYAML` is the key external dependency.
   - The architecture is file- and config-driven rather than service-driven: markdown, YAML, and board state are the primary integration formats.
   - The docs emphasize Hermes board integration, profile/auth setup, and safe publishing, which are operational dependencies rather than code dependencies.

13. **Security and trust model**
   - The repo assumes a workflow that may run **LLM-authored code and shell commands**, but only behind a human gate.
   - Security boundaries are called out explicitly in `SECURITY.md` and `docs/06-security.md`, implying that publishing and execution are treated as part of the architecture, not an afterthought.

14. **How to read the system as a diagram**
   - Draw `triage.yaml` and the templates as the **configuration layer**.
   - Draw `engine/` as the **orchestration layer**.
   - Draw the Hermes Kanban board and item vault as the **state layer**.
   - Draw `proposal_actions.py` as the **human approval boundary**.
   - Draw `paths/` and `skills/templates/` as the **domain customization layer** feeding the same generic engine.

Main entry points: [`engine/engine.py`](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/engine.py) (Engine), [`triage.yaml`](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/triage.yaml) (triage.yaml), [`proposal_actions.py`](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/proposal_actions.py) (Approval gate), [`engine/intake_parser.py`](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/intake_parser.py) (Intake parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_config["Config & templates"]
  node_triage_yaml["triage.yaml<br/>workflow config<br/>[triage.yaml]"]
  node_path_rails["Rails"]
  node_path_specs["Specs<br/>deliverable templates"]
  node_path_proposals["Proposals<br/>proposal templates"]
  node_skill_scout["Scout skill<br/>agent skill template<br/>[SKILL.md]"]
  node_skill_orch["Orchestrator skill<br/>agent skill template<br/>[SKILL.md]"]
end

subgraph group_engine["Core engine"]
  node_engine_main["Engine<br/>workflow coordinator<br/>[engine.py]"]
  node_engine_config["Config loader<br/>config adapter<br/>[config.py]"]
  node_engine_intake["Intake parser<br/>report parser<br/>[intake_parser.py]"]
  node_engine_dedup["Dedup<br/>similarity filter<br/>[dedup.py]"]
  node_engine_scoring["Scoring<br/>rubric scorer<br/>[scoring.py]"]
  node_engine_routing["Routing<br/>path classifier<br/>[routing.py]"]
  node_proposal_actions{{"Approval gate<br/>human gate"}}
end

subgraph group_state["State layer"]
  node_item_vault[("Item vault<br/>markdown store<br/>[item_vault.py]")]
  node_kanban_store[("Kanban store<br/>board state<br/>[kanban_store.py]")]
  node_frontmatter["Frontmatter<br/>md metadata<br/>[frontmatter.py]"]
end

subgraph group_ops["Ops & CLI"]
  node_triage_cli["Triage CLI<br/>operations cli<br/>[triage.py]"]
  node_cost_report["Cost report<br/>ops report<br/>[cost_report.py]"]
end

subgraph group_examples["Example instantiation"]
  node_example_domain["Example domain<br/>reference instantiation"]
end

subgraph group_verification["Validation"]
  node_engine_tests["Engine tests<br/>core tests"]
end

node_triage_yaml -->|"drives"| node_engine_config
node_triage_yaml -->|"controls"| node_engine_main
node_skill_scout -->|"feeds"| node_engine_intake
node_engine_main -->|"orchestrates"| node_engine_intake
node_engine_intake -->|"passes"| node_engine_dedup
node_engine_dedup -->|"passes"| node_engine_scoring
node_engine_scoring -->|"passes"| node_engine_routing
node_engine_routing -->|"gates"| node_proposal_actions
node_proposal_actions -->|"uses"| node_path_proposals
node_proposal_actions -->|"authorizes"| node_path_specs
node_path_rails -->|"constrains"| node_proposal_actions
node_engine_main -->|"persists"| node_item_vault
node_engine_main -->|"updates"| node_kanban_store
node_item_vault -->|"uses"| node_frontmatter
node_triage_cli -->|"validates"| node_triage_yaml
node_triage_cli -->|"invokes"| node_engine_main
node_cost_report -->|"reads"| node_item_vault
node_example_domain -->|"instantiates"| node_triage_yaml
node_example_domain -->|"demonstrates"| node_skill_scout
node_engine_tests -->|"covers"| node_engine_main

click node_triage_yaml "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/triage.yaml"
click node_path_rails "https://github.com/tonbistudio/hermes-multi-agent-workflow/tree/main/paths/rails"
click node_path_specs "https://github.com/tonbistudio/hermes-multi-agent-workflow/tree/main/paths/specs"
click node_path_proposals "https://github.com/tonbistudio/hermes-multi-agent-workflow/tree/main/paths/proposals"
click node_skill_scout "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/skills/templates/triage-scout/SKILL.md"
click node_skill_orch "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/skills/templates/triage-orchestrator/SKILL.md"
click node_engine_main "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/engine.py"
click node_engine_config "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/config.py"
click node_engine_intake "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/intake_parser.py"
click node_engine_dedup "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/dedup.py"
click node_engine_scoring "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/scoring.py"
click node_engine_routing "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/routing.py"
click node_proposal_actions "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/proposal_actions.py"
click node_item_vault "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/item_vault.py"
click node_kanban_store "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/kanban_store.py"
click node_frontmatter "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/frontmatter.py"
click node_triage_cli "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/cli/triage.py"
click node_cost_report "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/scripts/cost_report.py"
click node_example_domain "https://github.com/tonbistudio/hermes-multi-agent-workflow/tree/main/examples/ai-agent-pain-points"
click node_engine_tests "https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/tests/test_engine_core.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_triage_yaml,node_path_rails,node_path_specs,node_path_proposals,node_skill_scout,node_skill_orch toneBlue
class node_engine_main,node_engine_config,node_engine_intake,node_engine_dedup,node_engine_scoring,node_engine_routing,node_proposal_actions toneAmber
class node_item_vault,node_kanban_store,node_frontmatter toneMint
class node_triage_cli,node_cost_report toneRose
class node_example_domain toneIndigo
class node_engine_tests toneTeal
```

## Components

### Config & templates

Workflow-specific behavior and last-mile customization

- [triage.yaml](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/triage.yaml): workflow config · Central control plane for sources, scoring, routing, roles, and path behavior · `triage.yaml`
- [Rails](https://github.com/tonbistudio/hermes-multi-agent-workflow/tree/main/paths/rails): guardrails templates · Scope and safety constraints for fulfillment paths · `paths/rails`
- [Specs](https://github.com/tonbistudio/hermes-multi-agent-workflow/tree/main/paths/specs): deliverable templates · Definitions for what each path must produce · `paths/specs`
- [Proposals](https://github.com/tonbistudio/hermes-multi-agent-workflow/tree/main/paths/proposals): proposal templates · Formats for human-reviewable proposals before fulfillment · `paths/proposals`
- [Scout skill](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/skills/templates/triage-scout/SKILL.md): agent skill template · Hermes SKILL template for intake and research work · `skills/templates/triage-scout/SKILL.md`
- [Orchestrator skill](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/skills/templates/triage-orchestrator/SKILL.md): agent skill template · Hermes SKILL template for coordination and routing work · `skills/templates/triage-orchestrator/SKILL.md`

### Core engine

Deterministic orchestration and workflow mechanics

- [Engine](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/engine.py): workflow coordinator · Deterministic coordinator for the triage pipeline · `engine/engine.py`
- [Config loader](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/config.py): config adapter · Reads and normalizes triage configuration for the engine · `engine/config.py`
- [Intake parser](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/intake_parser.py): report parser · Turns scout reports into tracked items · `engine/intake_parser.py`
- [Dedup](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/dedup.py): similarity filter · Removes or merges duplicate items · `engine/dedup.py`
- [Scoring](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/scoring.py): rubric scorer · Applies deterministic or LLM-assisted rubric scoring · `engine/scoring.py`
- [Routing](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/routing.py): path classifier · Assigns items to fulfillment paths · `engine/routing.py`
- [Approval gate](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/proposal_actions.py): human gate · Boundary for approve, shelve, or modify before fulfillment · `proposal_actions.py`

### State layer

File-based item storage and board coordination

- [Item vault](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/item_vault.py): markdown store · Persists per-item state as markdown records · `engine/item_vault.py`
- [Kanban store](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/kanban_store.py): board state · Writes Hermes board columns and cards · `engine/kanban_store.py`
- [Frontmatter](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/engine/frontmatter.py): md metadata · Reads and writes YAML frontmatter in item files · `engine/frontmatter.py`

### Ops & CLI

User-facing commands and operational reporting

- [Triage CLI](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/cli/triage.py): operations cli · Validation, scaffolding, initialization, and install planning commands · `cli/triage.py`
- [Cost report](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/scripts/cost_report.py): ops report · Tracks per-item spend and operational cost control · `scripts/cost_report.py`

### Example instantiation

Concrete reference implementation for one domain

- [Example domain](https://github.com/tonbistudio/hermes-multi-agent-workflow/tree/main/examples/ai-agent-pain-points): reference instantiation · Worked example showing how to adapt the template to a concrete use case · `examples/ai-agent-pain-points`

### Validation

Tests that protect the reusable orchestration layer

- [Engine tests](https://github.com/tonbistudio/hermes-multi-agent-workflow/blob/main/tests/test_engine_core.py): core tests · Validates reusable engine behavior across configurations · `tests/test_engine_core.py`

## Connections

- triage.yaml → Config loader: drives · Configuration defines engine behavior
- triage.yaml → Engine: controls · Engine executes the workflow described by config
- Scout skill → Intake parser: feeds · Scout output becomes intake material
- Engine → Intake parser: orchestrates · Pipeline begins with intake parsing
- Intake parser → Dedup: passes · Parsed items are deduplicated
- Dedup → Scoring: passes · Unique items are scored
- Scoring → Routing: passes · Scored items are routed to a path
- Routing → Approval gate: gates · Routing can trigger human review before fulfillment
- Approval gate → Proposals: uses · Proposal format supports the approval step
- Approval gate → Specs: authorizes · Approved work proceeds into path-specific deliverables
- Rails → Approval gate: constrains · Guardrails shape what can be approved
- Engine → Item vault: persists · Workflow state is stored per item in markdown
- Engine → Kanban store: updates · Board state is the coordination surface
- Item vault → Frontmatter: uses · Item files rely on frontmatter metadata
- Triage CLI → triage.yaml: validates · CLI checks config soundness and setup
- Triage CLI → Engine: invokes · Operational commands drive the engine
- Cost report → Item vault: reads · Cost reporting follows item-level workflow records
- Example domain → triage.yaml: instantiates · Example shows how the template is adapted
- Example domain → Scout skill: demonstrates · Example includes customized skill templates
- Engine tests → Engine: covers · Tests protect core orchestration behavior
