MetaClaw

aiming-labMIT更新放缓

一个能持续学习和自我进化的智能体框架,通过对话就能让 Agent 在线微调、积累技能,不用重新训练模型。

🦞 Just talk to your agent — it learns and EVOLVES 🧬.

v0.4.1发布于 2026-04-11 20:04 UTC3,468star +1 / 7 天454fork同步于 2026-11-10 11:40 UTC

怎么上手

由 README 提炼,执行前请确认
pip install metaclaw
metaclaw setup
metaclaw start
硬件要求按 README 说明

README 明确说明无需 GPU 集群,可接入任意 OpenAI 兼容 LLM API;RL 训练走 Tinker 兼容的云端 LoRA 后端,也可切换 MinT、Weaver。具体显存与 GPU 型号未说明。

纯 CPU 可运行
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

把日常对话变成学习信号的智能体代理,边聊边进化,无需 GPU 集群

一个能持续学习和自我进化的智能体框架,通过对话就能让 Agent 在线微调、积累技能,不用重新训练模型。

核心能力

  • 代理拦截对话并在每轮注入相关技能
  • 会话结束后自动总结沉淀技能库
  • RL 训练调度到睡眠或空闲窗口执行
  • 跨会话持久化用户偏好与项目记忆
  • 兼容 OpenAI 与 Anthropic 双协议端点

容易踩的坑

RL 模式需额外配置 Tinker 等训练后端,只想用技能可选 skills_only 免后端;默认代理端口为 30000,手动接入时 base_url 要指向该端口;配置写在 ~/.metaclaw/config.yaml,由 setup 向导生成,改 claw_type 后需重启生效。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.4.1
  1. v0.4.1v0.4.1 — Incremental memory ingestion最新正式版2026-04-11 · 2026-04-11 20:04 UTC

    Highlights

    Incremental memory ingestion. The MetaClaw memory layer no longer waits until session end to extract and persist turns. Instead, turns are buffered and flushed every N turns (default 5), shrinking the mid-session blackout window and eliminating the O(N²) cost of
    re-sending full history on every agent turn.

    What's new

    Memory layer (metaclaw/memory/manager.py)

    • New buffer_turn(session_id, turn, scope_id=None) — buffers a single turn, auto-flushes when flush_every is reached.
    • New flush_session(session_id, scope_id=None, final=True) — flushes buffered turns; only emits the working-summary unit and clears
      per-session state when final=True.
    • ingest_session_turns refactored into shared helpers (_extract_turns_to_units, _build_working_summary_unit, _persist_units).
    • Per-session state persists across flush boundaries; absolute turn indices preserved via a turn_offset parameter.

    Config

    • metaclaw/config.py gains memory_flush_every (default 5).
    • Sidecar SidecarConfig forwards the same value.

    Sidecar HTTP (openclaw-metaclaw-memory/sidecar)

    • New POST /buffer_turn — returns {flushed, added}.
    • New POST /flush_session — returns {added}.
    • Proxy now routes /v1/memory/buffer_turn and /v1/memory/flush_session.

    OpenClaw plugin (openclaw-metaclaw-memory/src)

    • client.ts adds bufferTurn and flushSession.
    • types.ts adds BufferTurnResponse and FlushSessionResponse.
    • hooks/auto-capture.ts rewritten: tracks per-session turn count in a module-level Map, so agent_end only forwards the new delta via bufferTurn. session_end calls flushSession(final=true) and drops the tracker.

    Upgrade notes

    • No migration required — the legacy /ingest endpoint and ingest_session_turns API are unchanged.
    • To opt in from the plugin, rebuild openclaw-metaclaw-memory (npm run build) and redeploy.
    • Tune `memory_f
  2. v0.4.0v0.4.0 — Contexture Layer2026-03-25 · 2026-03-25 22:15 UTC
    查看更新说明

    What's New

    Contexture layer: MetaClaw now persists cross-session memory for users and projects. Relevant facts, preferences, and project history are automatically retrieved and injected into prompts. Includes adaptive memory policy, background consolidation, and an optional memory sidecar service.

  3. v0.3.3MetaClaw Plugin2026-03-23 · 2026-03-23 23:00 UTC
    查看更新说明

    One-Click Install

    Download the zip, extract, enable — MetaClaw environment is set up automatically.

    macOS / Linux

    curl -LO https://github.com/aiming-lab/MetaClaw/releases/download/v0.3.3/metaclaw-plugin.zip
    unzip metaclaw-plugin.zip -d ~/.openclaw/extensions/metaclaw-openclaw
    openclaw plugins enable metaclaw-openclaw
    openclaw gateway restart
    

    Windows (PowerShell)

    Invoke-WebRequest -Uri https://github.com/aiming-lab/MetaClaw/releases/download/v0.3.3/metaclaw-plugin.zip -OutFile metaclaw-plugin.zip
    Expand-Archive metaclaw-plugin.zip -DestinationPath $env:USERPROFILE\.openclaw\extensions\metaclaw-openclaw
    openclaw plugins enable metaclaw-openclaw
    openclaw gateway restart
    

    Then run

    metaclaw setup
    metaclaw start
    

    What the plugin does automatically

    • Creates an isolated Python virtual environment (.venv)
    • Installs MetaClaw ([rl,evolve,scheduler]) via pip
    • Installs metaclaw CLI wrapper and configures PATH (macOS / Linux / Windows)
    • Patches outbound LLM fetch to inject X-Session-Id / X-Turn-Type headers

    Requirements

    • Python ≥ 3.11
    • OpenClaw (any version)
    • macOS / Linux / Windows
    • RAM ≥ 4 GB recommended. On machines with ≤ 2 GB RAM, add swap before installing:
      sudo fallocate -l 4G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile
    

    Full auto mode (optional)

    openclaw config set plugins.entries.metaclaw-openclaw.config.oneClickMetaclaw true
    

    Enables: venv + pip + default config + metaclaw start on gateway load.

  4. v0.3.2v0.3.2 — Hermes Agent, Memory Plugin Fix, Configurable Context Window2026-03-23 · 2026-03-23 16:57 UTC
    查看更新说明

    What's New

    Hermes Agent support (claw_type: hermes)

    MetaClaw now auto-configures Hermes Agent on metaclaw start. It injects a metaclaw entry into ~/.hermes/config.yaml custom_providers and sets model.provider: custom:metaclaw. The gateway is restarted automatically.

    metaclaw config claw_type hermes
    metaclaw start
    

    Fix: OpenClaw memory plugins — rawMessage undefined (Hindsight, mem0, memory-lancedb)

    Memory plugins relying on the before_prompt_build hook (Hindsight, openclaw-mem0, memory-lancedb, and any custom plugin using the same pattern) now receive event.rawMessage correctly. MetaClaw now configures OpenClaw using the anthropic-messages API format, which is the path that populates all hook event fields. MetaClaw's /v1/messages Anthropic-compatible endpoint fully supports tool calls, streaming, and all other agent features — no functionality is lost.

    Configurable context window (removes hardcoded 20k / 32k caps)

    Two new config fields replace the previous hardcoded limits:

    FieldDefaultDescription
    max_context_tokens20000Prompt token cap before truncation. Set to 0 to disable truncation entirely. Recommended for skills_only mode with large-context cloud models (MiniMax M2.7, Kimi K2, etc.).
    context_window0 (auto)Context window advertised to OpenClaw (compaction threshold). 0 = auto: 200 000 in skills_only mode, 32 768 in rl/madmax mode. Set explicitly to match your model.
    # skills_only + large-context model — remove all artificial caps:
    metaclaw config max_context_tokens 0
    # context_window auto-resolves to 200000 in skills_only mode
    
    # explicit override for any mode:
    metaclaw config context_window 128000
    metaclaw config max_context_tokens 120000
    

    Previous release notes (v0.3.2 — 03/16/2026): Multi-claw support: IronClaw, PicoClaw, ZeroClaw, CoPaw, NanoClaw, and NemoClaw alongside OpenClaw. NanoClaw via /v1/messages Anthropic-compatible endpoint; NemoClaw via OpenShell inference routing. OpenRouter LLM platform support.

  5. v0.3.1v0.3.1 — MinT Backend Support2026-03-14 · 2026-03-14 03:15 UTC
    查看更新说明

    What's New

    • MinT backend support: RL training now works with both Tinker and MinT. Configurable via rl.backend (auto/tinker/mint).
    • Backend abstraction: New rl.backend, rl.api_key, and rl.base_url config keys. Legacy rl.tinker_api_key / rl.tinker_base_url still accepted.
    • Auto detection: rl.backend=auto (default) infers MinT from Mint-style credentials when the MinT package is installed.
    • Optional dependency: MinT compatibility via mindlab-toolkit, installed separately to keep the default package lightweight.

    Quick Start with MinT

    metaclaw config rl.backend mint
    metaclaw config rl.api_key sk-mint-...
    metaclaw config rl.base_url https://mint.macaron.xin/
    metaclaw config rl.model Qwen/Qwen3-4B-Instruct-2507
    metaclaw start
    

    Full Changelog: https://github.com/aiming-lab/MetaClaw/compare/v0.3.0...v0.3.1

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Just talk to your agent — it learns and EVOLVES.

    🇨🇳 中文 • 🇯🇵 日本語 • 🇰🇷 한국어 • 🇫🇷 Français • 🇩🇪 Deutsch • 🇪🇸 Español • 🇧🇷 Português • 🇷🇺 Русский • 🇮🇹 Italiano • 🇻🇳 Tiếng Việt • 🇦🇪 العربية • 🇮🇳 हिन्दी

    Overview • Quick Start • Multi-Claw Support • Configuration • Skills Mode • RL Mode • Auto Mode • Memory • Citation


    Two commands. That's it.

    metaclaw setup              # one-time config wizard
    metaclaw start              # default: auto mode — skills + scheduled RL training
    metaclaw start --mode rl    # RL without scheduler (trains immediately on full batch)
    metaclaw start --mode skills_only  # skills only, no RL (no Tinker needed)
    

    🔥 News

    • [04/11/2026] v0.4.1 — Incremental memory ingestion: the memory layer now extracts and persists turns every N turns (default 5) instead of only at session end, shrinking the mid-session memory blackout window.
    • [03/25/2026] v0.4.0 — Contexture layer: MetaClaw now persists cross-session memory for users and projects. Relevant facts, preferences, and project history are automatically retrieved and injected into prompts. Includes adaptive memory policy, background consolidation, and an optional memory sidecar service.
    • [03/24/2026] v0.3.3 — One-click OpenClaw plugin: MetaClaw now ships as a native OpenClaw extension — drop the folder into OpenClaw's extensions, run one command, and everything is set up automatically.
    • [03/18/2026] Our technical report "MetaClaw: Just Talk -- An Agent That Meta-Learns and Evolves in the Wild" is out! 🏆 Ranked No. 1 on HuggingFace Daily Papers! Check it out!
    • [03/16/2026] v0.3.2 — Multi-claw support: IronClaw, PicoClaw, ZeroClaw, CoPaw, NanoClaw, and NemoClaw now supported alongside OpenClaw. NanoClaw connected via new /v1/messages Anthropic-compatible endpoint; NemoClaw via OpenShell inference routing. Added OpenRouter as a supported LLM platform.
    • [03/13/2026] v0.3.1 — MinT backend support: RL training now works with both Tinker and MinT. Configurable via rl.backend (auto/tinker/mint).
    • [03/13/2026] v0.3 — Continual meta-learning support: slow RL updates now only run during sleep hours, idle time, or Google Calendar meetings. Added support/query set separation to prevent stale reward signals from polluting model updates.
    • [03/11/2026] v0.2 — One-click deployment via metaclaw CLI. Skills enabled by default, RL is now opt-in.
    • [03/09/2026] We release MetaClaw — Just talk to your agent and let it evolve automatically. NO GPU deployment required; just plug into the API.

    🎥 Demo

    https://github.com/user-attachments/assets/d86a41a8-4181-4e3a-af0e-dc453a6b8594


    📖 Overview

    MetaClaw is an agent that meta-learns and evolves in the wild. Just talk to your agent as you normally would — MetaClaw turns every live conversation into a learning signal, enabling the agent to continuously improve through real-world deployment rather than offline training alone.

    Under the hood, it places your model behind a proxy that intercepts interactions from your personal agent (OpenClaw, CoPaw, IronClaw, PicoClaw, ZeroClaw, NanoClaw, NemoClaw, or any OpenAI-compatible client), injects relevant skills at each turn, and meta-learns from accumulated experience. For Anthropic-native agents like NanoClaw, MetaClaw also exposes a /v1/messages Anthropic-compatible endpoint so the full pipeline works without any agent-side changes. Skills are summarized automatically after each session; with RL enabled, a meta-learning scheduler defers weight updates to idle windows so the agent is never interrupted during active use.

    No GPU cluster required. MetaClaw works with any OpenAI-compatible LLM API out of the box, and uses a Tinker-compatible backend for cloud-based LoRA training. Tinker is the default reference path; MinT and Weaver can be enabled through separate compatibility packages when needed.

    🤖 Key Features

    One-click deployment

    Configure once with metaclaw setup, then metaclaw start brings up the proxy, injects skills, and wires your chosen personal agent (OpenClaw, CoPaw, or IronClaw) automatically. No manual shell scripts needed.

    Three operating modes

    ModeDefaultWhat it does
    skills_onlyProxy your LLM API. Skills injected and auto-summarized after each session. No GPU/Tinker required.
    rlSkills + RL training (GRPO). Trains immediately when a batch is full. Optional OPD for teacher distillation.
    auto✅Skills + RL + smart scheduler. RL weight updates only run during sleep/idle/meeting windows.

    Long-term memory

    MetaClaw can persist facts, preferences, and project history across sessions and inject relevant context at each turn — so your agent remembers what you've told it, even weeks later.

    Asynchronous by design

    Serving, reward modeling, and training are fully decoupled. The agent continues responding while scoring and optimization run in parallel.


    🚀 Quick Start

    1. Install

    OpenClaw (one-click): use the v0.4.0 release—run the snippet below, then metaclaw setup and metaclaw start. More detail (Windows, mirrors, config, troubleshooting): extensions/metaclaw-openclaw/README.md.

    curl -LO https://github.com/aiming-lab/MetaClaw/releases/download/v0.4.0/metaclaw-plugin.zip
    unzip metaclaw-plugin.zip -d ~/.openclaw/extensions
    openclaw plugins enable metaclaw-openclaw && openclaw gateway restart
    

    pip (PyPI or this repo):

    pip install -e .                        # skills_only mode (lightweight)
    pip install -e ".[rl]"                  # + RL training support (torch, transformers, tinker)
    pip install -e ".[evolve]"              # + skill evolution via OpenAI-compatible LLM
    pip install -e ".[scheduler]"           # + Google Calendar integration for scheduler
    pip install -e ".[rl,evolve,scheduler]" # recommended for full RL + scheduler setup
    

    (Optional) WeChat integration uses the official @tencent-weixin/openclaw-weixin plugin. MetaClaw auto-installs it when WeChat is enabled:

    metaclaw config wechat.enabled true
    metaclaw start
    

    The plugin is installed automatically on metaclaw start. You can also install it manually:

    npx -y @tencent-weixin/openclaw-weixin-cli@latest install
    

    To switch WeChat accounts (re-login with a new QR code):

    metaclaw start --wechat-relogin
    

    If you want to run rl.backend=mint, install the MinT compatibility package separately in the same environment, for example mindlab-toolkit. Similarly, for rl.backend=weaver, install nex-weaver separately. MetaClaw keeps these dependencies out of the default package so RL users can choose Tinker, MinT, or Weaver explicitly.

    2. Configure

    metaclaw setup
    

    The interactive wizard will ask you to:

    1. Choose your personal agent — openclaw, copaw, ironclaw, picoclaw, zeroclaw, nanoclaw, nemoclaw, or none (MetaClaw will auto-configure it on start)
    2. Choose your auth method — api_key (direct API) or oauth_token (CLI subprocess)
    3. Choose your LLM provider:
      • api_key: Kimi, Qwen, OpenAI, Volcano Engine, or custom → enter API base + API key
      • oauth_token: Anthropic (Claude Code), OpenAI Codex, or Gemini CLI → paste OAuth token
    4. Enter your model ID and optionally enable RL training

    MetaClaw's RL path can switch explicitly between tinker, mint, and weaver. auto is the recommended default and will infer the backend from credentials, base URLs, or environment variables when the corresponding package is installed.

    Tinker:

    metaclaw config rl.backend tinker
    metaclaw config rl.api_key sk-...
    metaclaw config rl.model moonshotai/Kimi-K2.5
    

    MinT:

    metaclaw config rl.backend mint
    metaclaw config rl.api_key sk-mint-...
    metaclaw config rl.base_url https://mint.macaron.xin/
    metaclaw config rl.model Qwen/Qwen3-4B-Instruct-2507
    

    Weaver:

    metaclaw config rl.backend weaver
    metaclaw config rl.api_key sk-...
    metaclaw config rl.base_url https://weaver-console.nex-agi.cn
    metaclaw config rl.model Qwen/Qwen3-8B
    

    Legacy aliases rl.tinker_api_key and rl.tinker_base_url are still accepted for backward compatibility.

    3. Start

    metaclaw start
    

    That's it. MetaClaw starts the proxy, automatically configures your chosen personal agent to use it, and restarts the gateway. Open your agent and start chatting — skills are injected at every turn, and the session is automatically summarized into new skills when you're done.


    🦞 Multi-Claw Support

    MetaClaw works as a transparent proxy in front of any personal agent that supports an OpenAI-compatible LLM backend. The claw_type setting tells MetaClaw which agent to auto-configure when it starts.

    claw_typeAgentWhat MetaClaw does on start
    openclawOpenClawRuns openclaw config set models.providers.metaclaw … + gateway restart. Uses the anthropic-messages API format so memory plugins (Hindsight, mem0, memory-lancedb) receive event.rawMessage correctly.
    copawCoPawPatches ~/.copaw/config.json → models.default → openai_compatible pointing at the proxy port. CoPaw's ConfigWatcher hot-reloads automatically.
    ironclawIronClawPatches ~/.ironclaw/.env → LLM_BACKEND=openai_compatible + LLM_BASE_URL/MODEL/API_KEY. Runs ironclaw service restart.
    picoclawPicoClawInjects a metaclaw entry into ~/.picoclaw/config.json model_list and sets it as the default model. Runs picoclaw gateway restart.
    zeroclawZeroClawPatches ~/.zeroclaw/config.toml → provider = "openai-compatible" + base_url/model/api_key. Runs zeroclaw service restart.
    nanoclawNanoClawPatches nanoclaw's .env → ANTHROPIC_BASE_URL pointing at the proxy's /v1/messages Anthropic-compatible endpoint. Restarts via launchctl (macOS) or systemctl --user (Linux).
    nemoclawNemoClawRegisters a metaclaw provider in OpenShell via openshell provider create and sets it as the active inference route via openshell inference set. Persists config to ~/.nemoclaw/config.json.
    hermesHermes AgentInjects a metaclaw entry into ~/.hermes/config.yaml custom_providers and sets model.provider: custom:metaclaw. Runs hermes gateway restart.
    none—Skips auto-configuration. Point your agent at the proxy manually.

    Setup

    Pick your agent during metaclaw setup (the first question in the wizard):

    Personal agent to configure (openclaw/copaw/ironclaw/picoclaw/zeroclaw/nanoclaw/nemoclaw/hermes/none) [openclaw]:
    

    Or set it directly at any time:

    metaclaw config claw_type copaw      # switch to CoPaw
    metaclaw config claw_type ironclaw   # switch to IronClaw
    metaclaw config claw_type picoclaw   # switch to PicoClaw
    metaclaw config claw_type zeroclaw   # switch to ZeroClaw
    metaclaw config claw_type nanoclaw   # switch to NanoClaw
    metaclaw config claw_type nemoclaw   # switch to NemoClaw
    metaclaw config claw_type hermes     # switch to Hermes Agent
    metaclaw config claw_type none       # manual / custom agent
    

    Then run metaclaw start as usual — the proxy comes up and the chosen agent is wired automatically.

    Manual wiring (claw_type=none)

    Point any OpenAI-compatible client at the MetaClaw proxy:

    base_url: http://127.0.0.1:30000/v1
    api_key:  metaclaw          # or whatever proxy.api_key is set to
    model:    <your model id>
    

    For Anthropic-native clients (e.g. the Claude SDK or NanoClaw's credential proxy), use the Anthropic-compatible endpoint instead:

    ANTHROPIC_BASE_URL: http://127.0.0.1:30000
    ANTHROPIC_API_KEY:  metaclaw
    

    ⚙️ Configuration

    Configuration lives in ~/.metaclaw/config.yaml, created by metaclaw setup.

    CLI commands:

    metaclaw setup                  # Interactive first-time configuration wizard
    metaclaw start                  # Start MetaClaw (default: auto mode)
    metaclaw start --mode rl        # Force RL mode (no scheduler) for this session
    metaclaw start --mode skills_only  # Force skills-only mode for this session
    metaclaw stop                   # Stop a running MetaClaw instance
    metaclaw status                 # Check proxy health, running mode, and scheduler state
    metaclaw config show            # View current configuration
    metaclaw config KEY VALUE       # Set a config value
    metaclaw config llm.oauth_token TOKEN        # Store OAuth token for current CLI provider
    metaclaw auth paste-token --provider anthropic      # Store OAuth token (anthropic | openai-codex | gemini)
    metaclaw auth status                                # Show all stored auth profiles
    metaclaw uninstall              # Remove all MetaClaw data, OpenClaw extension, and pip package
    

    When you start MetaClaw, the command waits until the local proxy becomes healthy before returning. Use metaclaw status to verify readiness and metaclaw stop to stop the background process.

    mode: auto                 # "auto" | "rl" | "skills_only"
    claw_type: openclaw        # "openclaw" | "copaw" | "ironclaw" | "picoclaw" | "zeroclaw" | "nanoclaw" | "nemoclaw" | "hermes" | "none"
    
    llm:
      auth_method: api_key      # "api_key" | "oauth_token"
      provider: kimi            # kimi | qwen | openai | minimax | novita | openrouter | volcengine | custom
      model_id: moonshotai/Kimi-K2.5
      api_base: https://api.moonshot.cn/v1
      api_key: sk-...
      # oauth_token example (token stored via `metaclaw auth paste-token`):
      # auth_method: oauth_token
      # provider: anthropic     # anthropic | openai-codex | gemini
      # model_id: claude-sonnet-4-6
    
    proxy:
      port: 30000
      api_key: ""              # optional bearer token for the local MetaClaw proxy
    
    skills:
      enabled: true
      dir: ~/.metaclaw/skills   # your skill library
      retrieval_mode: template  # template | embedding
      top_k: 6
      task_specific_top_k: 10   # cap task-specific skills (default 10)
      auto_evolve: true         # auto-summarize skills after each session
    
    rl:
      enabled: false            # set to true to enable RL training
      backend: auto             # "auto" | "tinker" | "mint" | "weaver"
      model: moonshotai/Kimi-K2.5
      api_key: ""
      base_url: ""              # optional backend endpoint, e.g. https://mint.macaron.xin/ for MinT or https://weaver-console.nex-agi.cn for Weaver
      tinker_api_key: ""        # legacy alias for api_key
      tinker_base_url: ""       # legacy alias for base_url
      prm_url: https://api.openai.com/v1
      prm_model: gpt-5.2
      prm_api_key: ""
      lora_rank: 32
      batch_size: 4
      resume_from_ckpt: ""      # optional checkpoint path to resume training
      evolver_api_base: ""      # leave empty to reuse llm.api_base
      evolver_api_key: ""
      evolver_model: gpt-5.2
    
    opd:
      enabled: false            # set to true to enable OPD (teacher distillation)
      teacher_url: ""           # teacher model base URL (OpenAI-compatible /v1/completions)
      teacher_model: ""         # teacher model name (e.g., Qwen/Qwen3-32B)
      teacher_api_key: ""       # teacher model API key
      kl_penalty_coef: 1.0      # KL penalty coefficient for OPD
    
    max_context_tokens: 20000   # prompt token cap before truncation; 0 = no truncation (recommended
                                # for skills_only mode with large-context cloud models)
    context_window: 0           # context window advertised to the agent (e.g. OpenClaw compaction
                                # threshold); 0 = auto (200 000 in skills_only, 32 768 in rl/auto)
    
    scheduler:                  # v0.3: meta-learning scheduler (auto-enabled in auto mode)
      enabled: false            # auto mode enables this automatically; set manually for rl mode
      sleep_start: "23:00"
      sleep_end: "07:00"
      idle_threshold_minutes: 30
      min_window_minutes: 15
      calendar:
        enabled: false
        credentials_path: ""
        token_path: ""
    

    💪 Skills Mode

    metaclaw start --mode skills_only

    The lightest mode. No GPU, no RL backend needed. MetaClaw places your LLM behind a proxy that injects relevant skills at every turn, then auto-summarizes new skills after each conversation.

    For OpenAI-compatible custom providers, set llm.api_base to the full chat API base (usually ending in /v1, for example https://your-gateway.example/v1). In skills_only mode, MetaClaw reuses that same endpoint for prompt compression and related helper LLM calls unless you configure a separate evolver endpoint.

    Skills are short Markdown instructions stored in ~/.metaclaw/skills/ as individual SKILL.md files. The library grows automatically with your usage.

    To pre-load the built-in skill bank (40+ skills across coding, security, agentic tasks, etc.):

    cp -r memory_data/skills/* ~/.metaclaw/skills/
    

    🔬 RL Mode

    metaclaw start --mode rl

    Everything in Skills Mode, plus continuous RL fine-tuning from live conversations. Each conversation turn is tokenized and submitted as a training sample. A judge LLM (PRM) scores responses asynchronously, and a Tinker-compatible backend (Tinker cloud, MinT, or Weaver) runs LoRA fine-tuning with hot-swapped weights.

    Tinker:

    metaclaw config rl.backend tinker
    metaclaw config rl.api_key sk-...
    metaclaw config rl.model moonshotai/Kimi-K2.5
    metaclaw config rl.prm_url https://api.openai.com/v1
    metaclaw config rl.prm_api_key sk-...
    metaclaw start --mode rl
    

    MinT:

    metaclaw config rl.backend mint
    metaclaw config rl.api_key sk-mint-...
    metaclaw config rl.base_url https://mint.macaron.xin/
    metaclaw config rl.model Qwen/Qwen3-4B-Instruct-2507
    metaclaw config rl.prm_url https://api.openai.com/v1
    metaclaw config rl.prm_api_key sk-...
    metaclaw start --mode rl
    

    Weaver:

    metaclaw config rl.backend weaver
    metaclaw config rl.api_key sk-...
    metaclaw config rl.base_url https://weaver-console.nex-agi.cn
    metaclaw config rl.model Qwen/Qwen3-8B
    metaclaw config rl.prm_url https://api.openai.com/v1
    metaclaw config rl.prm_api_key sk-...
    metaclaw start --mode rl
    

    A dedicated evolver LLM also extracts new skills from failed episodes, feeding them back into the skill library.

    Programmatic rollout (no OpenClaw TUI needed): set openclaw_env_data_dir to a directory of JSONL task files:

    {"task_id": "task_1", "instruction": "Register the webhook at https://example.com/hook"}
    

    On-Policy Distillation (OPD)

    OPD is an optional add-on for RL Mode. It distills a larger teacher model into the student on-policy: the student generates responses as usual, and the teacher provides per-token log-probabilities on those same responses. A KL penalty steers the student toward the teacher's distribution.

    metaclaw config opd.enabled true
    metaclaw config opd.teacher_url http://localhost:8082/v1
    metaclaw config opd.teacher_model Qwen/Qwen3-32B
    metaclaw config opd.kl_penalty_coef 1.0
    

    The teacher must be served behind an OpenAI-compatible /v1/completions endpoint (e.g., vLLM, SGLang). OPD can be combined with PRM scoring, both run asynchronously. See examples/run_conversation_opd.py and scripts/run_openclaw_tinker_opd.sh.


    🧠 Auto Mode (Default)

    metaclaw start

    Everything in RL Mode, plus a meta-learning scheduler that defers weight updates to user-inactive windows so the agent is never interrupted during active use. This is the default mode.

    The RL weight hot-swap step pauses the agent for several minutes. Instead of training immediately when a batch is full (like RL Mode does), auto mode waits for an appropriate window.

    Three conditions trigger an update window (any one is sufficient):

    • Sleep hours: configurable start/end time (e.g., 23:00 to 07:00)
    • Keyboard inactivity: triggers after N minutes of idle time
    • Google Calendar events: detects meetings so updates can run while you're away
    metaclaw config scheduler.sleep_start "23:00"
    metaclaw config scheduler.sleep_end   "07:00"
    metaclaw config scheduler.idle_threshold_minutes 30
    
    # Optional: Google Calendar integration
    pip install -e ".[scheduler]"
    metaclaw config scheduler.calendar.enabled true
    metaclaw config scheduler.calendar.credentials_path ~/.metaclaw/client_secrets.json
    

    If the user returns mid-update, the partial batch is saved and resumed at the next window.

    Each ConversationSample is tagged with a skill_generation version. When skill evolution bumps the generation, the RL buffer is flushed so only post-evolution samples are used for gradient updates (MAML support/query set separation).


    🧠 Memory

    MetaClaw v0.4.0 adds a long-term memory layer that runs alongside skills. Where skills capture how to do things, memory captures what has happened — user preferences, project state, recurring context, and cross-session facts.

    How it works

    At the end of each session, MetaClaw extracts structured memory units from the conversation and stores them locally. On the next turn, relevant memories are retrieved and injected into the prompt alongside skills — so the agent knows what you've worked on before, without you having to repeat yourself.

    Memory runs entirely in the background. There is nothing new to configure for basic use; it activates automatically when memory.enabled is set to true.

    metaclaw config memory.enabled true
    

    Memory types

    TypeWhat it captures
    episodicSpecific past events and actions
    semanticGeneral facts about the user or project
    preferenceStated or inferred user preferences
    project_stateCurrent goals, open tasks, recent decisions
    working_summaryRolling summary of recent activity

    Configuration

    memory:
      enabled: false
      top_k: 5                       # memories injected per turn
      max_tokens: 800                # token budget for memory block
      retrieval_mode: hybrid         # keyword | semantic | hybrid
      consolidation_interval: 10     # consolidate every N sessions
      store_path: ~/.metaclaw/memory # local storage path
    

    Memory sidecar (optional)

    For deployments that require process isolation, MetaClaw ships with a standalone memory sidecar service (openclaw-metaclaw-memory). When configured, the main proxy delegates all memory reads and writes to the sidecar over a local HTTP API.

    metaclaw config memory.sidecar_url http://127.0.0.1:30001
    

    📊 Benchmark

    The MetaClaw-Bench evaluates how well AI agents learn and adapt from multi-day interaction histories. It ships two dataset variants (30-day full and 12-day small) with a CLI that covers the full pipeline — validation, inference, scoring, and reporting.

    See benchmark/README.md for setup and usage.


    🗑️ Uninstall

    metaclaw uninstall
    

    This removes everything in one step: stops the running instance, cleans MetaClaw references from ~/.openclaw/openclaw.json, deletes ~/.openclaw/extensions/metaclaw-openclaw/, deletes ~/.metaclaw/, uninstalls the pip package, and restarts the OpenClaw gateway. You will be prompted to confirm before anything is deleted.

    After uninstall, remove the source repo manually if you cloned it:

    rm -rf /path/to/MetaClaw
    

    📚 Citation

    @article{xia2026metaclaw,
      title={MetaClaw: Just Talk An Agent That Meta-Learns and Evolves in the Wild},
      author={Xia, Peng and Chen, Jianwen and Yang, Xinyu and Tu, Haoqin and Liu, Jiaqi and Xiong, Kaiwen and Han, Siwei and Qiu, Shi and Ji, Haonian and Zhou, Yuyin and Zheng, Zeyu and Xie, Cihang and Yao, Huaxiu},
      journal={arXiv preprint arXiv:2603.17187},
      year={2026}
    }
    

    🙏 Acknowledgements

    MetaClaw builds on top of the following open-source projects:

    • OpenClaw – the primary supported personal agent.
    • CoPaw – multi-channel personal agent support.
    • IronClaw – Rust-native personal agent support.
    • NanoClaw – container-isolated Anthropic-native personal agent.
    • NemoClaw – NVIDIA OpenShell-sandboxed personal agent with NIM inference.
    • SkillRL – our skill-augmented RL framework.
    • Tinker – used for online RL training.
    • MinT – alternative backend for online RL training.
    • Weaver – alternative backend for online RL training.
    • OpenClaw-RL – inspiration for our RL design.
    • awesome-openclaw-skills – provides the foundation for our skill bank.

    📄 License

    This project is licensed under the MIT License.