How tonbistudio/hermes-multi-agent-workflow works
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.py Engine · triage.yaml triage.yaml · proposal_actions.py Approval gate · intake_parser.py Intake parser
Components 20
Config & templates
Workflow-specific behavior and last-mile customization
- triage.yaml · Central control plane for sources, scoring, routing, roles, and path behavior
triage.yaml - Rails · Scope and safety constraints for fulfillment paths
paths/rails - Specs · Definitions for what each path must produce
paths/specs - Proposals · Formats for human-reviewable proposals before fulfillment
paths/proposals - Scout skill · Hermes SKILL template for intake and research work
skills/templates/triage-scout/SKILL.md - Orchestrator skill · Hermes SKILL template for coordination and routing work
skills/templates/triage-orchestrator/SKILL.md
Core engine
Deterministic orchestration and workflow mechanics
- Engine · Deterministic coordinator for the triage pipeline
engine/engine.py - Config loader · Reads and normalizes triage configuration for the engine
engine/config.py - Intake parser · Turns scout reports into tracked items
engine/intake_parser.py - Dedup · Removes or merges duplicate items
engine/dedup.py - Scoring · Applies deterministic or LLM-assisted rubric scoring
engine/scoring.py - Routing · Assigns items to fulfillment paths
engine/routing.py - Approval gate · Boundary for approve, shelve, or modify before fulfillment
proposal_actions.py
State layer
File-based item storage and board coordination
- Item vault · Persists per-item state as markdown records
engine/item_vault.py - Kanban store · Writes Hermes board columns and cards
engine/kanban_store.py - Frontmatter · Reads and writes YAML frontmatter in item files
engine/frontmatter.py
Ops & CLI
User-facing commands and operational reporting
- Triage CLI · Validation, scaffolding, initialization, and install planning commands
cli/triage.py - Cost report · Tracks per-item spend and operational cost control
scripts/cost_report.py
Example instantiation
Concrete reference implementation for one domain
- Example domain · 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 · Validates reusable engine behavior across configurations
tests/test_engine_core.py
Connections 20
- 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