Agent Gateway
The always-running system that connects an agent core to messaging platforms — Telegram, Discord, Slack, email, SMS, WhatsApp — so the operator can talk to their agent from anywhere. A gateway is much more than a message relay, because chat platforms deliver single messages, not conversations: on every inbound message the gateway must reconstruct the full context from scratch — look up the session (identified by gateway name + the platform's session ID), pull the message history from a local store, assemble the rest of the context, and hand the whole thing to the agent. In Hermes this is one asyncio loop waiting on all configured channels at once, each with its own transport (webhooks, 1-second polling loops, websockets) and its own setup (bot IDs, allow-listed user IDs). A session manager sits in front of the agent deciding what a new message does to work already in flight — interrupt it, steer it, or queue up behind it. The source credits the gateway, not the agent core, for making Hermes-style agents mainstream: the loop is commodity; reachability from your phone is the product.
Claims
- A gateway must construct context from scratch per inbound message — chat platforms hand you one message, so message history is the gateway's job, not the platform's. principle — durable: this is structural to messaging integrations, independent of which agent sits behind the gateway.
- Compose session identity from the gateway name plus the platform's session ID, and key the history store on it. best practice — context: multi-channel agents where the same operator arrives via different platforms; the composite key is what lets one store serve all channels without cross-talk. Hermes keeps this in a local SQLite database.
- Mediate mid-task messages with a session manager: interrupt,
steer, or queue, chosen by how the user sends the message.
best practice — context:
always-on agents whose users message faster than tasks complete (in
Telegram:
/interrupt,/steer, or a plain message to queue); without this, a new message either kills work silently or vanishes. - Every channel integration is configured independently — webhooks vs polling vs websockets — there is no universal gateway. observation — the integration surface, not the agent, is where the engineering volume lives.
- The source states the gateway is what made Hermes as popular as it became — not the most complex part, but the part that put the agent in your pocket. observation — distribution/reachability as the adoption driver rather than core capability.
Related
- Agent Loop — the gateway feeds the loop; "build context" is trivial in a CLI session and load-bearing behind a gateway.
- Context Compression — the reconstructed histories the gateway assembles are what grow past the window and get compressed.
- Layered Agent Memory — the gateway reads the transcript tier (SQLite sessions) to rebuild conversations.
- Agent-Native Cron — scheduled jobs deliver their results through the gateway's designated "home" channel.
- Managed Agent — the same always-on, reachable-anywhere property bought as a hosted service instead of self-run infrastructure.
- Distillate: Hermes Architecture EXPLAINED: Memory, Context & Gateways