Hermes Agent Source Dissection
Setup
The Hermes Agent source tree lives at hermes-agent/ in the project root.
Auto-discover the source root by searching for hermes-agent/run_agent.py using Glob.
The directory containing it is SOURCE_ROOT. All file paths in the reference files are relative to this SOURCE_ROOT.
How to use this skill
- Locate the source root: search the project for
hermes-agent/run_agent.py using Glob.
The parent directory of run_agent.py is SOURCE_ROOT.
- Identify the topic from the user's request
- Read the matching reference file from
references/ below
- Read the actual source files listed in the reference — prepend
SOURCE_ROOT/ to each path
- Present your findings using the output format at the bottom
Routing Table
| Topic |
Reference File |
Covers |
| Startup, CLI, config, profiles, auth, credentials |
references/bootstrap.md |
Entry points, config.yaml, credential pool, constants, setup wizard |
| Conversation loop, tool calling, streaming, multi-turn |
references/engine.md |
AIAgent main loop, tool dispatch, parallelization, budget, Honcho |
| System prompt, SOUL.md, context compression, caching |
references/context.md |
Prompt assembly, context files, compressor, cache strategy, tokens |
| Tool definition, registry, toolsets, execution, dispatch |
references/tools.md |
Tool interface, registry singleton, toolset composition, async bridge |
| Gateway, platforms, messaging, Telegram, Discord, Feishu |
references/gateway.md |
GatewayRunner, 14 platform adapters, sessions, delivery, interrupts |
| Skills, SOUL.md parsing, skill hub, security scanning |
references/skills.md |
Progressive disclosure, hub lifecycle, guard patterns, slash commands |
| Terminal execution, Docker, SSH, Modal, local, sandbox |
references/terminals.md |
Backend abstraction, persistent shell, approval, dangerous commands |
| Memory, sessions, persistence, checkpoints, todo |
references/memory.md |
Memory tool, session storage, Honcho integration, checkpoint system |
| RL training, environments, benchmarks, trajectory |
references/training.md |
Atropos base env, OPD, web research, batch runner, compression |
| ACP, MCP, plugins, delegation, model routing |
references/integrations.md |
ACP server, MCP tool bridge, plugin system, subagent delegation |
If the topic spans multiple areas, read the primary reference first, then follow its Neighbors section to related files.
If no topic matches, grep the source root for relevant keywords before giving up.
Output Format
Structure your response like this:
Pattern: one-line name
Why it exists: 2-3 sentences on the problem it solves
Data flow:
ASCII diagram showing runtime flow
Key code (from the source, simplified):
# The core abstraction, stripped to essentials
Files read: list with line numbers for critical sections
Design tradeoffs: what was gained, what was sacrificed
How to adapt: what to keep, what to change for our project
Architecture Overview
For orientation, here's how the 10 subsystems connect:
User Input (CLI / TUI / Gateway / ACP)
|
[bootstrap] -> config.yaml, credentials, profile selection
|
[engine] -> AIAgent loop: message -> LLM -> stream -> tool calls -> continue/end
| |
[context] -> prompt assembly [tools] -> registry -> dispatch -> async bridge
| | | |
[memory] <- compression [skills] <--- [terminals] <- backends
| | |
+-- persistence [training] <- RL environments, benchmarks
|
[integrations] -> ACP, MCP, plugins, delegation
|
[gateway] -> 14 platforms, sessions, delivery
Each reference file contains: architecture knowledge, key abstractions, reading order, file table with line counts, and neighbor cross-references.
1---2name: hermes-agent-dissect3description: Navigate and extract reusable design patterns from the Hermes Agent source code for application in our project. It covers ten subsystems: bootstrap/CLI, conversation engine, prompt/context, tool system, gateway/messaging, skills, terminal backends, memory/persistence, RL training, and integrations (ACP/MCP/plugins). Use this skill whenever a user wants to study, reference, or adapt architectural patterns from Hermes Agent. Also use it when the user asks questions such as "how does Hermes do this?", "learn from Hermes Agent", "dissect Hermes", "reference Hermes source", or requests implementation details for any Hermes Agent feature. This skill is the primary entry point: it routes to the appropriate reference file by topic, then reads the source code and returns extractable patterns. Even when the question appears simple (for example, "how does Hermes implement X?"), use this skill because the reference files provide precise file paths, reading order, and architectural context that substantially improve answe4---56# Hermes Agent Source Dissection78## Setup910The Hermes Agent source tree lives at `hermes-agent/` in the project root.11Auto-discover the source root by searching for `hermes-agent/run_agent.py` using Glob.12The directory containing it is `SOURCE_ROOT`. All file paths in the reference files are relative to this `SOURCE_ROOT`.1314## How to use this skill15161. **Locate the source root**: search the project for `hermes-agent/run_agent.py` using Glob.17 The parent directory of `run_agent.py` is `SOURCE_ROOT`.182. **Identify the topic** from the user's request193. **Read the matching reference file** from `references/` below204. **Read the actual source files** listed in the reference — prepend `SOURCE_ROOT/` to each path215. **Present your findings** using the output format at the bottom2223## Routing Table2425| Topic | Reference File | Covers |26|-------|---------------|--------|27| Startup, CLI, config, profiles, auth, credentials | `references/bootstrap.md` | Entry points, config.yaml, credential pool, constants, setup wizard |28| Conversation loop, tool calling, streaming, multi-turn | `references/engine.md` | AIAgent main loop, tool dispatch, parallelization, budget, Honcho |29| System prompt, SOUL.md, context compression, caching | `references/context.md` | Prompt assembly, context files, compressor, cache strategy, tokens |30| Tool definition, registry, toolsets, execution, dispatch | `references/tools.md` | Tool interface, registry singleton, toolset composition, async bridge |31| Gateway, platforms, messaging, Telegram, Discord, Feishu | `references/gateway.md` | GatewayRunner, 14 platform adapters, sessions, delivery, interrupts |32| Skills, SOUL.md parsing, skill hub, security scanning | `references/skills.md` | Progressive disclosure, hub lifecycle, guard patterns, slash commands |33| Terminal execution, Docker, SSH, Modal, local, sandbox | `references/terminals.md` | Backend abstraction, persistent shell, approval, dangerous commands |34| Memory, sessions, persistence, checkpoints, todo | `references/memory.md` | Memory tool, session storage, Honcho integration, checkpoint system |35| RL training, environments, benchmarks, trajectory | `references/training.md` | Atropos base env, OPD, web research, batch runner, compression |36| ACP, MCP, plugins, delegation, model routing | `references/integrations.md` | ACP server, MCP tool bridge, plugin system, subagent delegation |3738If the topic spans multiple areas, read the primary reference first, then follow its **Neighbors** section to related files.3940If no topic matches, grep the source root for relevant keywords before giving up.4142## Output Format4344Structure your response like this:4546**Pattern**: one-line name47**Why it exists**: 2-3 sentences on the problem it solves48**Data flow**:49```50ASCII diagram showing runtime flow51```52**Key code** (from the source, simplified):53```python54# The core abstraction, stripped to essentials55```56**Files read**: list with line numbers for critical sections57**Design tradeoffs**: what was gained, what was sacrificed58**How to adapt**: what to keep, what to change for our project5960## Architecture Overview6162For orientation, here's how the 10 subsystems connect:6364```65User Input (CLI / TUI / Gateway / ACP)66 |67[bootstrap] -> config.yaml, credentials, profile selection68 |69[engine] -> AIAgent loop: message -> LLM -> stream -> tool calls -> continue/end70 | |71[context] -> prompt assembly [tools] -> registry -> dispatch -> async bridge72 | | | |73[memory] <- compression [skills] <--- [terminals] <- backends74 | | |75 +-- persistence [training] <- RL environments, benchmarks76 |77 [integrations] -> ACP, MCP, plugins, delegation78 |79 [gateway] -> 14 platforms, sessions, delivery80```8182Each reference file contains: architecture knowledge, key abstractions, reading order, file table with line counts, and neighbor cross-references.