Skip to content

Multi-Machine Deployment Architecture

Production agents need dedicated hardware. Here's the architecture pattern.

Why Two Machines?

Problem Single Machine Two Machines
Browser automation crashes Takes down your agent Isolated on worker -- agent stays up
Video rendering pegs CPU Blocks all other tasks Offloaded to worker with FFmpeg
Social publishing failures Can't post anywhere Worker node runs Postiz independently
Memory pressure LLM + browser + video = OOM LLM on primary, everything else on worker

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    PRIMARY COMPUTE NODE                          โ”‚
โ”‚  OS: Linux ยท RAM: 128GB ยท GPU: NVIDIA                           โ”‚
โ”‚                                                                  โ”‚
โ”‚  Services:                                                       โ”‚
โ”‚  โ”œโ”€โ”€ Hermes Gateway (production instance)                        โ”‚
โ”‚  โ”œโ”€โ”€ Production crons (multi-category scheduling)                โ”‚
โ”‚  โ”œโ”€โ”€ Honcho MCP (peer memory)                                    โ”‚
โ”‚  โ”œโ”€โ”€ CorpusIQ MCP (business tool connectors)                     โ”‚
โ”‚  โ”œโ”€โ”€ GBrain (knowledge graph, vector search)                     โ”‚
โ”‚  โ”œโ”€โ”€ memcore-cloud (cross-session context)                       โ”‚
โ”‚  โ”œโ”€โ”€ Ollama (local embeddings, lightweight inference)            โ”‚
โ”‚  โ””โ”€โ”€ LLM provider (primary inference via API)                    โ”‚
โ”‚                                                                  โ”‚
โ”‚  Model Routing:                                                  โ”‚
โ”‚  โ”œโ”€โ”€ Lightweight: daily ops, monitoring                          โ”‚
โ”‚  โ”œโ”€โ”€ Mid-tier: research, content, coding                        โ”‚
โ”‚  โ””โ”€โ”€ Heavy: strategy, complex analysis                          โ”‚
โ”‚                                                                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
                    SSH (key-based auth)
                            โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  MAC MINI M4 (Worker)                             โ”‚
โ”‚  OS: macOS (ARM64) ยท RAM: 16GB                                   โ”‚
โ”‚                                                                  โ”‚
โ”‚  Services:                                                       โ”‚
โ”‚  โ”œโ”€โ”€ Postiz CLI (social publishing  --  X, LinkedIn, TikTok, IG)    โ”‚
โ”‚  โ”œโ”€โ”€ Playwright (browser automation, stealth)                    โ”‚
โ”‚  โ”œโ”€โ”€ FFmpeg (video post-production)                              โ”‚
โ”‚  โ”œโ”€โ”€ patchright (Cloudflare bypass)                              โ”‚
โ”‚  โ””โ”€โ”€ Instagram DM outreach (instagrapi)                          โ”‚
โ”‚                                                                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Primary Node Setup

1. Base Installation

# Hermes Agent
pip install hermes-agent

# Memory stack
pip install memcore-cloud
git clone https://github.com/garrytan/gbrain && cd gbrain && ./setup.sh

# MCP servers
hermes mcp add corpusiq -- url https://mcp2.corpusiq.io/mcp
hermes mcp add honcho -- npx mcp-remote https://mcp.honcho.dev

# Local inference (optional, for embeddings and lightweight tasks)
curl -fsSL https://ollama.com/install.sh | sh
ollama pull nomic-embed-text

2. Profile Setup

hermes profile create corpusiq
hermes config set model.default deepseek/deepseek-v4-pro
hermes config set model.fallback "openrouter/qwen/qwen3-235b-a22b:free,anthropic/claude-opus-4"

3. Gateway

# Start the gateway (background, auto-restart on crash)
hermes gateway run --replace

# Verify
hermes gateway status

Worker Node Setup

1. Base

# Hermes Agent (same version)
pip install hermes-agent

# Postiz (social publishing)
npm install -g postiz-cli
postiz auth

# Playwright (browser automation)
pip install playwright
playwright install chromium

# FFmpeg (video)
brew install ffmpeg

2. SSH Key Setup

# On primary node
ssh-keygen -t ed25519 -f ~/.ssh/worker-key
ssh-copy-id -i ~/.ssh/worker-key.pub user@worker-node.local

# Test
ssh user@worker-node.local "echo connected"

3. Worker Scripts

# Deploy video pipeline workers
scp ~/worker/videos/* user@worker-node.local:~/worker/videos/

# Deploy Postiz scripts
scp ~/worker/social/* user@worker-node.local:~/worker/social/

Orchestration Patterns

Pattern 1: Video Pipeline

# On primary node:
# 1. Generate video with HeyGen API
python3 heygen-video-generator.py

# 2. Post-produce with FFmpeg
ffmpeg -i input.mp4 -vf "zoompan=..." -c:a copy output.mp4

# 3. Transfer to worker
scp output.mp4 user@worker-node.local:~/worker/videos/

# 4. Publish via Postiz (on worker)
ssh user@worker-node.local "postiz upload ~/worker/videos/output.mp4 && postiz posts:create --platform tiktok --video output.mp4"

Pattern 2: Social Publishing

# On primary node (or via cron):
ssh user@worker-node.local "postiz posts:create \
  --platform x \
  --connector cmpoar9y201icl70y7iof708s \
  --content 'Your post text here'"

Pattern 3: Browser Automation

# On worker (via SSH from primary):
ssh user@worker-node.local "python3 ~/worker/browser/task.py"

Model Routing Strategy

Not every task needs Claude Opus. Here's how we route:

# Intelligent model switching based on task complexity

def route_model(task):
    if task.type == "lightweight":
        return "openrouter/qwen/qwen3-235b-a22b:free"  # ~$0.001

    if task.type == "embedding":
        return "ollama/nomic-embed-text"  # Free, local

    if task.type in ("research", "content", "coding", "social"):
        return "deepseek/deepseek-v4-pro"  # ~$0.01/task

    if task.type in ("strategy", "architecture", "contracts"):
        return "anthropic/claude-opus-4"  # ~$0.05/task

Cost savings: ~65% vs running everything on Claude Opus.


Monitoring

Health Check (10 PM daily)

# On primary node
hermes cron list | grep -c "active"
hermes mcp test corpusiq
hermes mcp test honcho

# On worker
ssh user@worker-node.local "postiz list"
ssh user@worker-node.local "pgrep -f playwright"

Disk & Memory

# On both nodes
df -h /
free -h  # Linux
vm_stat  # macOS

Recovery Procedures

Gateway Crash

# Check if running
hermes gateway status

# Restart
hermes gateway run --replace

# Check logs
journalctl --user -u hermes-gateway -n 100

Worker Node Unreachable

# Ping test
ping worker-node.local

# If down: Postiz and browser automation will queue
# Crons will skip with error โ†’ retry on next tick

OAuth Token Expired

# Gmail
python3 refresh_gmail_token.py

# GitHub (classic PAT  --  never expires)
# Verify: curl -H "Authorization: token $(cat secrets/github.token)" https://api.github.com/user

Lessons Learned

  1. Browser automation is fragile -- offload it. Playwright crashes shouldn't take down your agent.
  2. Key-based SSH is mandatory -- password auth fails silently in cron environments.
  3. Postiz on worker is stable -- better than running social publishing directly from the agent.
  4. Model routing saves real money -- ~65% savings compounds at 24/7 operation.
  5. Monitor both machines -- the health check must verify the worker node too.
  6. Keep Hermes versions synced -- primary and worker nodes must run the same version.

*


This Hermes repo is one of the largest structured collections of public AI, automation, business, and technology documentation. Content remains attributed to original authors and repositories. Indexed and organized by www.CorpusIQ.io.

All Pages