Hermes Agent architecture: memory, context and gateways
Explore Hermes Agent’s request loop, context compression, SQLite conversation history, messaging gateways and scheduled tasks.
Player not loading? Watch on YouTube
This architecture walkthrough explains how the Hermes AI agent handles messages, tool calls and persistent memory. The speaker follows a request through context construction, model responses and repeated tool execution before the final answer and a memory update.
The context section distinguishes soul.md, which defines personality, from user.md and memory.md, which hold user information and other useful facts. According to the speaker, Hermes stores full session transcripts in a local SQLite database. External memory requires separate configuration, and recalled information may arrive in a follow-up turn rather than the first response.
For long conversations, the speaker describes a configurable compression threshold with a default of 50% of the context window. Hermes replaces earlier messages with a structured summary. The walkthrough also explains its initial character-count estimate and later use of token usage reported by the model provider.
The gateway section covers messaging connections such as Telegram and the reconstruction of conversation history for incoming messages. Each integration needs its own configuration. Scheduled tasks use an internal loop that checks every minute. The speaker reports finding jobs in jobs.json rather than SQLite, contrary to the documentation they consulted, and explains how notifications reach a configured home messaging destination.