Local vector memory system with LanceDB + Pure JS embedding. No native modules or external APIs required.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install elite-longterm-memory-local或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install elite-longterm-memory-local⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/elite-longterm-memory-local/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: elite-longterm-memory-local version: 1.1.0 description: "Local vector memory system with LanceDB + Pure JS embedding. No native modules or external APIs required." author: Kimi Claw keywords: [memory, ai-agent, long-term-memory, vector-search, lancedb, pure-javascript, local-embedding, openclaw] metadata: openclaw: emoji: "🧠" requires: env: [] plugins: [] ---
基于 LanceDB + Pure JavaScript Embedding 的本地向量记忆系统,无需外部 API。
┌─────────────────────────────────────────────────────────────────┐
│ ELITE LONGTERM MEMORY │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ HOT RAM │ │ WARM STORE │ │ COLD STORE │ │
│ │ │ │ │ │ │ │
│ │ SESSION- │ │ LanceDB │ │ Git-Notes │ │
│ │ STATE.md │ │ Vectors │ │ Knowledge │ │
│ │ │ │ │ │ Graph │ │
│ │ (survives │ │ (semantic │ │ (permanent │ │
│ │ compaction)│ │ search) │ │ decisions) │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │ │ │
│ └────────────────┼────────────────┘ │
│ ▼ │
│ ┌─────────────┐ │
│ │ MEMORY.md │ ← Curated long-term │
│ │ + daily/ │ (human-readable) │
│ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
| 层级 | 文件/系统 | 用途 | 持久化 | |------|-----------|------|--------| | 1. Hot RAM | SESSION-STATE.md | 活跃任务上下文 | survived compaction | | 2. Warm Store | LanceDB Vectors | 语义搜索 | 自动召回 | | 3. Cold Store | Git-Notes | 结构化决策 | 永久保存 | | 4. Archive | MEMORY.md + daily/ | 人类可读 | 精选归档 | | 5. Embedding | Ollama | 本地向量模型 | 纯本地 |
# 确保 Ollama 已安装并运行
ollama --version
# 拉取向量模型
ollama pull nomic-embed-text
# 安装 Node 依赖
cd skills/elite-longterm-memory
npm install
node bin/init.js
这会创建:
SESSION-STATE.md — 热内存MEMORY.md — 长期记忆memory/ — 每日日志目录memory/vectors/ — LanceDB 数据库# 存储记忆
node bin/memory.js store "用户喜欢深色模式" --importance 0.9 --category preference
# 搜索记忆
node bin/memory.js search "用户界面偏好"
# 查看统计
node bin/memory.js stats
# 删除记忆
node bin/memory.js forget --query "深色模式"
在 ~/.openclaw/openclaw.json 中添加:
{
"plugins": {
"entries": {
"elite-longterm-memory": {
"enabled": true,
"config": {
"ollamaUrl": "http://localhost:11434",
"embeddingModel": "nomic-embed-text",
"dbPath": "./memory/vectors",
"autoRecall": true,
"autoCapture": false
}
}
}
}
}
启用后,OpenClaw 会自动提供以下工具:
memory_recall — 搜索相关记忆memory_store — 存储重要信息memory_forget — 删除记忆在 AGENTS.md 或 SOUL.md 中添加:
## 记忆协议
### 会话开始时
1. 读取 SESSION-STATE.md — 获取热上下文
2. 使用 memory_recall 搜索相关历史
3. 检查 memory/YYYY-MM-DD.md 了解近期活动
### 对话中
- 用户给出具体细节?→ 先写入 SESSION-STATE.md,再回复
- 重要决策?→ 使用 memory_store 存储
- 表达偏好?→ memory_store --importance 0.9 --category preference
### 会话结束时
1. 更新 SESSION-STATE.md 最终状态
2. 重要内容移至 MEMORY.md
3. 创建/更新 memory/YYYY-MM-DD.md
写前日志:先写状态,再回复。
| 触发条件 | 动作 | |----------|------| | 用户表达偏好 | 写入 SESSION-STATE.md → 然后回复 | | 用户做出决策 | 写入 SESSION-STATE.md → 然后回复 | | 用户给出期限 | 写入 SESSION-STATE.md → 然后回复 | | 用户纠正你 | 写入 SESSION-STATE.md → 然后回复 |
为什么? 如果先回复再保存,崩溃/压缩会导致上下文丢失。WAL 确保数据持久。
# 查看向量记忆统计
node bin/memory.js stats
# 搜索所有记忆
node bin/memory.js search "*" --limit 50
# 清理重复记忆
node bin/memory.js dedup
# 导出记忆
node bin/memory.js export --format json > memories.json
# 备份记忆
node bin/memory.js backup ./backups/memory-$(date +%Y%m%d).zip
Ollama 连接失败 → 检查 ollama serve 是否运行 → 检查 OLLAMA_HOST 环境变量
向量搜索无结果 → 检查 LanceDB 路径是否正确 → 确认已存储记忆:node bin/memory.js stats
内存占用过高 → 运行 node bin/memory.js compact 压缩向量 → 清理旧记忆:node bin/memory.js cleanup --before 30d
| 对比 | OpenAI API | Ollama 本地 | |------|------------|-------------| | 费用 | 按 token 收费 | 免费 | | 延迟 | 网络依赖 | 本地毫秒级 | | 隐私 | 数据出域 | 完全本地 | | 离线 | 不可用 | 可用 | | 质量 | text-embedding-3 | nomic-embed-text |
对于个人使用,nomic-embed-text 的质量足够,且完全免费。
vectordb)---
本地优先,隐私至上。
安装 Elite Longterm Memory 后,可以对 AI 说这些话来触发它
Help me get started with Elite Longterm Memory
Explains what Elite Longterm Memory does, walks through the setup, and runs a quick demo based on your current project
Use Elite Longterm Memory to local vector memory system with LanceDB + Pure JS embedding
Invokes Elite Longterm Memory with the right parameters and returns the result directly in the conversation
What can I do with Elite Longterm Memory in my ai agent & automation workflow?
Lists the top use cases for Elite Longterm Memory, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/elite-longterm-memory-local/ 目录(个人级,所有项目可用),或 .claude/skills/elite-longterm-memory-local/(项目级)。重启 AI 客户端后,用 /elite-longterm-memory-local 主动调用,或让 AI 根据上下文自动发现并使用。
Elite Longterm Memory 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Elite Longterm Memory 可免费安装使用。请查阅仓库了解许可证信息。
Local vector memory system with LanceDB + Pure JS embedding. No native modules or external APIs required.
Elite Longterm Memory 属于「AI Agent & Automation」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my ai agent & automation tasks using Elite Longterm Memory
Identifies repetitive steps in your workflow and sets up Elite Longterm Memory to handle them automatically