微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🧠

AI 代理的持久记忆大脑

openclaw-memory · v127.0.0
入口已确认,内容待校验 文件树里有 SKILL.md,但正文还没采回,frontmatter 未核对。
专业技能 安全 A 级 作者 AtlasPA 公开目录收录
777 下载 346 安装 1.7k 收藏 16k 浏览

简介

OpenClaw 社区首个持久化记忆系统,基于 SQLite 本地存储与语义搜索,支持 x402 支付扩展,让 AI 代理跨会话记住用户偏好与上下文。

原始描述

Persistent, locally stored semantic memory for agents with automatic learning, searchable facts, and optional paid unlimited retention across all sessions.

通过你的 Agent 添加

安装目录:openclaw-memory/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/openclaw-memory/
Codex CLI~/.codex/skills/openclaw-memory/
DeepSeek Harness~/.agents/skills/openclaw-memory/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

OpenClaw Memory 是专为 OpenClaw 代理框架设计的持久化记忆系统,通过本地 SQLite 数据库存储用户交互中的关键信息。系统采用双模式架构:自动记忆提取与手动命令管理相结合。安装后,系统通过请求钩子自动识别并存储重要事实、用户偏好和对话模式;同时提供 CLI 工具集(claw memory search/list/stats/dashboard)供用户主动检索和管理记忆。核心工作流程包含五个环节:请求拦截、嵌入向量生成、本地存储、按需检索和配额管理。

技术实现上,系统使用 better-sqlite3 进行数据持久化,支持两种嵌入方案:OpenAI API(需用户配置密钥)或本地 @xenova/transformers 模型(完全离线)。语义搜索基于向量相似度计算,超越传统关键词匹配。Web 仪表盘(localhost:9091)提供可视化记忆浏览和时间线查看功能。

显著优点

真正的会话持久性解决了 LLM 代理的核心痛点——上下文遗忘。用户无需重复说明编码风格、项目背景或个人偏好,显著降低 token 消耗和交互摩擦。

隐私优先设计是突出亮点:所有数据本地存储于 ~/.openclaw/,无外部服务器通信,无遥测跟踪,开源可审计。相比云端记忆方案,用户拥有完全的数据主权。

经济模型创新引入 x402 支付协议,代理可自主评估并订阅 Pro tier(0.5 USDT/月),实现"代理经济"的闭环。Free tier 的 100 条记忆/7 天保留为轻度用户提供了零成本入门路径。

架构扩展性方面,该系统被设计为 OpenClaw 生态的基础设施,支撑未来的 Context Optimizer、Smart Router 等高级工具,具有平台级战略价值。

潜在缺点与局限性

MVP 支付功能存在明显短板:x402 链上验证尚未实现,当前仅校验交易哈希格式,存在被绕过的理论风险,不适合高安全性金融场景。

嵌入成本权衡:若选择 OpenAI 嵌入方案,需承担 API 调用成本和数据外传风险;若选择本地模型,则需下载较大体积的 transformer 模型文件,对带宽和磁盘有额外要求。

存储容量限制:Free tier 的 100 条记忆对于复杂项目可能迅速耗尽,自动修剪机制可能导致有价值信息的意外丢失。

生态锁定:深度绑定 OpenClaw 框架,无法直接迁移至其他代理平台,形成技术栈依赖。

适合的目标群体

  • OpenClaw 重度用户:需要长期维护复杂项目上下文的专业开发者
  • 隐私敏感型用户:拒绝云端记忆方案的企业和个人
  • AI 代理研究者:探索自主代理经济(agent economy)和 x402 支付协议的早期采用者
  • 效率优化追求者:希望通过减少重复上下文来降低 API 成本的用户

使用风险

性能风险:本地嵌入模型推理对 CPU 要求较高,大规模记忆库的语义搜索可能出现延迟;SQLite 在并发写入场景下存在锁竞争限制。

数据持久风险:虽为本地存储,但缺乏内置备份机制,磁盘故障或误操作可能导致记忆丢失;无加密层设计,物理设备丢失存在数据泄露风险。

依赖风险:better-sqlite3 包含原生 C++ 扩展,跨平台编译可能遇到 Node-gyp 构建问题;@xenova/transformers 模型下载依赖 HuggingFace 镜像可用性。

功能演进风险:作为社区项目(T3 来源),长期维护承诺不确定;x402 支付功能的完善时间表未明确。

技能正文


name: openclaw-memory user-invocable: true metadata: {"openclaw":{"emoji":"🧠","requires":{"bins":["node"]},"os":["darwin","linux","win32"]}}

OpenClaw Memory System

Persistent memory across sessions with semantic search and x402 payments.

What is it?

The first OpenClaw skill that gives your agents persistent memory - they remember facts, preferences, patterns, and conversation history across all sessions. Never repeat context again.

Key Features

  • 🧠 Persistent Memory - Remembers everything across sessions
  • 🔍 Semantic Search - Find memories by meaning, not just keywords
  • 🤖 Automatic Learning - Extracts facts and preferences automatically
  • 💾 Local Storage - SQLite database with vector embeddings
  • 💰 x402 Payments - Agents can pay for unlimited storage (0.5 USDT/month)

Free vs Pro Tier

Free Tier:

  • 100 memories maximum
  • 7-day retention
  • Basic semantic search

Pro Tier (0.5 USDT/month):

  • Unlimited memories
  • Permanent retention
  • Advanced semantic search
  • Memory relationship mapping

Installation

claw skill install openclaw-memory

Commands

# Search memories
claw memory search "What does user prefer?"

# List recent memories
claw memory list --limit=10

# Show stats
claw memory stats

# Open dashboard
claw memory dashboard

# Subscribe to Pro
claw memory subscribe

How It Works

  1. Hooks into requests - Automatically extracts important information
  2. Generates embeddings - Creates semantic vectors for search
  3. Stores locally - SQLite database with full privacy
  4. Retrieves on demand - Injects relevant memories before requests
  5. Manages quota - Prunes old memories when limits reached (Free tier)

Use Cases

  • Remember user preferences and coding style
  • Store project context and requirements
  • Learn patterns from repeated interactions
  • Maintain conversation history across sessions
  • Build knowledge base over time

Agent Economy

Agents can autonomously evaluate if Pro tier is worth it:

  • Cost: 0.5 USDT/month
  • Value: Saves tokens by eliminating context repetition
  • ROI: If persistent memory saves >0.5 USDT/month in tokens, it pays for itself

See AGENT-PAYMENTS.md for x402 integration details.

Privacy

  • All data stored locally in ~/.openclaw/openclaw-memory/
  • No external servers or telemetry
  • Embeddings can use local models (no API calls)
  • Open source - audit the code yourself

Dashboard

Access web UI at http://localhost:9091:

  • Browse and search memories
  • View memory timeline
  • Check quota and stats
  • Manage Pro subscription

Foundation for Future Tools

Memory System is the foundation for:

  • Context Optimizer - Uses memories to compress context
  • Smart Router - Learns routing patterns
  • Rate Limit Manager - Tracks usage patterns

Requirements

  • Node.js 18+
  • OpenClaw v2026.1.30+
  • OS: Windows, macOS, Linux

Links


Built by the OpenClaw community | First memory system with x402 payments

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

productivitydatabaseprivacyautomationdevelopment-engineeringapi

同类 Skill