Communication Periphery
Summary
The Communication Periphery is the external interface layer of the Sokrates stack, responsible for managing multi-channel I/O (Slack, Microsoft Teams, WhatsApp, Telegram, Discord, Email) and translating platform-specific events into a unified format for the intelligence layer. It is currently implemented using Hermes Agent (developed by NousResearch), which replaced the legacy OpenClaw system and provides a maintained, battle-tested framework for enterprise messaging integrations.
Details
The Communication Periphery serves as the “nervous system” of the Sokrates project, decoupling the core reasoning engine (Hermes Agent) and the knowledge graph (Eidos) from the complexities of messaging platform APIs. Its primary role is to handle session management, message routing, and allowlist enforcement across various communication channels.
Current Implementation: Hermes Agent
The project currently utilizes Hermes Agent as the primary communication periphery framework. This decision represents a strategic shift from OpenClaw, driven by the need for a robust, well-maintained upstream framework that supports multiple channels out of the box and integrates seamlessly with NixOS via the nix-hermes module.
Technical specifics of the Hermes Agent integration include:
- NixOS Integration: Managed via the
hermes.nixmodule, which consumes thenix-hermesflake input. - Channel Support: Native integrations for Slack, Microsoft Teams, Telegram, Discord, WhatsApp, Email, and Signal.
- Security Model: Implements a five-layer security boundary including user authorization, command approval, MCP credential filtering, SSRF protection, and homograph/injection scanning via Tirith.
- Resource Footprint: Significantly more efficient than OpenClaw (Node.js-based), with optimized memory usage and a streamlined architecture built on Python and NixOS.
- Architecture: Hermes operates via long-polling for channel communication, eliminating the need for inbound ports (previously 3000/3001 for OpenClaw).
The architecture maintains a clear security boundary where the communication periphery handles channel credentials, while customer system credentials remain isolated within the reasoning layer’s encrypted secrets directory.
Migration from OpenClaw (Completed)
OpenClaw served as the initial communication gateway — a “month of plumbing” solution providing battle-tested integrations for Slack, Microsoft Teams, email, Discord, and WhatsApp. It was replaced by Hermes Agent due to significant constraints:
- Resource Usage: Node.js runtime contributed to container image size and 1.5-2.0 GB RAM overhead.
- Maintenance: As a third-party framework, it required ongoing maintenance and integration work.
- NixOS Integration: The
nix-openclawmodule had known constraints, including Issue #82 affecting Discord/WhatsApp plugin loading.
The migration was completed successfully (documented in Migration from OpenClaw to Hermes Agent) using the hermes claw migrate utility, which automated the transfer of configurations, identities, and operational data. OpenClaw has been fully removed from the stack.
Historical Evaluation of Alternatives
Prior to settling on Hermes Agent, the project evaluated several alternatives to address the resource and maintenance concerns around the original OpenClaw gateway:
- PicoClaw (Go): A high-performance, single-binary alternative (<10MB RAM). While it supports Slack and Discord, its lack of Microsoft Teams support was a deal-breaker for the Icelandic SME market.
- IronClaw (Rust): A security-maximalist option with WASM-sandboxed plugins. It was deemed too heavy, requiring a PostgreSQL/pgvector backend that would duplicate existing infrastructure.
- Nanobot (Python): A minimal Python-based agent framework. While it aligns with the stack’s primary language, its limited channel support would require significant manual integration work (estimated 1.5–2 weeks).
- Unified Python Periphery: A proposed future state where channel handling is absorbed directly into the FastAPI-based layer using
slack-boltandbotbuilder-python. This concept evolved into the Hermes Agent integration.