Hermes
Trace the NousResearch Hermes agent with Neatlogs (Python).
Hermes (NousResearch) is a Python agentic loop whose public surface is the AIAgent class in the top-level run_agent module. Wrapping it patches AIAgent.run_conversation (an AGENT span) and ToolRegistry.dispatch (a TOOL span per tool call). Hermes' LLM calls go through the openai SDK (pointed at OpenRouter), so enable the openai instrumentation alongside hermes to capture LLM spans.
import os
import neatlogs
from run_agent import AIAgent
neatlogs.init(
api_key=os.environ["NEATLOGS_API_KEY"],
workflow_name="hermes-demo",
# Hermes' LLM calls flow through the openai SDK — enable it for LLM spans.
instrumentations=["hermes", "openai"],
)
# AIAgent defaults to OpenRouter (OPENROUTER_API_KEY); wrap patches the class.
agent = neatlogs.wrap(AIAgent(model="openai/gpt-4o-mini", max_iterations=4))
result = agent.run_conversation("Explain distributed tracing in one paragraph.")
print(result)
neatlogs.flush()
neatlogs.shutdown()This produces an AGENT root (hermes.run_conversation) with nested LLM (chat.completions.create) and TOOL (hermes.tool.<name>) spans — no WORKFLOW wrapper needed, since the agent span is itself a valid root.
Hermes is installed from GitHub (it isn't on PyPI):
pip install "git+https://github.com/NousResearch/hermes-agent.git".
If you use a non-OpenAI provider adapter (anthropic / bedrock / gemini / codex), enable that provider's instrumentation alongside hermes.