Setup multiple agents

Yes, that is the correct general idea, but you must change three specific things in the docker-compose.yml to avoid a "collision" between the two agents.

If you don't change these, Docker will give you an error because two things cannot use the same "space" at the same time.

The 3 things you must change for the second agent:

  1. The Container Name

Each container needs a unique name.

  • Agent 1: container_name: hermes-agent-1
  • Agent 2: container_name: hermes-agent-2

  • The Host Port

Only one app can "own" port 8642 on your Mac. You must pick a different number for the second agent.

  • Agent 1: "8642:8642"
  • Agent 2: "8643:8642" (Note: Only the first number changes)

  • The Internal Storage Volume

The named volume hermes_storage stores logs and session history. If both agents use the same one, they will overwrite each other's "memories."

  • Agent 1: hermes_storage_1
  • Agent 2: hermes_storage_2

Example docker-compose.yml for Agent #2:

Copy your files to a new folder (e.g., no2image) and modify the YAML like this:

services: hermes-agent-2: # 1. Unique service name build: . container_name: hermes-2 # 2. Unique container name ports: - "8643:8642" # 3. Unique HOST port (8643) environment: - TELEGRAM_BOT_TOKEN=YOUR_SECOND_BOT_TOKEN - TELEGRAM_ALLOWED_USERS=987654321 volumes: - ./config.yaml:/root/.config/hermes/config.yaml

  # It is OK to share these! Both agents will see the same files.
  - /Users/feng/workspace:/workspace
  - /Users/feng/Memory/memories/merged_skills:/opt/data/skills

  # 4. Unique internal storage volume
  - hermes_storage_2:/opt/data

extra_hosts:
  - "docker.internal:host-gateway"
restart: unless-stopped

volumes: hermes_storage_2: # 5. Must match the name used above

Is it okay to share the Workspace and Skills?

Yes, and it’s actually very useful.

  • Skills: If you write a new skill for "Agent 1," "Agent 2" will learn it automatically because they are looking at the same folder on your Mac.
  • Workspace: If "Agent 1" creates a Python script, "Agent 2" can see it and edit it.

Summary Checklist for Agent #2:

  1. New Folder: Create /Users/feng/ubuntuhermesdocker/no2image/.
  2. Copy Files: Copy Dockerfile and config.yaml (they can stay exactly the same).
  3. Edit YAML: Change the container_name, ports, environment, and volumes (as shown above).
  4. Launch: Run docker compose up -d inside the new folder.

You will now have two separate bots running on your Mac at the same time!