Acontext

OpenClaw

Skill memory plugin for OpenClaw agents — auto-capture, auto-learn, native skill sync

The @acontext/openclaw plugin gives OpenClaw agents cross-session skill memory. It captures conversations, extracts tasks, distills reusable Markdown skills, and syncs them to OpenClaw's native skill directory for automatic loading.

Quick Start

Install the plugin

openclaw plugins install @acontext/openclaw

Set your API key

Get an API key from dash.acontext.io and export it:

export ACONTEXT_API_KEY=sk-ac-your-api-key

Configure openclaw.json

Add the Acontext plugin to your openclaw.json config:

// plugins.entries
"acontext": {
  "enabled": true,
  "config": {
    "apiKey": "${ACONTEXT_API_KEY}",
    "userId": "your-user-id"
  }
}

Start the gateway

openclaw gateway

Your agent now has skill memory. Every conversation is captured, tasks are extracted, and skills are distilled and synced to ~/.openclaw/skills/ for native loading.

How It Works

Session 1: User talks to agent
  └→ Messages stored to Acontext session (auto-capture)
  └→ CORE extracts structured tasks
  └→ Learning Space distills skills as Markdown

Session 2: User returns
  └→ Skills synced to ~/.openclaw/skills/ (native loading)
  └→ OpenClaw auto-loads skill files from its skill directory
  └→ New messages captured (auto-capture)
  └→ Skills updated (auto-learn)

The plugin hooks into two OpenClaw lifecycle events:

  • before_agent_start — Ensures learned skills are synced to ~/.openclaw/skills/ so OpenClaw can load them natively
  • agent_end — Stores conversation messages to Acontext, triggers task extraction, and conditionally triggers skill distillation

Configuration

KeyTypeDefaultDescription
apiKeystringRequired. Acontext API key (supports ${ACONTEXT_API_KEY})
baseUrlstringhttps://api.acontext.app/api/v1Acontext API base URL
userIdstring"default"Scope sessions per user
learningSpaceIdstringauto-createdExplicit Learning Space ID
skillsDirstring~/.openclaw/skillsDirectory where skills are synced for native loading
autoCapturebooleantrueStore messages after each turn
autoLearnbooleantrueTrigger skill distillation after sessions
minTurnsForLearnnumber4Minimum conversation turns before triggering auto-learn

For self-hosted Acontext, set baseUrl to your local API endpoint (e.g. http://localhost:8029/api/v1).

Agent Tools

The plugin registers three tools your agent can call explicitly during conversations:

ToolDescription
acontext_search_skillsSearch through learned skill files by keyword
acontext_session_historyGet task summaries from recent past sessions
acontext_learn_nowTrigger skill learning from the current session immediately

CLI Commands

# List all learned skills in the Learning Space
openclaw acontext skills

# Show memory statistics (sessions, tasks, skills)
openclaw acontext stats

Skill Sync

Skills are synced as Markdown files to OpenClaw's native skill directory (~/.openclaw/skills/ by default). OpenClaw auto-loads them — no prompt injection needed.

  • Incremental sync — Only changed skills are re-downloaded, using server-side updated_at timestamps
  • Sync triggers — On service start, before each agent turn (if stale), and after learning

Unlike plugins that inject context into prompts, Acontext syncs skills as files that OpenClaw loads natively. You can inspect, modify, and share these Markdown skill files directly in ~/.openclaw/skills/.

Next Steps

Last updated on

On this page