> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ascendgtm.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Hermes — Autonomous Agent Layer

> Run persistent AI agents over your GTM data without managing infrastructure

## What is Hermes?

Hermes is the autonomous agent layer built on top of the V5 Gateway. Where the Gateway exposes 34 MCP tools for AI coding assistants to call on demand, Hermes provides **persistent agents** that can:

* Hold multi-turn conversations with context preserved across sessions
* Run async jobs (analysis, enrichment, reporting) without a human in the loop
* Execute scheduled workflows on daily or weekly cadences
* Orchestrate across specialized agent roles (classifier → specialist → synthesiser)

Hermes runs as a separate Cloudflare Worker (`ascend-agent-worker`) that calls back into the V5 Gateway via a private service binding for tool execution. **No tool credentials are duplicated** — agents inherit the same KV token store as the gateway.

## Architecture

```
Your AI tool (Claude, ChatGPT, Cursor…)
        ↓ MCP / HTTP
V5 Gateway (ascend-gateway-v5.ascendgtm.workers.dev)
   auth → token resolve → tool dispatch
        ↓ internal service binding
Hermes (ascend-agent-worker.ascendgtm.workers.dev)
   agent loop → tool calls → state storage
        ↓ reads KV
Connected SaaS APIs (HubSpot, Google Ads, GA4…)
```

The agent loop runs inside Hermes. Each iteration calls the gateway's `/internal/tool` endpoint, which executes the tool and returns the result. From the tool's perspective, it's the same execution path as a direct MCP call.

## Agent types

An **agent config** defines a named role. Each config specifies:

| Field              | Description                                                   |
| ------------------ | ------------------------------------------------------------- |
| `model`            | Model identifier (e.g. `claude-sonnet-4-5`, `gpt-4o`)         |
| `max_tokens`       | Max tokens per iteration (256–32768, default 4096)            |
| `max_iterations`   | Max reasoning iterations before forced stop (1–20, default 6) |
| `system_prompt`    | Role-defining system prompt                                   |
| `tools`            | List of gateway tool names this agent can call                |
| `classifier_model` | Optional — separate model for intent classification           |
| `synthesis_model`  | Optional — separate model for final output synthesis          |

Agent configs are stored in KV at `agent_config:{tenant}:{agent_type}` and managed via the Admin API.

## Common agent types

| Type              | Role                                 | Typical tools                                                         |
| ----------------- | ------------------------------------ | --------------------------------------------------------------------- |
| `gtm_analyst`     | GTM performance analysis             | `google_ads`, `ga4`, `hubspot_crm`, `salesforce_query`                |
| `outreach_writer` | Cold email and sequence drafting     | `perplexity_search`, `web_fetch`, `gmail`                             |
| `crm_enricher`    | Contact and account enrichment       | `hubspot_crm`, `salesforce_crm`, `discover_apis`, `perplexity_search` |
| `orchestrator`    | Routes requests to specialist agents | *(no direct tools — classifies intent)*                               |
| `report_builder`  | Weekly/monthly performance reports   | `google_ads`, `ga4`, `linkedin_ads`, `aws_ses`                        |

## Next steps

<CardGroup cols={2}>
  <Card title="Chat sessions" href="/docs/guides/hermes/chat-sessions" icon="messages">
    Start a conversation with an agent
  </Card>

  <Card title="Async jobs" href="/docs/guides/hermes/async-jobs" icon="gear">
    Kick off background agent tasks
  </Card>

  <Card title="Orchestrator pattern" href="/docs/guides/hermes/orchestrator" icon="diagram-project">
    Route requests across specialized agents
  </Card>

  <Card title="Scheduled jobs" href="/docs/guides/hermes/scheduled-jobs" icon="clock">
    Automate recurring agent workflows
  </Card>
</CardGroup>
