You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hermes currently requires one profile (and one gateway process) per agent. If you want a coding assistant, a CS bot, and a personal assistant — each with its own workspace, memory, and personality — you run three separate gateway processes. Each one eats memory, has its own event loop, and maintains separate platform connections.
OpenClaw solves this with a single daemon that hosts multiple agents, each with isolated workspaces and memory, routing messages by session key (including per-topic in groups). This issue proposes bringing a similar architecture to Hermes.
What OpenClaw Does
OpenClaw runs one Node.js Gateway daemon that owns all state and connections. Multiple agents live inside it:
Per-agent workspace: Each agent gets its own directory (~/.openclaw/agents/<id>/workspace/) with separate MEMORY.md, SOUL.md, daily logs, skills, and state files
Per-topic session keys: Session routing includes topic ID for Telegram forums: agent::<name>::<platform>::group::<id>::topic:<id>. Each topic in a group gets its own conversation context and memory
Shared daemon: One process, one set of platform connections (one Telegram bot token, one Discord bot), one event loop
Memory isolation: Agent A's memory is never visible to Agent B unless explicitly shared via sharedPaths
Resource efficiency: No duplicate event loops, no duplicate API connections, no per-process overhead
The key architectural insight: the Gateway is the only process that holds messaging sessions — exactly one Telegram session, one Discord session, etc. Agents are logical tenants inside the daemon, not separate processes.
Current State in Hermes
Profile system (hermes -p <name>):
Each profile gets its own ~/.hermes/profiles/<name>/ directory (config, memory, sessions, skills, cron, logs)
Each profile runs a separate gateway process
Each profile needs its own platform credentials (bot token, Discord token)
Profiles cannot share a single Telegram bot connection
What works well:
Complete isolation — profiles never interfere with each other
Simple mental model — one process per agent
Independent lifecycle — restart one agent without affecting others
Profile migration is straightforward (hermes profile migrate)
What's missing:
No way to run multiple agents behind one gateway process
No per-topic workspace/memory isolation within a single group
No way for one Telegram bot to serve different "personalities" in different topics
Running N agents = N gateway processes = N× memory overhead
Each agent needs its own platform credentials (can't share a bot token)
Proposed Architecture
Agent-as-Tenant Model
Instead of one profile = one process, introduce agents as tenants within a single gateway:
Extend session key resolution to include topic-level granularity with agent assignment:
Session key format:
telegram:topic:<chat_id>:<topic_id> → routes to agent X
telegram:group:<chat_id>:<user_id> → routes to agent Y
telegram:dm:<user_id> → routes to agent Z
Each topic in a Telegram forum group maps to a specific agent. That agent gets its own:
Overview
Hermes currently requires one profile (and one gateway process) per agent. If you want a coding assistant, a CS bot, and a personal assistant — each with its own workspace, memory, and personality — you run three separate gateway processes. Each one eats memory, has its own event loop, and maintains separate platform connections.
OpenClaw solves this with a single daemon that hosts multiple agents, each with isolated workspaces and memory, routing messages by session key (including per-topic in groups). This issue proposes bringing a similar architecture to Hermes.
What OpenClaw Does
OpenClaw runs one Node.js Gateway daemon that owns all state and connections. Multiple agents live inside it:
~/.openclaw/agents/<id>/workspace/) with separateMEMORY.md,SOUL.md, daily logs, skills, and state filesagent::<name>::<platform>::group::<id>::topic:<id>. Each topic in a group gets its own conversation context and memorysharedPathsThe key architectural insight: the Gateway is the only process that holds messaging sessions — exactly one Telegram session, one Discord session, etc. Agents are logical tenants inside the daemon, not separate processes.
Current State in Hermes
Profile system (
hermes -p <name>):~/.hermes/profiles/<name>/directory (config, memory, sessions, skills, cron, logs)What works well:
hermes profile migrate)What's missing:
Proposed Architecture
Agent-as-Tenant Model
Instead of one profile = one process, introduce agents as tenants within a single gateway:
Per-Topic Session Routing
Extend session key resolution to include topic-level granularity with agent assignment:
Each topic in a Telegram forum group maps to a specific agent. That agent gets its own:
Agent Routing Config
Workspace Isolation
Each agent tenant reads/writes to its own workspace directory:
profiles/<id>/config.yaml— agent-specific config (model, tools, skills)profiles/<id>/memories/MEMORY.md— agent-specific long-term memoryprofiles/<id>/skills/— agent-specific skillsprofiles/<id>/cron/— agent-specific scheduled jobsprofiles/<id>/state.db— agent-specific session databaseNo cross-agent memory leakage. An agent in topic 101 cannot see or write to the workspace of the agent in topic 201.
Implementation Phases
Phase 1: Multi-Agent Routing in Single Gateway
gateway/run.pyto load multiple agent definitions from configAIAgentinstance with isolated workspacePhase 2: Per-Topic Memory & Workspace
Phase 3: Shared Resources & Cross-Agent Communication
sharedPaths)Phase 4: Hot-Reload & Agent Lifecycle
Pros & Cons
Pros
Cons / Risks
Open Questions
state.dbor have separate databases? Separate is simpler and more isolated. Shared enables cross-agent session search.Related