ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

Clawlancememory

Skill by asbinbin

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/asbinbin/clawlancememory
Or

🧠 OpenClaw LanceDB Memory System

基于 LanceDB 向量数据库的智能记忆系统,为 OpenClaw Agent 提供长期记忆和语义检索能力。

License Python LanceDB

✨ 特性

  • 🔍 语义检索 - 理解意思,不只是关键词匹配
  • 🧠 自动分类 - preference/fact/task/general 四种记忆类型
  • 🤖 自动抽取 - 从对话中自动识别重要信息
  • 💾 长期存储 - 持久化存储,跨 session 使用
  • 毫秒响应 - 向量检索,快速响应
  • 🔌 即插即用 - OpenClaw Hook 集成,自动加载

🚀 快速开始

1. 安装依赖

# 克隆仓库
git clone https://github.com/asbinbin/claw_lance.git
cd claw_lance

# 创建虚拟环境
python3 -m venv venv
source venv/bin/activate

# 安装依赖
pip install -r requirements.txt

2. 配置 API Key

# 获取智谱 AI API Key: https://open.bigmodel.cn/
export ZHIPU_API_KEY="your-api-key-here"

3. 启用 Hook

# 方法 1: 使用启用脚本
bash enable.sh

# 方法 2: OpenClaw 命令
openclaw hooks enable memory-system

4. 测试

# 查看用户画像
python3 skill.py profile

# 添加记忆
python3 skill.py add --content "我喜欢简洁" --type preference

# 检索记忆
python3 skill.py search --query "项目"

📚 文档

  • 安装指南
  • 使用手册
  • API 参考
  • Hook 集成
  • 常见问题

🎯 记忆类型

类型说明触发词例子
preference偏好、习惯我喜欢/我偏好/我习惯"我喜欢简洁的汇报风格"
fact事实、背景我是/我负责/我擅长"我负责 POC 项目"
task任务、待办我需要/别忘了/明天要"每周四提交 OKR 周报"
general其他-对话历史、临时信息

🔧 命令行使用

# 查看用户画像
python3 skill.py profile

# 检索记忆
python3 skill.py search --query "项目" --k 5

# 添加记忆
python3 skill.py add --content "我喜欢 Markdown" --type preference

# 自动抽取(从消息中识别记忆)
python3 skill.py auto --message "我负责 POC 项目,喜欢简洁的代码"

# 查看统计信息
python3 skill.py stats

# 清理过期记忆
python3 skill.py cleanup

💻 Python API

from skills.memory.openclaw_integration import OpenClawMemoryIntegration

# 初始化
mem = OpenClawMemoryIntegration(user_id="ou_xxx")

# 生成 system prompt(包含记忆)
prompt = mem.get_session_system_prompt("你是小美式")

# 检索记忆
results = mem.search_memory("项目", k=5)
for r in results:
    print(f"{r['type']}: {r['content']}")

# 添加记忆
mem.add_memory("我喜欢简洁", type="preference", importance=0.8)

# 获取用户画像
profile = mem.get_user_profile()
print(f"偏好:{profile['preferences']}")
print(f"事实:{profile['facts']}")
print(f"任务:{profile['tasks']}")

🏗️ 架构

Metadata

Author@asbinbin
Stars4473
Views0
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-asbinbin-clawlancememory": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.