← 返回 Skills 市场
kk-kingkong

Markdown Memory

作者 kk.Tang · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
304
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install markdown-memory
功能描述
Markdown 文件记忆系统 - 带本地向量搜索的 AI 助手记忆方案。 支持:每日记录、长期记忆、会话记忆、Ollama 本地向量嵌入搜索。 特点:简单、人工可读、本地向量搜索(无 API 费用)。
使用说明 (SKILL.md)

Markdown 文件记忆系统

这是一个带本地向量搜索的 AI 助手记忆系统,基于 Markdown 文件 + SQLite 实现。

目录结构

~/.openclaw/workspace/
├── memory/
│   └── YYYY-MM-DD.md      # 每日记录
├── MEMORY.md               # 长期记忆(核心认知)
├── SOUL.md                 # AI 人格定义
├── USER.md                 # 用户信息
├── AGENTS.md               # 工作规范
└── scripts/memory-system/  # 记忆系统脚本

核心文件

1. memory/YYYY-MM-DD.md - 每日记录

每次会话记录当天发生的事:

# 2026-03-09

## 会话 1
- 主题:xxx
- 关键决策:xxx
- 待办:xxx

## 会话 2
- ...

2. MEMORY.md - 长期记忆

核心认知和重要信息,包含:

  • 核心工作原则
  • 用户偏好
  • 关键教训
  • 禁止事项
  • 习惯

向量搜索

使用本地 Ollama + nomic-embed-text 模型实现向量语义搜索。

安装 Ollama 和模型

# 安装 Ollama
brew install ollama

# 启动服务
ollama serve

# 下载 embedding 模型
ollama pull nomic-embed-text

搜索命令

# 使用 Python 脚本搜索(推荐)
python3 ~/.openclaw/workspace/scripts/memory-system/context-memory.py search "关键词"

# 简单搜索
python3 ~/.openclaw/workspace/scripts/memory-system/memory-py.py search "关键词"

会话启动流程

每次新会话开始时:

  1. 读取 SOUL.md — AI 人格
  2. 读取 USER.md — 用户信息
  3. 读取 memory/YYYY-MM-DD.md (今天 + 昨天)
  4. 主会话:读取 MEMORY.md
  5. 检查 knowledge/ 目录

保存记忆

当用户说"记住...":

  • 更新 memory/YYYY-MM-DD.md 记录
  • 重要内容同步到 MEMORY.md
  • 可选:存入向量数据库
# 添加记忆(带重要性评分)
python3 ~/.openclaw/workspace/scripts/memory-system/context-memory.py add "内容" 8

# 添加标签
python3 ~/.openclaw/workspace/scripts/memory-system/memory-py.py add "内容" "标签1,标签2"

更新规则

必须更新的文件

  1. memory/YYYY-MM-DD.md - 每次会话
  2. MEMORY.md - 新教训/重要信息
  3. SOUL.md - 人格变化
  4. USER.md - 用户偏好变化

更新时机

  • 任务完成时
  • 重要发现或教训
  • 用户偏好变化
  • 新技能学习

安全规则

  • 不暴露用户个人信息
  • ❌ 不在 skill 输出中包含真实姓名/账号/密码
  • ❌ 不在公开场合提及用户隐私
  • ✅ 需要时才读取 MEMORY.md
  • ✅ 主会话才加载 MEMORY.md

配置示例

在 AGENTS.md 中添加:

## Memory

### 每日记录 (memory/YYYY-MM-DD.md)
- 每次会话记录关键内容
- 格式:## 会话 X / ### 主题 / 决策 / 待办

### 长期记忆 (MEMORY.md)
- 核心原则和偏好
- 重要教训
- 禁止事项
- 仅主会话加载

### 向量搜索
- 模型:Ollama + nomic-embed-text
- 脚本:context-memory.py

优势

特点 说明
本地向量 无 API 费用,离线可用
语义搜索 理解相似含义,不只是关键词
可读 Markdown 人工可直接编辑
便携 文件复制即迁移
安全 本地存储,不上传云端

依赖

  • Ollama: 本地 LLM 运行时
  • nomic-embed-text: 本地 embedding 模型 (274MB)
  • Python 3: 运行脚本
  • SQLite: 向量存储

快速开始

# 1. 安装 Ollama
brew install ollama

# 2. 启动并下载模型
ollama serve
ollama pull nomic-embed-text

# 3. 初始化数据库
python3 ~/.openclaw/workspace/scripts/memory-system/context-memory.py init

# 4. 添加记忆
python3 ~/.openclaw/workspace/scripts/memory-system/context-memory.py add "用户偏好使用 Gemini" 8

# 5. 搜索记忆
python3 ~/.openclaw/workspace/scripts/memory-system/context-memory.py search "模型偏好"
安全使用建议
This skill appears coherent for a local Markdown + Ollama embedding memory helper, but it references Python scripts (context-memory.py, memory-py.py) that are not included. Before installing or running anything: (1) Ensure the scripts exist in ~/.openclaw/workspace/scripts/memory-system and inspect their source to confirm they only read/write the stated workspace files and do not exfiltrate data. (2) Be aware that pulling the nomic-embed-text model and running Ollama will download model data over the network — verify the origin is acceptable. (3) Keep sensitive personal data out of USER.md or other plaintext files if you do not want them accessible to local processes. (4) If you expect stronger isolation, run Ollama and any scripts in a sandboxed environment. If you want, provide the referenced script contents for a closer review.
功能分析
Type: OpenClaw Skill Name: markdown-memory Version: 1.0.1 The skill bundle describes a local-first memory management system for an AI agent using Markdown files and Ollama for vector embeddings. The instructions in SKILL.md are consistent with the stated purpose, emphasize user privacy (explicitly forbidding the exposure of personal information), and follow standard RAG (Retrieval-Augmented Generation) patterns without any evidence of malicious intent, data exfiltration, or harmful prompt injections.
能力评估
Purpose & Capability
Name/description describe a local Markdown + local vector search memory system. Declared required binaries (python3, sqlite3, ollama) and the use of the nomic-embed-text model are appropriate and expected for that purpose.
Instruction Scope
SKILL.md instructs the agent to read and update files under ~/.openclaw/workspace (memory/YYYY-MM-DD.md, MEMORY.md, SOUL.md, USER.md, knowledge/). That is consistent with a local-memory skill, but the skill references Python scripts (~/.openclaw/workspace/scripts/memory-system/*.py) which are not provided — the user/agent must supply or inspect those scripts. The instructions explicitly state privacy rules (do not expose personal data), which is appropriate.
Install Mechanism
This is instruction-only (no install spec). The SKILL.md suggests installing Ollama via brew and pulling a model; these are normal developer instructions and do not hide downloads from arbitrary URLs. No archives or untrusted installs are specified.
Credentials
No environment variables or credentials are requested. The requested binaries align with the described functionality and do not grant unexplained access to unrelated systems.
Persistence & Privilege
Skill is not always-enabled and does not request system-wide configuration changes. It relies on files in a workspace directory (local data) and local tools; no unusual persistence or elevated privileges are requested.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install markdown-memory
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /markdown-memory 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
新增本地向量搜索能力,提升记忆检索效果: - 集成 Ollama 本地向量嵌入(nomic-embed-text)支持高效语义搜索 - 记忆结构升级,配套 Python 脚本实现向量添加与搜索 - 依赖项新增:python3、sqlite3、ollama - 更新使用说明,提供本地向量检索、模型安装与脚本操作指南 - 优化本地化、安全性及语义相关搜索能力
v1.0.0
- 首发版本,提供基于 Markdown 的 AI 记忆方案。 - 支持每日记录、长期记忆、会话记忆自动加载。 - 全部数据本地存储,人工可读、无外部依赖。 - 明确的目录结构和核心文件:MEMORY.md、SOUL.md、USER.md、AGENTS.md。 - 附带常用搜索命令和安全管理规则。 - 易于迁移与手动编辑,满足轻量记忆需求。
元数据
Slug markdown-memory
版本 1.0.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 2
常见问题

Markdown Memory 是什么?

Markdown 文件记忆系统 - 带本地向量搜索的 AI 助手记忆方案。 支持:每日记录、长期记忆、会话记忆、Ollama 本地向量嵌入搜索。 特点:简单、人工可读、本地向量搜索(无 API 费用)。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 304 次。

如何安装 Markdown Memory?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install markdown-memory」即可一键安装,无需额外配置。

Markdown Memory 是免费的吗?

是的,Markdown Memory 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Markdown Memory 支持哪些平台?

Markdown Memory 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Markdown Memory?

由 kk.Tang(@kk-kingkong)开发并维护,当前版本 v1.0.1。

💬 留言讨论