Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

Memory Vector v2.1 (多层知识库)

v2.1.0

提供基于BGE-M3模型的自动日志蒸馏生成向量记忆,并支持语义相似度搜索与核心记忆自动更新功能。

0· 219·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for duzhilei951/memory-vector-bge.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Memory Vector v2.1 (多层知识库)" (duzhilei951/memory-vector-bge) from ClawHub.
Skill page: https://clawhub.ai/duzhilei951/memory-vector-bge
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install memory-vector-bge

ClawHub CLI

Package manager switcher

npx clawhub@latest install memory-vector-bge
Security Scan
VirusTotalVirusTotal
Pending
View report →
OpenClawOpenClaw
Suspicious
medium confidence
!
Purpose & Capability
The skill's stated purpose (log distillation → embeddings → vector search) is implemented by the JS scripts. However metadata declares no required environment variables while SKILL.md and the code expect several (EMBEDDING_URL, LLM_URL, EMBEDDING_API_KEY, LLM_API_KEY, etc.). Also updateMemoryCore writes a hard-coded '核心记忆' block (including a real-seeming address and commute rules) into MEMORY.md — irrelevant and unexpected for a generic memory tool and potentially a privacy/legal concern.
!
Instruction Scope
SKILL.md instructs the agent to read memory/*.md logs, call an embedding service and an LLM, create memory/vector/memories.json, and update knowledge files — which the code does. But the code will overwrite/work with files in the current workspace (MEMORY.md, memory/vector/*). The auto-generated MEMORY.md contains hard-coded personal data (not derived from user logs) and the scripts will write into user files without strong safeguards; this broad file modification is outside what a casual user might expect.
Install Mechanism
No install spec or network downloads are present; the skill is provided as Node.js scripts. That is low installation risk compared with remote binary downloads. However the package includes runnable scripts that will be executed by node in the user's workspace.
!
Credentials
The manifest declares no required env vars, but both SKILL.md and the code rely on several environment variables (EMBEDDING_URL, EMBEDDING_MODEL, EMBEDDING_API_KEY, LLM_URL, LLM_MODEL, LLM_API_KEY, DISTILL_DAYS). The code also contains a bug: httpRequest always injects CONFIG.embedding.apiKey into Authorization header (it does not use CONFIG.llm.apiKey), meaning LLM_API_KEY is declared but not actually used — an inconsistency that could lead to unintended requests or misconfigured credential handling. Requesting API keys is proportionate for contacting embedding/LLM services, but the mismatch between declared and used envs is a red flag.
Persistence & Privilege
The skill does not request 'always:true' and is user-invocable. It writes and updates files inside the agent's workspace (memory/vector/memories.json and MEMORY.md). That file-write behavior is expected for this functionality but merits caution: the scripts will create/overwrite workspace files and back up originals, so run in an isolated directory and review backups before trusting outputs.
What to consider before installing
Things to check before installing or running this skill: - Review and understand the two included JS files (dist/memory-distill.js and dist/memory-search.js) — they will read and write files under your current working directory (memory/*, memory/vector/*, MEMORY.md). - Expect to provide or configure embedding and LLM endpoints and API keys (EMBEDDING_URL, LLM_URL, EMBEDDING_API_KEY, LLM_API_KEY). The skill metadata does not declare these, but the scripts will use them; confirm endpoints are local/trusted (defaults point to http://localhost:11434). Do not supply production credentials until you audit the code. - The distill script contains a bug: it sets the Authorization header using the embedding API key even for LLM calls (CONFIG.embedding.apiKey is reused). If you plan to use a remote LLM service, update/fix the code so the LLM API key is used correctly. - The updateMemoryCore function writes a hard-coded personal block (address, commuting rules, names). This may be leftover sample data from the author — inspect and remove/replace these lines before running to avoid injecting unintended personal information into your MEMORY.md. - The provided distill file appears truncated in the supplied listing (the run call ends with a truncated .catch(console.er...), which could indicate an incomplete file; ensure the file is intact and syntactically correct before executing. - Run the scripts in an isolated test workspace (not your real data), confirm backups are created, and verify the regex-based 'filterSensitiveContent' is sufficient for your threat model — it's not comprehensive and can miss secrets. If you are not comfortable auditing or editing the code yourself, do not run this skill with sensitive logs or live credentials.

Like a lobster shell, security has layers — review code before you run it.

bge-m3vk97e8c1ewwskwbxf1epc681m9h83e095distillvk97e8c1ewwskwbxf1epc681m9h83e095knowledge-basevk97e8c1ewwskwbxf1epc681m9h83e095latestvk97e8c1ewwskwbxf1epc681m9h83e095memoryvk97e8c1ewwskwbxf1epc681m9h83e095ollamavk97e8c1ewwskwbxf1epc681m9h83e095vectorvk97e8c1ewwskwbxf1epc681m9h83e095
219downloads
0stars
3versions
Updated 1mo ago
v2.1.0
MIT-0

memory-vector 技能 v2.1

分布式记忆系统,支持知识库 + 向量检索 + 自动蒸馏 + 多层同步

🎯 整体架构

┌─────────────────────────────────────────────────────────────────┐
│                      三层记忆架构 (v2.1)                         │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  ┌─────────────────────────────────────────────────────────┐  │
│  │  知识库层 (长期记忆)                                       │  │
│  │  ├── MEMORY.md        - 核心准则/精选记忆                 │  │
│  │  ├── SOUL.md          - 人设定义/性格                     │  │
│  │  ├── USER.md          - 用户信息/习惯/偏好                │  │
│  │  ├── IDENTITY.md      - 身份定义                          │  │
│  │  ├── AGENTS.md        - 智能体配置/行为规则               │  │
│  │  └── TOOLS.md         - 工具配置/API/环境变量              │  │
│  └─────────────────────────────────────────────────────────┘  │
│                              ↑                                   │
│                      LLM 智能蒸馏同步                            │
│                              │                                   │
│  ┌─────────────────────────────────────────────────────────┐  │
│  │  日志层 (中期记忆)                                        │  │
│  │  └── memory/YYYY-MM-DD.md - 每日对话日志                 │  │
│  └─────────────────────────────────────────────────────────┘  │
│                              ↑                                   │
│                      BGE-M3 向量化                                │
│                              │                                   │
│  ┌─────────────────────────────────────────────────────────┐  │
│  │  向量层 (快速检索)                                        │  │
│  │  └── memory/vector/memories.json                        │  │
│  │       - 1024维向量 (BGE-M3)                               │  │
│  │       - 标签 + 重要性权重                                │  │
│  │       - 语义搜索支持                                      │  │
│  └─────────────────────────────────────────────────────────┘  │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

📦 功能特性

v2.1 完整功能

功能说明
三层存储知识库 + 日志 + 向量,各司其职
多层同步LLM 判断写入哪个知识库文件
自动蒸馏每日/每周自动提取关键信息
向量搜索BGE-M3 语义匹配,支持按标签/重要性筛选
智能评分综合评分 = 语义×0.7 + 重要性×0.3

📋 知识库文件说明

文件内容蒸馏来源
MEMORY.md核心准则、长期记忆重要规则、决策
SOUL.md我的人设、性格、说话方式人设调整
USER.md您的习惯、偏好、作息用户偏好
IDENTITY.md我的身份定义身份信息
AGENTS.md智能体配置、行为规则技能配置
TOOLS.md工具配置、API、环境变量工具使用习惯

🔧 环境变量配置

变量说明默认值
EMBEDDING_URLEmbedding 服务http://localhost:11434/v1/embeddings
EMBEDDING_MODELEmbedding 模型bge-m3
EMBEDDING_API_KEYAPI 密钥(空)
LLM_URLLLM 服务http://localhost:11434/v1/chat/completions
LLM_MODELLLM 模型qwen2.5:7b
DISTILL_DAYS蒸馏天数7

📁 文件结构

skills/memory-vector/
├── SKILL.md                    # 本文件
├── dist/
│   ├── memory-distill.js       # 蒸馏脚本
│   └── memory-search.js        # 搜索脚本
└── references/
    └── config.json             # 配置文件

🚀 使用方法

1. 蒸馏记忆

# 蒸馏最近7天
node skills/memory-vector/dist/memory-distill.js

# 蒸馏最近30天
node skills/memory-vector/dist/memory-distill.js 30

蒸馏流程:

  1. 读取 memory/*.md 日志文件
  2. LLM 分析内容,提取:
    • 关键信息 + 重要性
    • 内容类型(判断写入哪个知识库)
    • 标签
  3. 使用 BGE-M3 生成向量
  4. 存入 memory/vector/memories.json
  5. 根据内容类型同步到对应知识库文件

2. 搜索记忆

# 基本搜索
node memory-search.js "搜索内容"

# 按标签筛选
node memory-search.js "内容" --tag 家庭

# 按重要性筛选 (0-1)
node memory-search.js "内容" --min-importance 0.7

# 查看所有标签
node memory-search.js --tags

# 列出所有记忆
node memory-search.js --list

3. 自动蒸馏 (Heartbeat)

HEARTBEAT.md 中配置:

### 🧠 记忆维护(每3天执行一次)
1. 运行记忆蒸馏:
   - 命令: `node skills/memory-vector/dist/memory-distill.js 7`
   - 功能:
     - 读取近期7天日志
     - LLM 智能分析内容类型
     - BGE-M3 向量化
     - 存入向量数据库
     - 同步到对应知识库文件

💡 v2.1 核心改进

智能判断写入目标

// LLM 输出格式 (v2.1)
{
  "targetFile": "USER.md",        // 判断写入哪个文件
  "importance": 0.8,              // 重要性 0-1
  "keyInfo": ["关键信息"],
  "tags": ["家庭", "偏好"],
  "summary": "一句话摘要",
  "action": "append"              // append / overwrite
}

判断逻辑

内容类型目标文件关键词
工具/环境变量TOOLS.mdAPI、工具、配置
智能体配置AGENTS.md技能、行为、规则
我的人设SOUL.md性格、风格、说话方式
您的习惯USER.md偏好、习惯、作息
身份定义IDENTITY.md名字、角色、身份
核心准则MEMORY.md重要规则、长期记忆

📊 存储格式

memories.json (v2.1)

{
  "version": "2.1",
  "updated": "2026-03-23T12:00:00Z",
  "memories": [
    {
      "id": "2026-03-23-xxx",
      "content": "记忆内容...",
      "summary": "一句话摘要",
      "targetFile": "USER.md",       // v2.1 新增
      "tags": ["家庭", "偏好"],
      "importance": 0.8,
      "keyInfo": ["关键点1"],
      "embedding": [0.1, -0.2, ...],
      "source": "2026-03-23.md",
      "created": "2026-03-23T..."
    }
  ],
  "index": {
    "byTag": { "家庭": ["id1"] },
    "byImportance": [{ "id": "id1", "importance": 0.8 }],
    "byTargetFile": { "USER.md": ["id1"], "MEMORY.md": ["id2"] }
  }
}

🔐 安全机制

  • 蒸馏时自动过滤敏感信息(API keys, tokens)
  • 不保存完整凭据到知识库
  • 知识库文件只保存脱敏后的内容
  • 写入前先备份

⚠️ 注意事项

  1. Ollama 必须保持运行
  2. 首次运行需要足够日志才能生成向量
  3. 建议每周运行一次蒸馏
  4. 写入知识库前会自动备份原文件

📈 性能

  • 向量维度: 1024 (BGE-M3)
  • 搜索速度: <100ms
  • 支持标签: 无限
  • 知识库文件: 6个

让 AI 真正记住你 - 分布式多层记忆系统 v2.1

Comments

Loading comments...