Jakebot-ops

Persistent Memory

AI 智能体v3.0.0
作者:Jakebot-ops更新于 2026-05-17共 3 个版本 · 最新版本发布于 2026-02-20persistent-memory@clawhub_jakebot-ops/persistent-memory
上下文管理记忆增强#Memory System

据 AlphaMoat 统计,截至 2026-09,Persistent Memory 累计下载 2,919 次、获 0 个星标,在全部 5,078 个 AI 技能中排名第 3,790 位,在「AI 智能体」分类(969 个)中排名第 763 位。

累计安装
119
累计下载
2,919
星标
-
全站排名
#3,790
全站前 75% · 「AI 智能体」前 79%
平台累计安装累计下载星标评论
ClawHub ↗862,919--
SkillHub ↗1192,881-—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

把 Markdown 记忆文件作为来源,由索引器生成 ChromaDB 向量索引和 NetworkX 关系图;可检索记录、查看索引状态,并在编辑记忆文件后重新索引。按文档示例通过统一脚本安装和配置,依赖包括 ChromaDB、NetworkX 与 sentence-transformers。内置检索默认不覆盖所有工作区文件;按说明扩充配置并重新索引。

资料发布于 2026-10-26

可以用来做什么

  • 检索工作区记录并维护记忆索引

什么时候用

  • 希望为 OpenClaw 工作区增加跨会话检索时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

为当前工作区配置三层记忆,并说明需要索引哪些文件。

使用条件

依据技能文档中的声明整理,未经实际安装或运行验证。

配置要求
  • 编辑 MEMORY.md、reference 或 memory 文件后,按说明运行 indexer.py 更新索引。
  • 涉及外部标识符时先查 reference 文件或向量记忆;没有证据时不要猜。

月度数据趋势

累计下载2,919
9171,9923,0672026-03 · 累计下载 1,0652026-05 · 累计下载 1,9642026-06 · 累计下载 2,1912026-07 · 累计下载 2,5662026-08 · 累计下载 2,7652026-09 · 累计下载 2,91926-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-06 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-092,919—-
2026-082,765+7.8%-
2026-072,566+17.1%-
2026-062,191+11.6%-
2026-051,964—-
2026-031,065—-

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

6.9 KB · ClawHub v3.0.0
---
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.
---

# Persistent Memory

Adds persistent three-layer memory to any OpenClaw workspace. The agent gains semantic recall across sessions — decisions, facts, lessons, and institutional knowledge survive restarts.
展开全部(共 148 行)
## Architecture

| 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.

## ⚠️ Critical Integration: OpenClaw Memory Configuration

**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.

## Setup

**One command from workspace root:**

```bash
bash skills/persistent-memory/scripts/unified_setup.sh
```

This automatically:
- ✅ Creates 3-layer memory system (Markdown + Vector + Graph)
- ✅ Installs all Python dependencies (ChromaDB, NetworkX, sentence-transformers)
- ✅ Configures OpenClaw memorySearch integration (directive compliance)
- ✅ Indexes existing MEMORY.md if present
- ✅ Sets up daily maintenance automation

**No manual configuration needed.** The script handles everything including OpenClaw integration that prevents agents from ignoring workspace directives (SOUL.md, AGENTS.md, etc.).

## Daily Usage

### Writing Memories

- **MEMORY.md** — Curated long-term knowledge (decisions, architecture, lessons learned). Update after significant events.
- **memory/YYYY-MM-DD.md** — Daily logs. Raw notes of what happened each day.
- **reference/*.md** — Institutional facts (people, repos, infrastructure, business rules). The agent's encyclopedia.

### Indexing (after editing any memory file)

```bash
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.

### Searching

```bash
vector_memory/venv/bin/python vector_memory/search.py "your query"
```

Returns top-3 semantically similar chunks with source file and section.

### Sync Status Check

```bash
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.

## Agent Behavior Rules

Add these to AGENTS.md or SOUL.md:

### Pre-Response (mandatory)
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.

### Pre-Action (mandatory)
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.**

### Post-Edit (mandatory)
After editing MEMORY.md or any file in reference/ or memory/ — re-index:
```bash
vector_memory/venv/bin/python vector_memory/indexer.py
```

### Heartbeat Integration
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`.
```

## Reference Directory (Optional but Recommended)

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.

## File Structure After Setup

```
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)
```

## Troubleshooting

- **"No module named chromadb"** — Run setup.sh again or activate the venv: `source vector_memory/venv/bin/activate`
- **OUT_OF_SYNC status** — Run the indexer: `vector_memory/venv/bin/python vector_memory/indexer.py`
- **Empty search results** — Check that MEMORY.md has content and the indexer has been run at least once
- **SIGSEGV on indexing** — Usually caused by incompatible ML libs. The setup script pins known-good versions.
- **Agent ignoring SOUL.md/AGENTS.md directives** — OpenClaw integration missing. Run `python skills/persistent-memory/scripts/configure_openclaw.py` to fix.
- **Memory searches not finding workspace files** — Check OpenClaw configuration: `openclaw config get | grep memorySearch`
- **"Configuration verification failed"** — Restart OpenClaw manually: `openclaw gateway restart`

「AI 智能体」分类下的热门技能

self-improving agentAI 智能体

记录自身发现以实现自我改进的技能

↓ 129.0万★ 4,521pskoett
Find SkillsAI 智能体

帮助用户发现和安装智能体技能,当用户询问如「如何做X」、「找X的技能」、「有能做...的吗」等问题时

↓ 110.3万★ 1,778桂皮
Agent BrowserAI 智能体

给 AI agent 用的浏览器自动化命令行技能。

↓ 90.9万★ 991Nicolas Kleiber
Self-Improving + Proactive AgentAI 智能体

自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。

↓ 44.4万★ 1,606Iván
Skill VetterAI 智能体

在安装第三方技能之前,按清单审查来源、权限与危险模式的技能。

↓ 33.0万★ 1,323spclaudehome
ontologyAI 智能体

类型化知识图谱,用于结构化智能体记忆与可组合技能。适用于以下场景:创建/查询实体(人物、项目、任务、事件、文档)、关联相关对象、强制执行约束、将多步操作规划为图谱变换,或当技能需要共享状态时。触发关键词包括"记住""我知道关于什么""将X链接到Y""显示依赖关系"、实体增删改查操作,以及跨技能数据访问。

↓ 29.4万★ 788oswalpalash
Proactive AgentAI 智能体

将 AI 代理从任务执行者转变为能够预见需求、持续优化的主动伙伴。现已支持 WAL Protocol、Working Buffer、Autonomous Crons 及经过实战验证的模式。属于 Hal Stack 🦞。

↓ 28.8万★ 913halthelobster
Skill CreatorAI 智能体

创建有效技能指南。当用户希望创建新技能(或更新现有技能)以利用专业知识、工作流程或工具集成扩展 Claude 的能力时,应使用此技能。

↓ 23.8万★ 473chindden

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。