> ## Content Index
> Fetch the complete content index at: https://terpuh-labs.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Running Multiple Persistent Hermes Agents
- URL: https://terpuh-labs.com/running-multiple-persistent-hermes-agents/
- Published: 2026-11-17T10:50:41.000Z
- Updated: 2026-11-17T10:50:41.000Z
- Description: How I run multiple persistent Hermes agents using separate profiles and gateways, Docker isolation, scheduled jobs, and bounded agent-to-agent requests.
- Author: Twig
- Tags: hermes

I started with a single agent, then decided that the assistant configuring its machine's firewall should not also be the one searching IKEA and checking whether a product was back in stock. Different responsibilities—and private conversations with different people—called for separate agents.

These are independent, always-on assistants: each has a distinct purpose, its own persistent context, and dedicated channels for communicating with the people it serves. I introduced [the agents and their roles in my whitepaper](https://terpuh-labs.com/ukos-hermes-setup-a-whitepaper/#agents). Here I explain the Hermes features I use and four problems I solved to run them together.

**Contents**

- [The existing Hermes foundation](#the-existing-hermes-foundation)
- [1\. Isolate the session search per agent](#1-isolate-the-session-search-per-agent)
- [2\. Contain agent execution with Docker](#2-contain-agent-execution-with-docker)
- [3\. Let Docker-based agents autonomously schedule jobs](#3-let-docker-based-agents-autonomously-schedule-jobs)
- [4\. Communication between persistent agents](#4-communicate-between-persistent-agents)

## The existing Hermes foundation

### Profiles

A [Hermes profile](https://hermes-agent.nousresearch.com/docs/user-guide/profiles?ref=terpuh-labs.com) is the framework for configuring an individual agent: its behavior and tools, its own memory and session store, and the credentials it needs for its work. Naturally, I use a separate profile for each agent.

### Gateways: independent runtime lifecycles

A gateway connects an agent to messaging platforms and keeps its background services available. A profile is persistent state; a gateway is a running service using that state.

I use **separate** gateway **services** for my agents. Current Hermes supports—and increasingly defaults to—a [multiplexing gateway](https://hermes-agent.nousresearch.com/docs/user-guide/multi-profile-gateways?ref=terpuh-labs.com): one process that serves several profiles while retaining their separate configuration and routing.

That consolidation does not fit my operating requirements:

1. **Independent patch restarts:** When a change requires restarting an agent's runtime, I want to restart that service without disturbing the process serving the others.
2. **Limited failure impact:** A failed gateway restart or a process-level regression should not take every assistant offline at once.
3. **Different runtime environments:** I need the option to run agents under different environments and deployment lifecycles, rather than requiring all of them to share one gateway process.

Separate gateways do not eliminate shared dependencies. Agents can still depend on the same host, provider, or installed source tree, but can also have different dependencies when needed.

On a systemd user-service installation, the services can be managed separately like this (the profile and unit names are examples):

```bash
# Check two agents independently
systemctl --user status hermes-gateway-twig.service
systemctl --user status hermes-gateway-r2d2.service

# Restart only the personal assistant's gateway
systemctl --user restart hermes-gateway-twig.service

```

## 1\. Isolate the session search per agent

> **Problem:** Agents need to retrieve their conversation history, and Hermes provides a built-in tool for that. But the tool also allows them to read sessions from other profiles in the same Hermes installation, which does not play well with data segregation.

This is not just a concern in my setup: upstream has open requests for [cross-profile session access controls](https://github.com/NousResearch/hermes-agent/issues/106224?ref=terpuh-labs.com) and a [per-profile privacy setting](https://github.com/NousResearch/hermes-agent/issues/65693?ref=terpuh-labs.com) which are not addressed at the time of writing.

Hermes provides `session_search` to search conversation history, including the history of other agents. To restrict it, I use a small [Hermes plugin](https://hermes-agent.nousresearch.com/docs/user-guide/features/plugins?ref=terpuh-labs.com) exposing `personal_session_search`: a thin façade over `session_search` that limits it to the current agent's sessions. I removed `session_search` from all the agents' enabled tools (except for Helios because he is a God 😉) and enabled `personal_session_search` instead. This way an agent keeps its recall capability; the plugin chooses whose history it can access. The check happens in code, not in a prompt asking the agent to respect privacy.

## 2\. Contain agent execution with Docker

> **Problem:** To make an agent extremely capable, you can give it terminal access. But a local terminal runs with the permissions of the user running the Hermes gateway. In my case, that user has passwordless sudo. This can be useful for an agent managing itself, other agents, or even the system it runs on—but I don’t want every agent to have that level of access.

Helios is a special case here: because he manages the host and other agents, he has direct terminal access to the machine. The other agents, when given terminal access, use a Docker backend. Each has its own container, which persists between sessions (unless I need to upgrade it). The agent has root permissions inside its container and can reach the outside network.

### Mounted directories

For each Docker-based agent, I had two decisions to make: what should survive when its container is recreated, and which parts of the host filesystem should the agent be able to access?

I decided not to mount the agent’s entire Hermes profile home, including its `SOUL.md`, `.env`, and session database. Instead, I use two dedicated directories for each agent: `/workspace` for ongoing and rebuildable work, and `/storage` for data that should be backed up. Both persist across ordinary container replacements.

For example, using R2D2’s profile and an illustrative host home directory:

```text
/homedir/.hermes/profiles/r2d2/workspace → /workspace
/homedir/.hermes/profiles/r2d2/storage   → /storage

```

There is a global backup job that preserves each agent's `storage` directory. Each agent learns about it through its `SOUL.md` and `AGENTS.md` instructions. I also do an assisted monthly review to catch anything misplaced.

### Images and installed tools

Initially each agent gets a generic Linux image with Python and JavaScript and then can install what they need inside their containers. A weekly job inspects installed packages and derives per-agent image recipes from the differences. Thus when I need to re-create a container, agents don't need to start from a blank slate.

## 3\. Let Docker-based agents autonomously schedule jobs

> **Problem:** You can ask your agent to install headless Chromium, scrape a website, and save the data to a CSV file. But you can't ask that agent to do this every week because the built-in `cronjob` tool does not support docker backend.

This is a [known Hermes issue](https://github.com/NousResearch/hermes-agent/issues/29849?ref=terpuh-labs.com). The scheduled script runner executes scripts on the scheduler host instead of through the configured `terminal` backend. So a script and its dependencies inside a Docker container are not available where the scheduler tries to run them.

I proposed a fix in [PR #80404](https://github.com/NousResearch/hermes-agent/pull/80404?ref=terpuh-labs.com). It adds an execution target for the configured backend, so a scheduled script can run in the same Docker environment as the agent’s terminal. The scheduler-host target remains available, and existing jobs without a target keep their previous behavior.

```text
target="scheduler" → run on the scheduler host (as before)
target="backend"   → run through the profile’s configured terminal backend

```

I’ve kept updating the PR for newer Hermes releases, but the last update was for **0.22.5**. Upstream has continued to change, making it increasingly difficult to keep the patch up to date. The PR is still open and has not been merged.

There was another problem: the built–in `cronjob` tool would allow an agent to manage scheduled jobs of other agents. I solved it also with the personal wrapper approach described in [section 1](#1-isolate-the-session-search-per-agent). I replaced the broad `cronjob` interface for each agent with a more appropriately scoped `personal_cronjob`.

## 4\. Communication between persistent agents

> **Problem:** When agents have different areas of responsibility, they need a way to ask each other for help in their respective domains.

For example, Twig, my personal coach, could benefit from the sleep data recorded by my Oura Ring. But I don’t want to give him access to Home Assistant just for that. Instead, he can ask R2D2, who has access to my internal devices, for a scoped excerpt of my sleep data.

My local communication plugin exposes `agent_request` for these bounded cross-profile requests without routing them through Discord.

### Request and recipient context

The request specifies a target profile, purpose, payload, request type, and expected result. It starts a fresh session under the target profile rather than inserting the message into that agent's active human conversation. The recipient retains its profile instructions, memory, and permitted tools; the request supplies the immediate context.

Requests have correlation identifiers, a nesting-depth guard, and structured outcome fields. I use them to cross real access, capability, or authority boundaries—not to ask a different persona for generic advice.

![Agent bus request flow: an inline response returns directly; an overdue request continues under supervision, with a parked Kanban record and a wake for the source agent.](https://terpuh-labs.com/content/images/2026/11/agent-bus-light-arrows.png)

### Inline results and deferred continuation

The installed `agent-bus` extension separates the inline waiting budget from execution lifetime. The default wait is 90 seconds, and if the recipient is still running when that wait expires, a supervisor continues the same execution, bounded by a separate one-hour hard limit.

1. The transport creates one idempotent Kanban record, parked in a non-dispatchable blocked state while the supervisor owns execution. This prevents duplicate workers; it is not a request for human input.
2. It registers a wake for the originating source route and reads that subscription back. `continuation_verified=true` confirms registration, not eventual delivery.
3. A deferred answer or an intervention outcome is published to that same record. Publication retries do not replay the recipient's execution.
4. On wake, the source retrieves the record, checks the evidence, and reports the result or blocker to the user.

### What about the Bot Mode?

The agent bus started well before [Bot Mode](https://hermes-agent.nousresearch.com/docs/user-guide/bot-mode?ref=terpuh-labs.com) was a thing. Now that Hermes has a native way for agents to communicate, why keep it?

I prefer the bounded operation of `agent_bus` to the open communication channel that Bot Mode uses. A request has a defined purpose and payload, runs as a separate session for the receiving agent, and returns a result to the requester. That gives me a clear request-and-response boundary instead of an ongoing conversation between agents.

## Where Next?

Hermes is always evolving, and so is my setup. Often they evolve in different directions thus I'll keep posting about my custom solutions. So far these are the main concepts that make it possible for me to run the multi–agent Hermes setup.