Search

PythonReactSEOPDF
OpenClaw

Pidan Memory

Pidan Memory Skill

28302015340 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install 2830201534/pidan-memory

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

Pidan Memory Skill

本地持久化向量记忆系统,为 AI Assistant 提供长期记忆能力。支持多用户/共享模式。

概述

基于 LanceDB + Ollama 实现的本地向量记忆系统,支持语义搜索和多用户隔离。

架构

用户输入 → Ollama (向量化) → LanceDB (存储/搜索)
                    ↑
              nomic-embed-text (768维向量)

功能

1. 自动记忆(推荐)

安装 Hook 后自动生效,无需手动调用!

每次对话后自动评估并存储重要信息,覆盖 16 大类场景。

安装方式:

# 1. 复制文件
mkdir -p ~/.openclaw/hooks/pidan-memory
cp HOOK.md handler.ts ~/.openclaw/hooks/pidan-memory/
cp auto_memory.py ~/.openclaw/workspace/memory/

# 2. 启用
openclaw hooks enable pidan-memory
openclaw gateway restart
2. 记住信息 (remember)

手动存储重要信息到向量数据库

参数:

  • content: 记忆内容 (必填)
  • summary: 摘要 (可选)
  • importance: 重要程度 1-5 (默认 3)
  • user_id: 用户 ID (默认 default)

示例:

{
  "command": "remember",
  "parameters": {
    "content": "用户最喜欢吃火锅",
    "summary": "饮食偏好",
    "importance": 4,
    "user_id": "default"
  }
}
3. 搜索记忆 (recall)

语义向量搜索

参数:

  • query: 搜索关键词
  • limit: 返回数量 (默认 5)
  • user_id: 用户 ID
4. 获取最近记忆 (recent_memories)

获取用户的有权限访问的记忆

5. 模式管理
获取当前模式 (get_mode)
{
  "command": "get_mode",
  "parameters": {}
}
设置模式 (set_mode)
{
  "command": "set_mode",
  "parameters": {
    "mode": "private"  // 或 "shared"
  }
}

模式说明:

  • private: 多用户模式(默认),每个用户记忆独立隔离
  • shared: 共享模式,所有用户可互相查询共享记忆
6. 删除记忆 (delete_memory)

删除记忆(需二次确认,只有创建人可删除)

参数:

  • memory_id: 记忆 ID (必填)
  • confirm: 是否确认删除 (默认 false)

首次请求(获取确认):

{
  "command": "delete_memory",
  "parameters": {
    "memory_id": "uuid-xxx",
    "confirm": false
  }
}

确认删除:

{
  "command": "delete_memory",
  "parameters":...

Source information

Source
github
Repository
openclaw/skills
Path
skills/2830201534/pidan-memory
Version
—
Commit
166c5fc560eda01e9ca5cbce1d55febf7f07ef2c
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

README

🧠 Pidan Memory

本地持久化向量记忆系统,为 AI Assistant 提供长期记忆能力。

简体中文 | English

✨ 特性

  • 📦 向量存储 - 基于 LanceDB + Ollama,本地向量语义搜索
  • 🔄 自动记忆 - 每次对话自动评估存储(需安装 Hook)
  • 👥 多用户/共享模式 - 支持私有隔离和共享模式切换
  • 🧹 自动去重 - 每 20 条自动触发去重
  • 🔐 安全删除 - 只有创建人可删除,需二次确认
  • 🔍 语义搜索 - 支持自然语言查询

快速开始

1. 安装
# 方式一:ClawHub 安装(推荐)
clawhub install pidan-memory

# 方式二:手动安装
cd ~/.openclaw/workspace/skills
git clone https://github.com/your-repo/pidan-memory.git
2. 启动 Ollama
# 启动 Ollama 服务
ollama serve

# 下载 embedding 模型(首次)
ollama pull nomic-embed-text
3. 安装 Hook(启用自动记忆)
# 复制 Hook 文件
mkdir -p ~/.openclaw/hooks/pidan-memory
cp HOOK.md handler.ts ~/.openclaw/hooks/pidan-memory/
cp auto_memory.py ~/.openclaw/workspace/memory/

# 启用 Hook
openclaw hooks enable pidan-memory

# 重启 Gateway
openclaw gateway restart

使用方法

自动记忆(推荐)

安装 Hook 后,每次对话自动评估并存储。覆盖 16 大类场景。

模式管理
# 获取当前模式
echo '{"command": "get_mode", "parameters": {}}' | python3 run.py

# 切换到共享模式
echo '{"command": "set_mode", "parameters": {"mode": "shared"}}' | python3 run.py

# 切换回私有模式
echo '{"command": "set_mode", "parameters": {"mode": "private"}}' | python3 run.py

模式说明:

  • private (默认): 多用户模式,记忆隔离
  • shared: 共享模式,所有用户可互相查询
其他命令
# 记住信息
echo '{"command": "remember", "parameters": {"content": "用户最喜欢吃火锅", "importance": 4}}' | python3 run.py

# 搜索记忆
echo '{"command": "recall", "parameters": {"query": "饮食偏好"}}' | python3 run.py

# 查看最近记忆
echo '{"command": "recent_memories", "parameters": {"limit": 10}}' | python3 run.py

# 删除记忆(首次请求,确认)
echo '{"command": "delete_memory", "parameters": {"memory_id"...

Extracted content

SKILL.md
# Pidan Memory Skill

本地持久化向量记忆系统,为 AI Assistant 提供长期记忆能力。支持多用户/共享模式。

## 概述

基于 **LanceDB + Ollama** 实现的本地向量记忆系统,支持语义搜索和多用户隔离。

## 架构

```
用户输入 → Ollama (向量化) → LanceDB (存储/搜索)
                    ↑
              nomic-embed-text (768维向量)
```

## 功能

### 1. 自动记忆(推荐)

**安装 Hook 后自动生效,无需手动调用!**

每次对话后自动评估并存储重要信息,覆盖 16 大类场景。

**安装方式:**
```bash
# 1. 复制文件
mkdir -p ~/.openclaw/hooks/pidan-memory
cp HOOK.md handler.ts ~/.openclaw/hooks/pidan-memory/
cp auto_memory.py ~/.openclaw/workspace/memory/

# 2. 启用
openclaw hooks enable pidan-memory
openclaw gateway restart
```

### 2. 记住信息 (remember)

手动存储重要信息到向量数据库

**参数:**
- `content`: 记忆内容 (必填)
- `summary`: 摘要 (可选)
- `importance`: 重要程度 1-5 (默认 3)
- `user_id`: 用户 ID (默认 default)

**示例:**
```json
{
  "command": "remember",
  "parameters": {
    "content": "用户最喜欢吃火锅",
    "summary": "饮食偏好",
    "importance": 4,
    "user_id": "default"
  }
}
```

### 3. 搜索记忆 (recall)

语义向量搜索

**参数:**
- `query`: 搜索关键词
- `limit`: 返回数量 (默认 5)
- `user_id`: 用户 ID

### 4. 获取最近记忆 (recent_memories)

获取用户的有权限访问的记忆

### 5. 模式管理

#### 获取当前模式 (get_mode)
```json
{
  "command": "get_mode",
  "parameters": {}
}
```

#### 设置模式 (set_mode)
```json
{
  "command": "set_mode",
  "parameters": {
    "mode": "private"  // 或 "shared"
  }
}
```

**模式说明:**
- `private`: 多用户模式(默认),每个用户记忆独立隔离
- `shared`: 共享模式,所有用户可互相查询共享记忆

### 6. 删除记忆 (delete_memory)

删除记忆(需二次确认,只有创建人可删除)

**参数:**
- `memory_id`: 记忆 ID (必填)
- `confirm`: 是否确认删除 (默认 false)

**首次请求(获取确认):**
```json
{
  "command": "delete_memory",
  "parameters": {
    "memory_id": "uuid-xxx",
    "confirm": false
  }
}
```

**确认删除:**
```json
{
  "command": "delete_memory",
  "parameters":...
README
# 🧠 Pidan Memory

本地持久化向量记忆系统,为 AI Assistant 提供长期记忆能力。

[简体中文](./README.md) | [English](./README_EN.md)

## ✨ 特性

- 📦 **向量存储** - 基于 LanceDB + Ollama,本地向量语义搜索
- 🔄 **自动记忆** - 每次对话自动评估存储(需安装 Hook)
- 👥 **多用户/共享模式** - 支持私有隔离和共享模式切换
- 🧹 **自动去重** - 每 20 条自动触发去重
- 🔐 **安全删除** - 只有创建人可删除,需二次确认
- 🔍 **语义搜索** - 支持自然语言查询

## 快速开始

### 1. 安装

```bash
# 方式一:ClawHub 安装(推荐)
clawhub install pidan-memory

# 方式二:手动安装
cd ~/.openclaw/workspace/skills
git clone https://github.com/your-repo/pidan-memory.git
```

### 2. 启动 Ollama

```bash
# 启动 Ollama 服务
ollama serve

# 下载 embedding 模型(首次)
ollama pull nomic-embed-text
```

### 3. 安装 Hook(启用自动记忆)

```bash
# 复制 Hook 文件
mkdir -p ~/.openclaw/hooks/pidan-memory
cp HOOK.md handler.ts ~/.openclaw/hooks/pidan-memory/
cp auto_memory.py ~/.openclaw/workspace/memory/

# 启用 Hook
openclaw hooks enable pidan-memory

# 重启 Gateway
openclaw gateway restart
```

## 使用方法

### 自动记忆(推荐)

安装 Hook 后,每次对话自动评估并存储。覆盖 16 大类场景。

### 模式管理

```bash
# 获取当前模式
echo '{"command": "get_mode", "parameters": {}}' | python3 run.py

# 切换到共享模式
echo '{"command": "set_mode", "parameters": {"mode": "shared"}}' | python3 run.py

# 切换回私有模式
echo '{"command": "set_mode", "parameters": {"mode": "private"}}' | python3 run.py
```

**模式说明:**
- `private` (默认): 多用户模式,记忆隔离
- `shared`: 共享模式,所有用户可互相查询

### 其他命令

```bash
# 记住信息
echo '{"command": "remember", "parameters": {"content": "用户最喜欢吃火锅", "importance": 4}}' | python3 run.py

# 搜索记忆
echo '{"command": "recall", "parameters": {"query": "饮食偏好"}}' | python3 run.py

# 查看最近记忆
echo '{"command": "recent_memories", "parameters": {"limit": 10}}' | python3 run.py

# 删除记忆(首次请求,确认)
echo '{"command": "delete_memory", "parameters": {"memory_id"...

Related skills

OpenClaw

bambu-studio-ai

heyixuan2

Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...

OpenClaw

geo-optimization

capt-marbles

Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...

OpenClaw

parakeet-stt

carlulsoe

Local speech-to-text with NVIDIA Parakeet TDT 0.6B v3 (ONNX on CPU). 30x faster than Whisper, 25 languages, auto-detection, OpenAI-compatible API. Use when transcribing audio files, converting speech to text, o...

OpenClaw

feishu-process-feedback

carlzhao007

飞书消息自动处理与进度反馈技能。安装后后台运行,监听飞书任务消息并自动创建独立进程处理。 在处理前后发送实时进度反馈(任务确认、进度百分比、完成通知)。 支持任务类型识别、智能解析、错误重试、并发控制、状态持久化...