← 返回 Skills 市场
mem-rag-milvus
作者
liushuangfa666
· GitHub ↗
· v1.0.1
· MIT-0
209
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install mem-rag-milvus
功能描述
智能记忆系统,支持 SQLite(零配置)和 Milvus(向量搜索)后端。用于存储、检索和管理 AI 助手的记忆,支持语义搜索和自动备份。
使用说明 (SKILL.md)
RAG Memory Skill - 智能记忆系统
📚 描述
支持多种后端的智能记忆系统,可选择:
- SQLite(默认):开箱即用,无需额外服务
- Milvus:向量数据库,支持语义搜索
- ChromaDB:轻量级向量数据库(待实现)
🏗️ 架构
SQLite 模式(默认)
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ OpenClaw │ ──> │ RAG Memory │ ──> │ SQLite │
│ (记忆请求) │ │ (技能模块) │ │ (本地 DB) │
└─────────────┘ └──────────────┘ └─────────────┘
Milvus 模式(可选)
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ OpenClaw │ ──> │ RAG Memory │ ──> │ Milvus │
│ (记忆请求) │ │ (技能模块) │ │ (向量存储) │
└─────────────┘ └──────────────┘ └─────────────┘
│
v
┌──────────────┐
│ Ollama │
│ (可选) │
│ 嵌入生成 │
└──────────────┘
🔧 配置
快速开始(SQLite - 无需配置)
# 直接使用,零配置
python -c "from rag_memory import store, search; store('测试记忆')"
Milvus 模式(高级用户)
# 环境变量配置
export RAG_MEMORY_BACKEND=milvus
export MILVUS_URL=http://localhost:19530
export OLLAMA_URL=http://localhost:11434 # 可选,用于向量搜索
# 安装依赖
pip install pymilvus
所有环境变量
RAG_MEMORY_BACKEND=sqlite # sqlite | milvus | chromadb
RAG_MEMORY_SQLITE_DB=./memory.db # SQLite 数据库路径
MILVUS_URL=http://localhost:19530 # Milvus 服务地址
OLLAMA_URL=http://localhost:11434 # Ollama 服务地址(可选)
RAG_MEMORY_COLLECTION=openclaw_memory # 集合名称
RAG_MEMORY_BACKUP_DIR=./memory_backup # 备份目录
依赖
最小依赖(SQLite 模式):
pip install requests
完整依赖(Milvus 模式):
pip install requests pymilvus
📖 使用方法
Python API
from rag_memory import store, search
# 存储记忆
memory_id = store("今天讨论了 RAG 系统", {"type": "conversation", "topic": "RAG"})
# 搜索记忆
results = search("RAG 系统讨论", top_k=3)
# 删除记忆
from rag_memory import get_memory
get_memory().delete_memory(memory_id)
功能说明
| 函数 | 说明 | 参数 | 返回值 |
|---|---|---|---|
store() |
存储记忆 | content: str, metadata: Dict | memory_id: int |
search() |
搜索记忆 | query: str, top_k: int | List[Dict] |
get_memory() |
获取实例 | - | RAGMemory |
📊 记忆数据结构
{
"id": 1,
"content": "今天讨论了 RAG 系统",
"timestamp": "2026-03-18T15:30:00",
"metadata": {
"type": "conversation",
"topic": "RAG"
},
"distance": 0.85 // 仅 Milvus 模式有
}
🔄 后端对比
| 特性 | SQLite | Milvus |
|---|---|---|
| 安装难度 | ⭐ 零配置 | ⭐⭐⭐ 需要 Docker |
| 向量搜索 | ❌ 不支持 | ✅ 支持 |
| 搜索方式 | 最近优先 | 语义相似度 |
| 适用场景 | 个人使用 | 生产环境 |
| 资源占用 | 低 | 中 - 高 |
⚠️ 注意事项
- SQLite 模式:开箱即用,无需额外配置
- Milvus 模式:需要 Docker 运行 Milvus 服务
- Ollama:可选,用于向量嵌入生成
- 备份机制:自动备份到 JSON 文件
🐛 故障排除
问题:无法导入 pymilvus
# 仅 Milvus 模式需要
pip install pymilvus
问题:无法连接 Milvus
# 检查 Milvus 服务
docker ps | grep milvus
curl http://localhost:19530/v1/version
问题:嵌入生成失败
# 检查 Ollama 服务(可选功能)
curl http://localhost:11434/api/tags
ollama pull bge-m3 # 如需使用
📦 发布到 ClawHub
打包
cd /app/skills/rag-memory
tar -czf rag-memory.tar.gz SKILL.md rag_memory.py
上传
- 访问 https://clawhub.com
- 创建开发者账号
- 上传
rag-memory.tar.gz - 填写技能描述和配置说明
用户安装
openclaw skills install rag-memory
📝 更新日志
- 2026-03-18: 初始版本,替代文件记忆系统
- 自动备份到 JSON 文件
- 语义搜索功能
- 元数据支持
安全使用建议
This skill appears to do what it says: by default it stores memories locally in a SQLite DB and writes JSON backups. It will attempt to call an embedding service (Ollama) and, if configured, a Milvus vector DB; the code auto-detects host/gateway addresses (reads /etc/resolv.conf and tries host.docker.internal) which can cause it to contact services on the host or network. Before installing: (1) decide whether embeddings/Milvus are needed—leave RAG_MEMORY_BACKEND=sqlite to avoid network calls; (2) if you enable Ollama or Milvus, ensure OLLAMA_URL and MILVUS_URL point to trusted, local endpoints to avoid sending memory content to remote servers; (3) review or set RAG_MEMORY_SQLITE_DB and RAG_MEMORY_BACKUP_DIR so sensitive data is stored in a secure location and with proper filesystem permissions; (4) inspect the code if you require stronger guarantees about what is transmitted. Overall the skill is internally coherent but be mindful of network endpoints and backup file locations.
功能分析
Type: OpenClaw Skill
Name: mem-rag-milvus
Version: 1.0.1
The skill is a standard RAG (Retrieval-Augmented Generation) memory management system supporting SQLite and Milvus backends. The code in `rag_memory.py` implements expected functionality such as storing memories, generating embeddings via a local Ollama instance, and maintaining local JSON backups. It uses parameterized queries for SQLite to prevent injection and includes standard container networking heuristics to locate local services. No evidence of data exfiltration, malicious execution, or prompt injection was found.
能力评估
Purpose & Capability
Name/description claim an AI memory store with SQLite (zero-config) and optional Milvus/Ollama integration; the code implements SQLite by default, an optional Milvus backend, embedding calls to an Ollama endpoint, and automatic JSON backups—these requirements align with the stated purpose and there are no unrelated credentials or binaries requested.
Instruction Scope
SKILL.md instructs typical usage (store/search) and the code follows it. The skill will (a) write a SQLite DB and JSON backup files to disk (configurable paths) and (b) attempt HTTP calls to OLLAMA_URL and MILVUS_URL if configured or auto-detected. The code also reads /etc/resolv.conf to attempt Docker gateway detection—this is intended to find host endpoints for services but does perform benign local filesystem read and can influence network targets.
Install Mechanism
Instruction-only skill (no install spec). Minimal runtime dependency (python3) is declared; optional dependencies (requests, pymilvus) are documented. Nothing is downloaded from untrusted URLs or installed automatically by an install script.
Credentials
No required env vars are declared, but the code respects several optional env vars (RAG_MEMORY_BACKEND, MILVUS_URL, OLLAMA_URL, DB and backup paths). Those variables are relevant to the skill's function. Caution: if OLLAMA_URL or MILVUS_URL point to remote/untrusted endpoints, user memory content (including backups) can be sent over the network to those services.
Persistence & Privilege
The skill does not request elevated platform privileges or always:true. It creates/uses local files (SQLite DB and JSON backups in configurable directories) and can maintain a long-lived in-process instance; this is expected for a memory store. It does not modify other skills or system-wide agent configs.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install mem-rag-milvus - 安装完成后,直接呼叫该 Skill 的名称或使用
/mem-rag-milvus触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Added OpenClaw skill metadata header for improved integration.
- No functional changes to the codebase or APIs.
- Documentation now includes structured YAML frontmatter, making the skill easier to configure.
- All existing usage, configuration, and troubleshooting information remains unchanged.
新增 OpenClaw 技能元数据头信息,以提升集成体验。
未对代码库或 API 做任何功能性改动。
文档现已新增结构化 YAML 前置元数据(frontmatter),使该技能更易于被发现和配置。
所有现有使用方法、配置项及故障排查相关说明均保持不变。
v1.0.0
RAG Memory Skill 1.0.0 初始发布:
- 支持多种后端:SQLite(默认)、Milvus(向量数据库)
- 提供 Python API:store、search、get_memory 等接口
- 支持语义搜索(Milvus 模式)及元数据存储
- 自动备份记忆数据到 JSON 文件
- 提供详细的配置说明和依赖信息
- 文档涵盖常见问题及故障排查步骤
元数据
常见问题
mem-rag-milvus 是什么?
智能记忆系统,支持 SQLite(零配置)和 Milvus(向量搜索)后端。用于存储、检索和管理 AI 助手的记忆,支持语义搜索和自动备份。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 209 次。
如何安装 mem-rag-milvus?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install mem-rag-milvus」即可一键安装,无需额外配置。
mem-rag-milvus 是免费的吗?
是的,mem-rag-milvus 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
mem-rag-milvus 支持哪些平台?
mem-rag-milvus 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 mem-rag-milvus?
由 liushuangfa666(@liushuangfa666)开发并维护,当前版本 v1.0.1。
推荐 Skills