Skip to main content

Starting a session

Send a POST to the Hermes chat endpoint with your message and the agent type you want to use:
Response:

Continuing a session

Include session_id to resume the conversation with full context:
The agent remembers the previous exchange — no need to repeat context.

Session state

Hermes persists session context in the gateway’s KV store via agent_state:
  • Sessions are scoped to {tenant}:{session_id} — fully isolated across tenants
  • Session state TTL defaults to 24 hours (configurable up to 720 hours / 30 days)
  • Tool call results within a session are included in the agent’s context window

Request parameters

Response fields

Error handling

If the agent exceeds max_iterations, it returns with status: "max_iterations_reached" and whatever partial response it assembled. This is not an error — it means the task was too complex for the configured limit. For quota or upstream API errors, the tool call that failed is listed in tool_calls with status: "error" and an error_code. The agent continues with other tools.

Best practices

  • Start with focused questions — narrow scope = fewer tool calls = faster responses
  • Use sessions for workflows — chain analysis → write → send in one session rather than three separate calls
  • Pin agent types — use gtm_analyst for data questions, outreach_writer for content; don’t route everything through the orchestrator
  • Set explicit max_iterations — for quick lookups, max_iterations: 3; for deep analysis, let it run to the config default