Hermes

Track every Hermes agent run with cost, latency, and failure data using the AgentMetrics Python SDK.

Native plugin coming soon

A native Hermes plugin (zero-code setup) is in development. Until then, use the @agentmetrics.track() decorator described below.

Requirements

  • Python 3.9 or later
  • agentmetrics Python SDK
  • A Hermes agent class or function

1. Install and configure

Shell
pip install agentmetrics
Python
import os
import agentmetrics

agentmetrics.configure(api_key=os.environ["AGENTMETRICS_API_KEY"])
agentmetrics.instrument()  # auto-captures token counts and cost

2. Wrap your agent

Add @agentmetrics.track() to the function or method that kicks off a Hermes agent run.

Function-based agents

Python
@agentmetrics.track(agent_id="my-hermes-agent")
def run_agent(task: str) -> str:
    agent = MyHermesAgent()
    return agent.run(task)

Class-based agents

Python
class MyHermesAgent(Agent):
    @agentmetrics.track(agent_id="my-hermes-agent")
    def run(self, task: str) -> str:
        # your Hermes agent logic
        return result

3. Run your agent

Call your agent normally. Every invocation is tracked.

Python
result = run_agent("summarize this document")

What gets tracked

  • Duration from first call to final response
  • Success or failure (exceptions are re-raised after recording)
  • Cost and token usage across all LLM calls (via instrument())
  • Model names