Hermes Plugin
Zero code changes
The plugin hooks into every Hermes session automatically. No changes to your agent code needed.
Requirements
- Hermes 2026.1.0 or later
- Node.js 22 or later
- A running AgentMetrics server
1. Install the plugin
hermes plugins install agentmetrics-hermes
2. Configure
In your Hermes config (hermes.config.ts or hermes.json), add the plugin and point it at your AgentMetrics server:
import agentmetrics from "agentmetrics-hermes";
export default {
plugins: [agentmetrics],
metrics: {
endpoint: "http://localhost:8099",
},
};
Or set the server URL via environment variable instead of the config file:
export AGENTMETRICS_URL=http://localhost:8099
The API key is read from AGENTMETRICS_API_KEY. You can also set it in the config:
export default {
plugins: [agentmetrics],
metrics: {
endpoint: "http://localhost:8099",
apiKey: "am_...",
},
};
3. Restart Hermes
The plugin loads at startup. Restart Hermes after installing.
4. Verify
Run any Hermes session and check your dashboard. You can also use the built-in CLI:
hermes agentmetrics status # config, counters, circuit breaker state
hermes agentmetrics test # send a test event and verify delivery
What gets tracked
Hermes tracks more than any other integration because it hooks directly into the Hermes runtime event bus.
Per run
| Field | Description |
|---|---|
| Status | success or failed |
| Duration | Wall-clock run duration |
| Input / output tokens | Aggregated from all LLM calls in the run |
| Cache tokens | Read and write cache token counts |
| Tool calls / errors | Count and names of tools invoked |
| Cost | Estimated from token counts and model pricing |
| Model / provider | From the LLM calls |
| Delegation depth | Subagent nesting depth |
| Skills loaded | Count of skills loaded in the run |
| Memory writes | Count of memory write operations |
| Session search calls | Count of session search operations |
| Subagents spawned / errors | Subagent delegation counts |
Per session
Aggregated totals across all runs in the session: tokens, cost, tool calls, run count, compaction count, and reset count.
Real-time activity stream
Every significant event is posted live for dashboard updates: llm_start, llm_end, tool_start, tool_end, subagent_start, subagent_end, skill_load, memory_write, cron_start, cron_end, gateway_connect, gateway_disconnect, compaction, reset, and more.
CLI commands
hermes agentmetrics status # config, counters, circuit breaker state
hermes agentmetrics flush # force-flush the event queue
hermes agentmetrics tail # show in-flight run state
hermes agentmetrics test # send a test event
hermes agentmetrics redaction-check # preview what redaction does to sample data
hermes agentmetrics drain # retry all dead-letter queue events
hermes agentmetrics cost # show pricing table and custom overrides
Configuration options
All options go under the metrics: key in your Hermes config.
| Option | Env var | Default | Description |
|---|---|---|---|
endpoint | AGENTMETRICS_URL | http://localhost:8099 | AgentMetrics server address |
apiKey | AGENTMETRICS_API_KEY | - | API key |
enabled | - | true | Disable without removing the plugin |
flushInterval | - | 10 (seconds) | How often to flush the event queue |
batchSize | - | 100 | Max events per batch request |
queueSize | - | 10000 | In-memory queue depth before FIFO drop |
retryMaxAttempts | - | 5 | Max retries before moving to DLQ |
redactionMode | - | strict | strict, moderate, or debug |
exportedToolNames | - | blocklist | allowlist, blocklist, hash, or off |
redactToolNames | - | [] | Tool names to redact in blocklist mode |
compressPayloads | - | false | Gzip batches larger than 1 KB |
costProviderTable | - | {} | Custom per-model pricing overrides |
Reliability
- In-memory queue with configurable FIFO overflow drop
- WAL (write-ahead log) at
~/.config/hermes/agentmetrics-wal.jsonl, survives process crashes - Circuit breaker: opens after 10 consecutive failures, probes again after 5 minutes
- Dead-letter queue: events that exhaust retries are held for manual drain