Blog / uptime and failover

Hermes Agent High Availability: Failover & Uptime Guide

High availability for Hermes Agent requires more than two running containers. The service needs a single owner for each messaging identity, durable access to memories and session state, a tested failover path, and a health signal that proves the agent can answer. Active-passive is the safest starting architecture for most Telegram, Discord, and WhatsApp deployments because it avoids two runtimes competing for the same bot token, linked device, or conversation state. Define the uptime target first, then calculate the recovery time objective, recovery point objective, and operational cost that the workflow can justify.

Updated Nov 8, 202613 min read
Deployment route
  1. 01

    Define the uptime requirement

    Record the hours the assistant must answer, the acceptable outage duration, the maximum tolerable data loss, and who responds when the primary runtime fails.

  2. 02

    Inventory stateful components

    Map sessions, memories, skills, configuration, model credentials, channel sessions, schedules, logs, and any external databases the runtime depends on.

  3. 03

    Choose active-passive ownership

    Keep one runtime authoritative for each channel identity and prepare a standby that receives traffic only after the primary is fenced or confirmed unavailable.

  4. 04

    Create the failover control

    Document how DNS, load balancing, orchestration, or an operator changes runtime ownership without duplicating channel consumers.

  5. 05

    Run a real failure drill

    Stop the primary, move ownership, verify the restored persistent state, send a channel message, and measure the actual recovery time before trusting the design.

Failover diagram showing one messaging gateway directing traffic to an active Hermes Agent runtime, a synchronized standby runtime, and shared persistent state.
High availability keeps one channel identity active while runtime ownership moves to a tested standby with access to persistent state.

Four-step path

How do you build a high-availability Hermes Agent?

Start with one recoverable runtime, add a standby only after state and channel ownership are understood, then test failure and recovery with real messages.

  1. Step 01

    Define the uptime requirement

    Record the hours the assistant must answer, the acceptable outage duration, the maximum tolerable data loss, and who responds when the primary runtime fails.

  2. Step 02

    Inventory stateful components

    Map sessions, memories, skills, configuration, model credentials, channel sessions, schedules, logs, and any external databases the runtime depends on.

  3. Step 03

    Choose active-passive ownership

    Keep one runtime authoritative for each channel identity and prepare a standby that receives traffic only after the primary is fenced or confirmed unavailable.

  4. Step 04

    Create the failover control

    Document how DNS, load balancing, orchestration, or an operator changes runtime ownership without duplicating channel consumers.

  5. Step 05

    Run a real failure drill

    Stop the primary, move ownership, verify the restored persistent state, send a channel message, and measure the actual recovery time before trusting the design.

What does high availability mean for Hermes Agent?

High availability means Hermes Agent continues accepting and answering messages within an agreed recovery target when a host, process, network path, or provider dependency fails. It does not mean every component runs twice.

A useful availability target is expressed in service time and failure duration. A personal assistant that must answer during business hours has different requirements from a customer-support bot that promises a response at every hour. The target should also distinguish degraded operation from complete failure: the runtime may answer with a fallback model, but it must not silently stop replying.

The hard part is coordination rather than duplication. A second container can be useless if it cannot read the same state, cannot own the same channel identity, or sends duplicate replies while the first runtime is still alive. Kubernetes, Docker restart policies, and cloud load balancers improve availability only when ownership, health, and state are defined around them.

Start with a clear service definition: which channels must answer, which tasks may run later, how much conversation history may be lost, and whether a human can take over during an incident. Those answers determine whether the correct design is a supervised single node, an active-passive pair, or a managed deployment whose provider owns failover.

Which parts of Hermes Agent can fail?

The runtime process, host, persistent disk, network, model provider, messaging channel, credential store, and human responder are independent failure domains. Recovery must address the failed domain instead of restarting everything.

Docker restart policies are useful for a crashed process on the same host, but they cannot recover a lost node or detached volume. A Kubernetes restart or reschedule can restore a pod, but it cannot repair a revoked model key or a Telegram token that another process is polling. Health checks therefore need separate signals for process health, dependency reachability, and end-to-end delivery.

The channel layer deserves special attention. Telegram bot tokens, Discord bot sessions, and WhatsApp QR-linked sessions carry identity and state that cannot be casually cloned. Treat each messaging account as a single-owner resource until the provider's documented behavior proves otherwise. A standby may hold configuration, but it should not consume the same channel session concurrently with the primary.

Maintain a failure matrix with one owner and one recovery action per row. That prevents a common anti-pattern where every alert leads to the same restart command, even when the actual failure is an expired credential, full disk, or model-provider quota.

  • The process can stop while the host remains healthy.
  • The host can lose CPU, memory, disk, network, or power.
  • The persistent volume can become full, corrupt, detached, or unavailable.
  • A model provider can reject requests because of quota, authentication, latency, or an outage.
  • A Telegram, Discord, or WhatsApp session can expire or lose ownership.
  • A backup or credential copy can exist but fail during restore.

What state must survive a Hermes Agent failover?

A standby needs the runtime image, configuration, model access, channel identity, persistent application data, schedules, and any external service state required to reproduce a working reply. A running process without that state is not a recovery path.

For a Docker deployment, persistent application data should live outside the disposable container. The exact directories and configuration files must follow the current Hermes Agent documentation for the deployed version. Back up the complete required data path, not only the main database or a single session file.

Secrets should be recoverable from an encrypted secret system rather than copied into the same backup as ordinary application data. A dashboard export, password manager, cloud secret manager, or sealed Kubernetes Secret may be appropriate. The recovery owner must know how to obtain authorization again if a token is deliberately destroyed during an incident.

State also includes external commitments: webhook endpoints, DNS names, provider quotas, and messaging identities. A recovered runtime that sends from a new Telegram bot or WhatsApp number may be technically available but operationally broken. Include those identities in the recovery inventory and record who controls each account.

  • Hermes persistent data, including sessions, memories, skills, and runtime configuration.
  • Model-provider credentials or a managed identity with equivalent access.
  • Telegram, Discord, WhatsApp, or other channel credentials and session state.
  • Scheduled jobs, webhooks, dashboard access, and network rules.
  • A tested backup copy plus the version or image tag needed to interpret it.
  • Logs and incident notes that explain the last known-good state.

Should a Hermes Agent deployment be active-active or active-passive?

Use active-passive for most messaging deployments. Active-active adds concurrency and split-brain risk unless the channel provider, data store, and application are explicitly designed for multiple consumers.

In an active-passive design, one runtime owns the channel connection and processes messages while the standby remains warm but not authoritative. A control plane or operator fences the old owner, promotes the standby, restores or attaches persistent state, and observes one verified reply. This design trades unused standby capacity for predictable ownership.

Active-active can be valid for stateless APIs behind a load balancer, but it is not a universal upgrade. Two Telegram long-polling consumers using the same token, two WhatsApp sessions using the same linked device, or two agents writing different versions of the same conversation can create duplicate replies, lost messages, and confusing state. Provider-specific sharding may support concurrency in some systems, but only after an explicit compatibility test.

The simplest high-availability pattern is a good managed service or an orchestrated deployment that already handles process replacement and state persistence. If your team operates its own host, start with fast restart, tested snapshots, external secrets, and a documented manual failover. Add an automated standby only when the measured recovery time misses the business target.

  • Fence the old owner before promoting a standby.
  • Use one authoritative persistent state path at a time.
  • Keep channel identities unique and documented.
  • Verify the model-provider path before declaring recovery complete.
  • Test duplicate-message behavior during the drill.

How do you test Hermes Agent failover safely?

Test failover with a scheduled synthetic message, not only a container health check. Measure detection, ownership transfer, state restoration, provider access, and one end-to-end reply for the exact channel.

Before the drill, record the normal restart command, the owner of the channel identity, the current image tag, the persistent-volume location, and the last verified backup. Announce a test window so duplicate replies or temporary silence are not mistaken for a production incident.

Run the drill in a controlled sequence. Stop the primary in a reversible way, confirm the standby does not begin consuming the same channel before the primary is fenced, move ownership, mount the expected state, and send one known message. Check that the reply arrives once, the transcript is preserved, scheduled work is not duplicated, and the provider path is recorded.

Measure the time from failure injection to the first successful reply. That is the actual recovery time, not the time shown by the deployment controller. After the test, return ownership deliberately, reconcile any state written by the standby, and record which steps required human judgment. A failover that works only when the original engineer is awake is not an availability guarantee.

What is a realistic minimum high-availability architecture?

A realistic minimum is one production runtime with durable state, encrypted external secrets, a tested backup, fast process replacement, end-to-end channel monitoring, and a documented active-passive recovery path.

This minimum does not promise zero downtime. It promises that a known failure has a practiced response and a measurable recovery target. For many teams, that is enough. A small business may prefer to accept a 30-minute recovery window rather than operate a second node and distributed state store.

Mature deployments add a warm standby, automated fencing, redundant network paths, and a control plane that verifies state before routing traffic. The extra components create new failure modes and require their own monitoring. Add them only when the expected cost of downtime exceeds the cost of operating and testing the redundancy.

Record the design as a decision, not a diagram alone: uptime target, maximum tolerable data loss, primary owner, standby owner, promotion command, channel-fencing method, provider fallback, verification message, and rollback path. Revisit the design after every incident and whenever the deployment moves between self-hosted and managed environments.

Which primary sources support this page?

Product behavior is checked against the current deployment flow. These external links provide the upstream project or channel documentation used for setup details.

Direct answers

Frequently asked questions

Does running two Hermes Agent containers create high availability?

No. The pair also needs one authoritative channel owner, shared or replicated state, fencing, health detection, and a tested promotion path. Two unfenced containers can create duplicate replies and split state.

Can Telegram, Discord, or WhatsApp sessions be cloned?

Do not assume they can be used concurrently. Each provider has different authentication and session behavior. Keep one authoritative consumer unless the provider explicitly supports safe concurrency, and test duplicate delivery before relying on it.

What recovery time should a small team target?

Choose the recovery time from the workflow. A business-hours assistant may accept minutes or hours, while a customer-support bot needs a shorter, monitored target. Measure the tested recovery, not the theoretical restart time.

Is managed hosting automatically highly available?

No. Managed hosting can remove server work, but availability still depends on the provider's runtime redundancy, channel recovery, data durability, support path, and maintenance behavior. Ask for the actual recovery model.

What is the first high-availability improvement to make?

Add a tested backup and restore path plus an end-to-end health check. A standby without recoverable state or a trustworthy availability signal does not improve the recovery outcome.

Key takeaways

  • High availability for Hermes Agent requires more than two running containers. The service needs a single owner for each messaging identity, durable access to memories and session state, a tested failover path, and a health signal that proves the agent can answer. Active-passive is the safest starting architecture for most Telegram, Discord, and WhatsApp deployments because it avoids two runtimes competing for the same bot token, linked device, or conversation state. Define the uptime target first, then calculate the recovery time objective, recovery point objective, and operational cost that the workflow can justify.
  • Start with one model, one channel, and one controlled test conversation.
  • Use managed hosting when deployment speed matters more than operating the server yourself.

Put Hermes Agent in the channel where the work already happens.