← Back to Skills Marketplace
kk-kingkong

Markdown Memory

by kk.Tang · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
304
Downloads
0
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install markdown-memory
Description
Markdown 文件记忆系统 - 带本地向量搜索的 AI 助手记忆方案。 支持:每日记录、长期记忆、会话记忆、Ollama 本地向量嵌入搜索。 特点:简单、人工可读、本地向量搜索(无 API 费用)。
README (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 "模型偏好"
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install markdown-memory
  3. After installation, invoke the skill by name or use /markdown-memory
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
新增本地向量搜索能力,提升记忆检索效果: - 集成 Ollama 本地向量嵌入(nomic-embed-text)支持高效语义搜索 - 记忆结构升级,配套 Python 脚本实现向量添加与搜索 - 依赖项新增:python3、sqlite3、ollama - 更新使用说明,提供本地向量检索、模型安装与脚本操作指南 - 优化本地化、安全性及语义相关搜索能力
v1.0.0
- 首发版本,提供基于 Markdown 的 AI 记忆方案。 - 支持每日记录、长期记忆、会话记忆自动加载。 - 全部数据本地存储,人工可读、无外部依赖。 - 明确的目录结构和核心文件:MEMORY.md、SOUL.md、USER.md、AGENTS.md。 - 附带常用搜索命令和安全管理规则。 - 易于迁移与手动编辑,满足轻量记忆需求。
Metadata
Slug markdown-memory
Version 1.0.1
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is Markdown Memory?

Markdown 文件记忆系统 - 带本地向量搜索的 AI 助手记忆方案。 支持:每日记录、长期记忆、会话记忆、Ollama 本地向量嵌入搜索。 特点:简单、人工可读、本地向量搜索(无 API 费用)。 It is an AI Agent Skill for Claude Code / OpenClaw, with 304 downloads so far.

How do I install Markdown Memory?

Run "/install markdown-memory" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Markdown Memory free?

Yes, Markdown Memory is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Markdown Memory support?

Markdown Memory is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Markdown Memory?

It is built and maintained by kk.Tang (@kk-kingkong); the current version is v1.0.1.

💬 Comments