← 返回 Skills 市场
348
总下载
0
收藏
3
当前安装
1
版本数
在 OpenClaw 中安装
/install ollama-memory
功能描述
本地向量记忆系统 - 基于 Ollama + SQLite 的 AI 助手记忆方案。 支持:Markdown 记录、向量搜索、本地嵌入、无 API 费用。 特点:本地部署、语义搜索、隐私优先。
使用说明 (SKILL.md)
本地向量记忆系统
这是一个带本地向量搜索的 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 "关键词"
会话启动流程
每次新会话开始时:
- 读取
SOUL.md— AI 人格 - 读取
USER.md— 用户信息 - 读取
memory/YYYY-MM-DD.md(今天 + 昨天) - 主会话:读取
MEMORY.md - 检查
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"
更新规则
必须更新的文件
- memory/YYYY-MM-DD.md - 每次会话
- MEMORY.md - 新教训/重要信息
- SOUL.md - 人格变化
- 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 to be what it says: a local Ollama + SQLite memory system. However: 1) SKILL.md references Python scripts at ~/.openclaw/workspace/scripts/memory-system/ but the skill bundle does not include those scripts — do not run the example commands until you have those scripts and have manually reviewed their contents. 2) Installing and running Ollama will download models (nomic-embed-text ~274MB) and start a local service — confirm you want that on your machine. 3) The system stores persistent files under ~/.openclaw/workspace (MEMORY.md, USER.md, daily notes) which can contain sensitive data; restrict filesystem permissions and back up or encrypt as needed. 4) Before running any commands from this SKILL.md, verify Ollama is installed from an official source (Homebrew or official website) and inspect any third-party scripts to ensure they do not send data to external endpoints. If you want greater assurance, ask the skill author for the referenced scripts or a packaged implementation so you can audit them first.
功能分析
Type: OpenClaw Skill
Name: ollama-memory
Version: 1.0.0
The skill bundle provides documentation and instructions for a local vector memory system using Ollama and SQLite. It defines a structured approach for an AI agent to manage long-term and short-term memories through Markdown files and local scripts (e.g., `context-memory.py`). The instructions in SKILL.md are aligned with the stated purpose of enhancing agent memory while emphasizing privacy and local storage, with no evidence of malicious intent, data exfiltration, or harmful prompt injections.
能力评估
Purpose & Capability
Name/description (local vector memory using Ollama + SQLite) matches the declared requirements: python3, sqlite3, and ollama. Requested binaries and described workflows (pull embedding model, run local server, use Python scripts to add/search) are consistent with the stated purpose.
Instruction Scope
SKILL.md instructs the agent to read and update files under ~/.openclaw/workspace (SOUL.md, USER.md, memory/*.md, MEMORY.md) and to run Python scripts in ~/.openclaw/workspace/scripts/memory-system/. Those file reads/writes are expected for a local memory system, but the skill does not include the referenced scripts — the instructions assume external code exists. Before executing, the user/agent should verify those scripts' presence and review them to ensure they do only the expected local operations (indexing/search) and do not transmit data externally.
Install Mechanism
No install spec in the skill (instruction-only). The README suggests installing Ollama via Homebrew and pulling the nomic-embed-text model through Ollama — both are standard, well-scoped steps. No downloads from unknown personal servers or extract/install steps are embedded in the skill text.
Credentials
The skill requests no environment variables or credentials. Its described behavior (local files, local model) does not require external secrets, so requested access is proportionate. Note: the system will read/write user data files under the home directory, which may contain sensitive info.
Persistence & Privilege
Skill is not always-enabled and is user-invocable (normal). It expects to write/read persistent files in ~/.openclaw/workspace (memory and profile files) — appropriate for a memory plugin but worth noting: persistent local storage will contain sensitive user data and should be protected (file permissions, backups).
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install ollama-memory - 安装完成后,直接呼叫该 Skill 的名称或使用
/ollama-memory触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- 首次发布本地向量记忆系统,基于 Ollama + SQLite 实现。
- 支持 Markdown 记录、向量语义搜索、本地 embedding,无 API 费用。
- 兼顾隐私与可读性,所有数据存储于本地,易于迁移和人工编辑。
- 提供每日记录、长期记忆、AI 人格等核心文件结构与自动化更新流程。
- 集成本地 Ollama embedding 模型和 Python 脚本,便捷添加与检索记忆。
元数据
常见问题
Ollama Memory 是什么?
本地向量记忆系统 - 基于 Ollama + SQLite 的 AI 助手记忆方案。 支持:Markdown 记录、向量搜索、本地嵌入、无 API 费用。 特点:本地部署、语义搜索、隐私优先。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 348 次。
如何安装 Ollama Memory?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install ollama-memory」即可一键安装,无需额外配置。
Ollama Memory 是免费的吗?
是的,Ollama Memory 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Ollama Memory 支持哪些平台?
Ollama Memory 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Ollama Memory?
由 kk.Tang(@kk-kingkong)开发并维护,当前版本 v1.0.0。
推荐 Skills