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

Shell
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:

TypeScript
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:

Shell
export AGENTMETRICS_URL=http://localhost:8099

The API key is read from AGENTMETRICS_API_KEY. You can also set it in the config:

TypeScript
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:

Shell
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

FieldDescription
Statussuccess or failed
DurationWall-clock run duration
Input / output tokensAggregated from all LLM calls in the run
Cache tokensRead and write cache token counts
Tool calls / errorsCount and names of tools invoked
CostEstimated from token counts and model pricing
Model / providerFrom the LLM calls
Delegation depthSubagent nesting depth
Skills loadedCount of skills loaded in the run
Memory writesCount of memory write operations
Session search callsCount of session search operations
Subagents spawned / errorsSubagent 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

Shell
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.

OptionEnv varDefaultDescription
endpointAGENTMETRICS_URLhttp://localhost:8099AgentMetrics server address
apiKeyAGENTMETRICS_API_KEY-API key
enabled-trueDisable without removing the plugin
flushInterval-10 (seconds)How often to flush the event queue
batchSize-100Max events per batch request
queueSize-10000In-memory queue depth before FIFO drop
retryMaxAttempts-5Max retries before moving to DLQ
redactionMode-strictstrict, moderate, or debug
exportedToolNames-blocklistallowlist, blocklist, hash, or off
redactToolNames-[]Tool names to redact in blocklist mode
compressPayloads-falseGzip 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