OpenClaw Gateway (Historical)

STALE: OpenClaw has been replaced by Hermes Agent. The periphery/openclaw package was removed from the monorepo. This page preserves historical context. See Hermes Agent Framework and Migration from OpenClaw to Hermes Agent.

Summary

OpenClaw was the original channel I/O gateway for Sokrates — a Node.js-based message router bridging external messaging platforms with the intelligence layer. It ran as a NixOS systemd service (openclaw-gateway.service) with a companion workspace of identity/config files (SOUL.md, AGENTS.md, MEMORY.md) that defined the “Philosopher King” agent persona.

Details

Architecture

Originally a Docker container, later refactored to a native NixOS systemd service via nix-openclaw flake. Ran under a dedicated openclaw system user with no access to customer credentials.

  • Port 3000: HTTP API endpoint and health checks
  • Port 18789: Internal WebSocket for component communication
  • Routing: Forwarded messages to intelligence layer via http://localhost:8080
  • State dir: OPENCLAW_STATE_DIR=/var/lib/sokrates/periphery

Configuration

Dual-config strategy:

  1. System (/etc/openclaw/openclaw.json): Generated by NixOS module, static infrastructure settings
  2. Runtime (/var/lib/sokrates/periphery/.openclaw/openclaw.json): Dynamic state, tokens from openclaw doctor/openclaw config set

Secrets in /var/lib/sokrates/secrets/periphery/openclaw.env.

Supported Channels

Enterprise: Slack, Microsoft Teams, Mattermost. Consumer: WhatsApp, Telegram, Discord, Signal, iMessage. Legacy: Email (IMAP/SMTP), IRC, Matrix.

Why OpenClaw Was Chosen (and Later Replaced)

Selected over native Python SDKs (slack-bolt), Nanobot (HKU, lacked Teams), and Go-based alternatives for channel breadth and NixOS service hardening. Later replaced by Hermes Agent due to OpenClaw’s structural security vulnerabilities (CVE-2026-25253), “ambient authority” model, and the need for a more integrated agent framework with proper skill/memory/personality systems.

The Workspace (Predecessor to SOUL.md + AGENTS.md)

OpenClaw used markdown files to define agent identity:

  • SOUL.md: “Philosopher King” persona — Socratic questioning, proactive discovery
  • AGENTS.md: Behavioral policies, session protocols, security perimeter rules
  • MEMORY.md: Long-term knowledge from business plan distillation
  • USER.md: Primary user context
  • TOOLS.md: API URLs, ports, MCP configs
  • BOOT.md: Startup health checks

This workspace concept evolved into Hermes’s SOUL.md (instance-scoped identity at ~/.hermes/SOUL.md) and AGENTS.md (project-level context) system, with a cleaner separation of identity from project config.