ep114a-miadi-hermes-agent-coordinator-260706
@miadi/hermes-conductor ep114
it's supposed to be capable of coordinating multiple agents coordinate everything and do a really complex work in looking at only 3 or 4 pages. It sounds really like you're cutting corners on the quality of the analysis and the work that you're doing. I think you need to think a little bit more deeper and produce a revision again. Based on the fact that the agents will receive that in the terminal and they're going to go through our packages, and they're going to create a new package, and they're going to create something that we will be capable of using to coordinate all of the work, and it should also consider that we are going to use multiplexer which is something important, I think, to specify in here.
Youâre right that the last revision was thin for something thatâs meant to coordinate a whole multiâagent workspace; below is a deeper spec that actually matches the complexity of what youâre building and the fact that agents will consume it from the terminal, traverse your existing packages, and create a new coordination package with multiplexerâfriendly workflows.
Goals and constraints
- Hermesâagent is the thinker, conductor is the orchestrator. Hermesâagent remains the core reasoning agent, but orchestration, task routing, and multiâagent coordination live in
@miadi/hermes-conductoron top of LangGraph JS.12 - Multiâagent, hierarchical, longârunning workflows. The conductor must support parallel builders, reviewers, scouts, and possibly nested âsubâboardsâ for complex projects, using LangGraphâs durable execution and multiâagent patterns.341
- A2A contractâfirst design. All payloads visible to agents in the terminal are defined in
@miadi/a2a-contracts; the conductor never invents new adâhoc shapes. You evolve those contracts and then the conductor consumes them.56 - Multiplexed terminal UX. Output is designed to be consumed in a terminal multiplexer (tmux/gmtermux/tide) with perâagent panes/streams and clear event channels, not just a single log stream.5
Runtime architecture with LangGraph JS
LangGraph JS is explicitly positioned as a lowâlevel orchestration runtime for longârunning, stateful, multiâagent workflows, rather than just a chain builder. You can exploit three aspects:21
- StateGraph at the board level. A single
StateGraphinstance,ConductorGraph, represents the entire board, with channels for tasks, assignments, locks, board metrics, and terminal events, defined viaAnnotation.Rootor Zod state schemas.78 - Multiple specialized nodes (agents). Each node represents a role: Conductor (Hermesâintegrated), Builder, Reviewer, Scout, plus any future roles like âResearcherâ or âOpsâ, mirroring LangGraphâs multiâagent examples.93
- Hierarchical supervision when needed. For very complex workflows, you can layer this on top of LangGraphâs âsupervisorâ abstraction (
@langchain/langgraph-supervisor) to manage subâgraphs, i.e. a conductor that controls multiple local supervisors/boards.1011
Board state (ConductorState)
Instead of a minimal state, define a richer boardâlevel state with multiple channels:
plan: narrative description of the overall goal, plus a structured A2APlanContract.tasks: list of A2ATaskContractobjects, each with status, owner, related files, Notion/GitHub IDs.assignments: mappingagentId -> taskId, plus any agent capabilities/constraints from A2A.fileLocks:filepath -> { owner, lastModified, lockExpiry }with full lock history for debugging.boardMetrics: queue depth, latency per task, error counters, throughput per builder.terminalEvents: stream ofTerminalEventContractobjects that the CLI renders as multiplexed panes or feeds.
LangGraphâs Annotation.Root pattern lets you build this as stronglyâtyped channels with reducers and defaults, or you can use the newer Zodâbased registry helpers to integrate with Studio/observability.128
Role design and coordination flow
Youâre not just shuffling tasks; you need a detailed lifecycle that agents can trust when they read the spec in a terminal. Hereâs a more explicit flow.
Conductor (Hermesâdriven)
- Responsibilities:
- Take
planand currentboardMetrics, decide on decomposition strategy. - Call Hermesâagent via your connector to produce/adjust a
TaskContract[]plan. Hermes is the âplannerâ and âstrategistâ; the conductor is the orchestrator.1314 - Assign tasks to builders based on capabilities (from A2A), load, and queue depth.
- Emit
TerminalEventContractmessages describing what changed: tasks added, reassigned, split, blocked.
- Take
- Graph behavior:
- Node
conductorNode(state)readsplan,tasks,boardMetricsand produces updates; edges route tobuilderNodefor new tasks or back toconductorNodewhen the scout requests rebalancing.
- Node
Builders (one or many)
- Responsibilities:
- Take ownership of tasks from
assignmentsandfileLocks. - Execute work: create new packages (e.g.
@miadi/hermes-conductor), edit existing packages, update A2A contracts, write docs. - Update
TaskContractstatus, file lists, and completion artifacts (diffs, test results).
- Take ownership of tasks from
- Concurrency:
- Multiple builders are parallel nodes or parallel instances of the same node; LangGraph supports this style of multiâagent collaboration by letting nodes represent agents and edges represent communication/handâoff.43
- Scout controls the number of active builders based on queue depth and error rates.
Reviewer
- Responsibilities:
- Inspect completion artifacts, including diffs, test outputs, and A2A payloads.
- Validate that the work adheres to contracts (e.g. board/terminal events match schema, packages build, tests pass).
- Gate merges and publish events:
review_requested,review_approved,review_rejectedintoterminalEvents.
- Humanâinâloop:
Scout (dynamic scaling / supervision)
- Responsibilities:
- Observe
boardMetricsandtasksto detect backlog, stalled tasks, or idle builders. - Spawn or retire builders (or ask an external supervisor) based on thresholds.
- Emit events so humans can see scaling decisions in the multiplexer.
- Observe
LangGraphâs supervisor library shows how to define a âsupervisor agentâ that controls multiple specialized agents, and even supervisors-of-supervisors, which maps well to Scout controlling builder groups.1110
Terminal and multiplexer integration
Because your agents will read this spec in the terminal and you already rely on multiplexers, the output needs to be structured explicitly around multiâpane workflows.5
Event channels
Define at least three A2A event channels (and corresponding contracts):
- Board events: highâlevel state changes:
"plan_updated","tasks_planned","board_metrics_changed". - Agent events: lifecycle:
"builder_started_task","builder_completed_task","reviewer_requested_review","scout_scaled_builders". - File/lock events:
"file_locked","file_unlocked","lock_conflict_detected","lock_expired".
Each TerminalEventContract includes: event type, timestamp, agentId (if applicable), taskId/filepath, and a humanâreadable message. The CLI subscribes to this stream and routes events to panes.
Multiplexerâfriendly CLI
Design the CLI so that:
- It can run as a standalone process or inside a multiplexer session (
tmux attach, gmtermux, etc.), with flags to choose the layout (e.g. board summary pane + perâagent panes + log pane). - Each agent (Conductor, Builder N, Reviewer, Scout) has its own stream, making it easy to follow a single agent in a pane while keeping a global board summary visible.
- The CLI can export or replay event logs (A2A envelopes) so agents and humans can reconstruct decisions later.
You can take cues from multiâagent examples where each agentâs messages are kept as distinct streams within a multiâagent workflow, then map those streams onto terminal panes.1534
A2A contracts and package interaction
The conductor spec should explicitly say:
- All task and board payloads are A2A contracts.
- Tasks, board snapshots, agent profiles, lock states, and terminal events are contract types defined in
@miadi/a2a-contracts. - No âraw JSONâ is exposed to agents; everything visible in the terminal is strongly typed and versioned.
- Tasks, board snapshots, agent profiles, lock states, and terminal events are contract types defined in
- Conductor doesnât own contract evolution.
- When you realize you need new fields (e.g.
multiplexerLayout,panePriority,traceId), you add them to@miadi/a2a-contracts, then update the conductor package to consume the new version via workspace/pnpm. Yarn metadata around@miadi/tidealready demonstrates this pattern of using workspace dependencies for house packages.5
- When you realize you need new fields (e.g.
- Package creation flows are contractâdriven.
- Builders use contracts like
PackageCreationTaskContractandPackageRefactorTaskContractthat encode which repository, workspace path, and build/test steps are required. - The conductorâs job is to keep the board and external tools (Notion, GitHub, CI) in sync via those contracts, not to hide them.
- Builders use contracts like
Multiâagent coordination pattern with LangGraph
To make this concrete for agents reading the spec, you can describe the coordination pattern in LangGraph terms, which is how the official examples teach multiâagent systems.1639
Core pattern
- State:
ConductorStateannotation or Zod schema with channels described above.812 - Nodes: functions typed as
GraphNode<typeof ConductorState>representing Conductor, Builder, Reviewer, Scout.71 - Edges:
START â conductorto bootstrap the board.conductor â builderwhen tasks are ready to be executed.builder â reviewerwhen tasks complete.reviewer â conductorwhen plan needs adjustment.scout â conductor|builderwhen scaling decisions are made.- Conditional edges from reviewer and scout to support reâplan/reâbuild loops until
status === "done".
LangGraphâs documentation emphasizes that this is precisely the use case: longârunning, stateful, multiâagent workflows with persistence, humanâinâloop, and streaming; you are essentially building a higherâlevel âDeep Agentâ style harness for Hermes using those primitives.421
Implementation directives for agents (what they will read)
Given that agents will open this plan in a terminal and use it to create the conductor package, the spec they see should include explicit action directives, for example:
- Step 1: Inspect existing Miadi workspace and
@miadi/a2a-contractsto list current contracts; do not introduce new payloads until those are understood. - Step 2: Create
@miadi/hermes-conductorpackage scaffold with LangGraph JS and LangChain JS, wired via workspace dependencies (@langchain/langgraph@^1.4.7,langchain@^0.3.x,@langchain/core@^1.1.x,@miadi/a2a-contracts@workspace:*).1718195 - Step 3: Implement
ConductorStateand role nodes using current LangGraph state APIs (Annotation or Zod registry), with board, task, lock, metrics, and terminal channels.1287 - Step 4: Implement connectors to Hermesâagent, Notion, GitHub, and A2A endpoints, all speaking contract types. Hermesâagent is the planner, conductor is the orchestrator.6142013
- Step 5: Build the CLI around
TerminalEventContractstreams and design a default multiplexer layout that works well with tmux/gmtermux/tide.5 - Step 6: Add integration tests that simulate multiâagent workflows with at least 3â5 builders, verify lock semantics, backlog scaling, human review gates, and external sync (Notion/GitHub). Use LangGraphâs persistence and interrupt APIs rather than adâhoc state.
If you want, the next iteration can be a more formal âagentâreadable specâ (essentially a contract document) in your preferred style, with explicit JSON/Zod schemas and stepâbyâstep build tasks that Hermes and friends can follow verbatim. <span style="display:none">212223</span>
<div align="center">â</div>https://www.perplexity.ai/search/69c944be-41e2-4524-bbc5-41cf977be3c1
Footnotes
-
https://docs.langchain.com/oss/javascript/langgraph/overview â© â©2 â©3 â©4 â©5 â©6
-
https://langchain-ai.github.io/langgraphjs/tutorials/multi_agent/multi_agent_collaboration/ â© â©2 â©3 â©4 â©5
-
https://www.youtube.com/watch?v=hvAPnpSfSGo â© â©2 â©3 â©4
-
https://classic.yarnpkg.com/en/package/@miadi/tide â© â©2 â©3 â©4 â©5 â©6
-
https://agent2agent.info/docs/getting-started/setup/ â© â©2
-
https://reference.langchain.com/javascript/langchain-langgraph/index/StateGraph/constructor â© â©2 â©3
-
https://langchain-ai.github.io/langgraphjs/how-tos/define-state/ â© â©2 â©3 â©4
-
https://medium.com/@sushmita2310/building-multi-agent-systems-with-langgraph-a-step-by-step-guide-d14088e90f72 â© â©2
-
https://github.com/langchain-ai/langgraphjs-supervisor â© â©2
-
https://medium.com/@mrcoffeeai/building-stateful-agents-with-langgraphs-annotated-559608c46d7e â© â©2 â©3
-
https://github.com/NousResearch/hermes-agent/blob/main/AGENTS.md â© â©2
-
https://langchain-ai.github.io/langgraphjs/reference/variables/langgraph.MessagesAnnotation.html â©
-
https://www.js-craft.io/blog/multi-agent-langgraph-javascript-1/ â©
-
https://langchain-ai.github.io/langgraphjs/reference/classes/langgraph.StateGraph.html â©
-
https://langchain-ai.github.io/langgraphjs/concepts/low_level/ â©