Three-layer persistent memory system (Markdown + ChromaDB vectors + NetworkX knowledge graph) for long-term agent recall across sessions. One-command setup w...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install persistent-memory或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install persistent-memory⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/persistent-memory/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: persistent-memory version: 3.0.0 description: Three-layer persistent memory system (Markdown + ChromaDB vectors + NetworkX knowledge graph) for long-term agent recall across sessions. One-command setup with automatic OpenClaw integration. Use when the agent needs to remember decisions, facts, context, or institutional knowledge between sessions. ---
Adds persistent three-layer memory to any OpenClaw workspace. The agent gains semantic recall across sessions — decisions, facts, lessons, and institutional knowledge survive restarts.
| Layer | Technology | Purpose | |-------|-----------|---------| | L1: Markdown | MEMORY.md + daily logs + reference/ | Human-readable curated knowledge | | L2: Vector | ChromaDB + all-MiniLM-L6-v2 | Semantic search across all memories | | L3: Graph | NetworkX | Relationship traversal between concepts |
All three layers sync together. The indexer updates L2 and L3 from L1 automatically.
Problem: OpenClaw has its own built-in memory search system, but by default it only indexes MEMORY.md and memory/*.md files. Critical workspace files like SOUL.md (agent directives), AGENTS.md (behavior rules), and PROJECTS.md (active work) are ignored.
Impact: Agents can violate explicit directives because they're not found in memory searches. This causes operational failures where agents ignore their own rules.
Solution: The configure_openclaw.py script adds a memorySearch configuration block to OpenClaw that indexes all critical workspace files. This makes directive compliance automatic rather than optional.
One command from workspace root:
bash skills/persistent-memory/scripts/unified_setup.sh
This automatically:
No manual configuration needed. The script handles everything including OpenClaw integration that prevents agents from ignoring workspace directives (SOUL.md, AGENTS.md, etc.).
vector_memory/venv/bin/python vector_memory/indexer.py
The indexer parses MEMORY.md, reference/.md, and memory/.md into vector embeddings and rebuilds the knowledge graph. Run after every edit to keep layers in sync.
vector_memory/venv/bin/python vector_memory/search.py "your query"
Returns top-3 semantically similar chunks with source file and section.
vector_memory/venv/bin/python vector_memory/auto_retrieve.py --status
Reports sync health: MEMORY.md hash vs indexed state, chunk count, graph size. Use in heartbeats to detect drift.
Add these to AGENTS.md or SOUL.md:
Before answering questions about prior work, decisions, dates, people, or preferences — search memory first. Use memory_search or run auto_retrieve.py with the query. Never say "I don't remember" without checking.
CRITICAL: OpenClaw's built-in memory search should now automatically find directive files (SOUL.md, AGENTS.md) if configure_openclaw.py was run. If memory searches are not finding agent rules or workspace directives, the OpenClaw integration is missing or broken.
Before executing any action that references an external identifier (URL, handle, email, repo name, address) — query reference/ files for the exact value. If not found, query vector memory. If still not found, ask the user. Never fabricate identifiers.
After editing MEMORY.md or any file in reference/ or memory/ — re-index:
vector_memory/venv/bin/python vector_memory/indexer.py
Add to HEARTBEAT.md:
## Memory Sync Check
Run `vector_memory/venv/bin/python vector_memory/auto_retrieve.py --status` and if status is OUT_OF_SYNC, re-index with `vector_memory/venv/bin/python vector_memory/indexer.py`.
Create reference/ in the workspace root as the agent's institutional knowledge base:
reference/
├── people.md — Contacts, roles, communication details
├── repos.md — GitHub repositories, URLs, status
├── infrastructure.md — Hosts, IPs, ports, services
├── business.md — Company info, strategies, rules
└── properties.md — Domain-specific entities (deals, products, etc.)
These files are vector-indexed alongside MEMORY.md. The agent queries them before any action involving external identifiers. Facts accumulate over time — the agent that never forgets.
workspace/
├── MEMORY.md — Curated long-term memory (L1)
├── memory/
│ ├── 2026-02-17.md — Daily log
│ └── heartbeat-state.json — Sync tracking
├── reference/ — Institutional knowledge (optional)
│ ├── people.md
│ └── ...
└── vector_memory/
├── indexer.py — Index all markdown into vectors + graph
├── search.py — Semantic search CLI
├── graph.py — NetworkX knowledge graph
├── auto_retrieve.py — Status checker + auto-retrieval
├── chroma_db/ — Vector database (gitignored)
├── memory_graph.json — Knowledge graph (auto-generated)
└── venv/ — Python venv (gitignored)
source vector_memory/venv/bin/activatevector_memory/venv/bin/python vector_memory/indexer.pypython skills/persistent-memory/scripts/configure_openclaw.py to fix.openclaw config get | grep memorySearchopenclaw gateway restart安装 Persistent Memory 后,可以对 AI 说这些话来触发它
Help me get started with Persistent Memory
Explains what Persistent Memory does, walks through the setup, and runs a quick demo based on your current project
Use Persistent Memory to three-layer persistent memory system (Markdown + ChromaDB vectors +...
Invokes Persistent Memory with the right parameters and returns the result directly in the conversation
What can I do with Persistent Memory in my marketing & growth workflow?
Lists the top use cases for Persistent Memory, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/persistent-memory/ 目录(个人级,所有项目可用),或 .claude/skills/persistent-memory/(项目级)。重启 AI 客户端后,用 /persistent-memory 主动调用,或让 AI 根据上下文自动发现并使用。
Persistent Memory 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Persistent Memory 可免费安装使用。请查阅仓库了解许可证信息。
Three-layer persistent memory system (Markdown + ChromaDB vectors + NetworkX knowledge graph) for long-term agent recall across sessions. One-command setup w...
Persistent Memory 属于「Marketing & Growth」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my marketing & growth tasks using Persistent Memory
Identifies repetitive steps in your workflow and sets up Persistent Memory to handle them automatically