OpenClaw Build and Operations (1/5) — OpenClaw Anatomy: Components of a Single-User Agent

Pre-Migration Inventory Framework — Agents · Cron · LaunchAgent · Scripts · Skills · Memory Tiers


ํ•ต์‹ฌ ์š”์•ฝ

  • OpenClaw is a single-user agent system composed of multiple agents, schedulers/daemons, operational scripts, and skills.
  • Memory follows a 4-tier structure (Identity / Curated / Project / Episode), queried via oMLX bge-m3-mlx-fp16 embeddings with hybrid 0.7/0.3 + MMR + 30-day temporal decay.
  • This document defines an inventory framework for pre-migration or pre-redesign analysis, structured across seven layers: agent / scheduler / OS daemon / script groups / skills / memory tiers / routing.

Why Inventory Comes First

When migrating or redesigning an agent system into a different framework, the first task is not code porting — it is building a component inventory. Three reasons:

  1. Rhythm lives in the scheduler, not in the code. Omitting the cron/LaunchAgent list erases the rationale for why individual scripts exist.
  2. Persona count ≠ agent count. The number of agents reflects model routing and tool-permission splits, not the number of conversational interfaces. Without this distinction, the target system ends up with an over-engineered profile count.
  3. Memory tiers have different portability units. Identity / Curated / Project / Episode each carry distinct storage backends, update cycles, and write-authority rules. Tier-by-tier mapping is required to prevent data loss.

The following uses OpenClaw as a reference example. The same framework applies to any multi-agent system.

1. Agent Layer — One Conversational Interface + N Backend Workers

The only conversational interface is mir; all other agents are backend workers. Agents are split along two axes: model tier and tool permissions.

Representative split:

Role Group Model Tier (example) Responsibility
Conversational interface High-judgment LLM Sole user-facing entry point, routing
System monitor Local oMLX System state tracking
Research Lightweight LLM Web research, AutoSearch Deep
Writing Mid-tier LLM Content generation
Coding / orchestration Code-specialized LLM CLI, sub-agent / skill factory
Memory semantic judgment Mid-tier LLM Reflect decisions
Memory I/O Local oMLX bank/ file I/O
External integrations Lightweight LLM Google Workspace, messenger delivery, etc.

(Plus additional backend workers)

How it works: The persona exposed to the user is a single entity (mir). Behind it, tasks are distributed based on model tier, cost, and latency characteristics — local oMLX/Gemma for embedding and file I/O, gemini-2.5-flash for semantic judgment, gpt-5.4 high for high-judgment tasks.

2. Scheduler Layer — System Rhythm via Cron

Representative tasks by time resolution:

Frequency Task Type
Daily (early morning) Reflect — semantic consolidation
Hourly Memory micro-cycle — short-term memory cleanup
Daily (night) Self-review — behavior audit, daily-summary
Minute-level polling External source scan (research, communities)
Monthly Long-term memory review

(Plus additional scheduled tasks)

How it works: Cron is not a simple scheduler — it defines the agent's cognitive rhythm. Morning Reflect (semantic consolidation), hourly micro-cycle (short-term cleanup), nightly self-review (behavior audit), and monthly review (long-term pattern compression) each run at distinct time resolutions to prevent memory volatility. The migration question is: "which target system can preserve these four temporal cycles?"

3. OS Daemon Layer — macOS LaunchAgent

Processes that must persist at the OS level:

  • ai.openclaw.gateway — Gateway daemon (port 18789)
  • ai.openclaw.update-check — Auto-update daemon
  • com.openclaw.omlx / omlx-proxy — Local embedding model server
  • com.openclaw.daily-audit — 05:00 daily audit Phase A–E
  • com.claude-agent.watchdog / autostart — Session watchdog

Constraint: LaunchAgent is macOS-specific. Porting to Linux or a container target requires 1:1 replacement with systemd units or supervisord. Port binding (18789) and audit Phases A–E can be decoupled into an OS-independent layer.

4. Script Layer — Operational Scripts, Grouped by Function

Scripts belong to the following functional groups:

  • Memory pipeline: retain-extract/merge, recall-tree/match, confidence-decay, topics-validate/expand, user-pattern-stage.
  • Heartbeat: heartbeat-router/update/tick/health, proactive-exception-alerts.
  • Self-review: self-review-prescan/apply/fix, skill-candidate-stage.
  • Daily audit: docs-snapshot, release-check, agent-linter, config-drift, cron-analytics, session-audit.
  • External integrations: scrape.py (Scrapling + playwright), gws-wrapper, omlx-serve.

Portable patterns: confidence-decay and topics-validate/expand from the memory pipeline are self-contained units portable to any long-term memory system. The Heartbeat group approximates a standard pattern for distributed agent health monitoring.

5. Skill Layer — General-Purpose + System-Specific

  • General-purpose workflows: brainstorming, writing-plans, verification, deep-interview, code-review, testing, git-commit, project-doctor, self-audit.
  • OpenClaw-specific: oc-config, oc-agent, oc-channel, oc-skill, oc-memory, oc-doctor, oc-deploy, oc-backup.

Separation criterion: General-purpose skills are framework-agnostic and can be carried over verbatim. System-specific skills are coupled to the configuration schema and deployment paths of OpenClaw; they require rewriting against equivalent concepts in the target system.

6. Memory v0.6 — 4-Tier Structure

  • Identity: MEMORY.md (~600 tokens). Fixed identity and preferences. Lowest change frequency.
  • Curated: bank/ (world / experience / opinions / patterns / topics / index). Synthesized knowledge. Updated by Reflect.
  • Project: bank/entities/. Per-entity accumulation.
  • Episode: memory/ (daily logs). Raw source events.

Retrieval mechanism: oMLX bge-m3-mlx-fp16 embeddings + hybrid 0.7/0.3 (vector / keyword) + MMR + 30-day temporal decay. Reflect runs as a 6-phase pipeline; U-tag processing (user-relevance judgment) follows a 3-phase dialectic: observation → hypothesis → verification.

Migration perspective: Each tier has distinct storage cycles and write authority. Identity is manually managed; Curated is updated by Reflect (the semantic-judgment agent); Project is mixed; Episode is auto-appended. If the target system does not support this authority split per tier, consistency breaks.

7. Channel Routing Layer

  • One primary Discord channel carries all Reflect outputs and self-review results.
  • Telegram Forum with multiple topics: General / Server / Bot / Research / Memory / Heartbeat.

Design rationale: Discord handles a single high-density stream of judgment outputs; Telegram handles classified real-time events across multiple topics. The split is governed by a trade-off between event frequency and reading cost.

Two Structural Facts the Inventory Reveals

Completing the floor plan surfaces two structural facts.

First, memory · heartbeat · self-review are rhythm, not code. Cron/LaunchAgent defines the system's cognitive cycle. Whether the target container can preserve that cycle is the core portability criterion.

Second, agent count is not persona count. Of all agents, only one is the conversational interface; the rest are workers partitioned by model tier and tool permissions. Therefore, a target system can achieve equivalent functionality with fewer profiles.

Applicability and Open Questions

Applicable to: - Multi-agent systems being ported or redesigned into a different framework. - Audit and migration checklists for systems with a 2-tier or deeper memory hierarchy. - Rhythm-preserving design for long-running agents based on cron/LaunchAgent.

Open questions: - Where is the optimal boundary between Curated and Project in a 4-tier memory system? In entity-centric systems, the two tiers may be mergeable. - What is the sustainable upper bound for a single-persona + N-worker model? As the agent count grows, routing-decision cost likely increases super-linearly. - Does Reflect quality (semantic consolidation) hold when cron-based rhythm is replaced with an event-driven model?

The next post presents a 1:1 mapping of the above layers against Hermes built-in capabilities, across four categories: Replace / Partial Replace / Port As-Is / Deprecate.

Series overview: Series index

๋Œ“๊ธ€

์ด ๋ธ”๋กœ๊ทธ์˜ ์ธ๊ธฐ ๊ฒŒ์‹œ๋ฌผ

Agent Memory Engine (2/10) — Building an AI Agent Memory System with SQLite Alone

"ML Foundations (9/9) — PyTorch vs TensorFlow, and the Road to Local LLMs"

"RAG Core Study (14/26) — Evaluation Sets with RAGAS & DeepEval"

"ML Foundations (8/9) — Deep Learning Architectures: CNN, RNN, Attention"

"ML Foundations (7/9) — Deep Learning Training: Optimizers, Regularization, Initialization"

OpenClaw to Hermes Migration (2/13) — What to Preserve, Partially Port, or Discard

AI Agents I Built (5/7) — Building an Automated Blogger API Publishing System