← Back to Skills Marketplace
zuoanco

long-term-task-memory

by zuoanCo · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ⚠ suspicious
147
Downloads
1
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install long-term-task-memory
Description
按需调用火山引擎 Milvus 向量数据库进行长期记忆存储与检索,支持灵活的数据格式区分角色、事件、项目等维度;当用户明确要求保存、查询、更新或删除长期记忆时使用
README (SKILL.md)

长期任务记忆管理

功能说明

本 Skill 提供火山引擎 Milvus 向量数据库的操作能力,用于长期记忆的存储与检索。

核心能力

  • 建立连接:连接到 Milvus 数据库实例
  • 存储记忆:保存任务、事件、项目等信息到向量数据库
  • 查询搜索:按条件检索历史记忆
  • 更新记录:修改已存储的记忆信息
  • 删除记录:清理不需要的记忆

使用方式:当用户明确要求"保存到长期记忆"、"查询历史任务"、"更新记忆状态"、"删除记录"等操作时调用。

前置准备

环境配置

编辑 .env 文件,填写 Milvus 连接信息:

# Milvus 实例访问地址
MILVUS_URI=http://your-instance.milvus.ivolces.com:19530

# Milvus 认证令牌(格式:Username:Password)
MILVUS_TOKEN=root:yourpassword

.env 文件加载优先级:

  1. 脚本所在目录(scripts/.env
  2. 当前工作目录(./.env
  3. Skill 根目录(long-term-task-memory/.env

获取配置信息

  1. 登录火山引擎控制台
  2. 进入向量数据库 Milvus 服务
  3. 创建或选择实例
  4. 在实例详情页获取访问地址(URI)
  5. 使用实例的用户名和密码组成 Token

数据格式

灵活的数据结构

支持多维度区分的灵活数据格式:

{
  "memory_id": "唯一标识(可选,自动生成)",
  "content": "记忆内容描述",
  "category": "分类(task/event/project/note等)",
  "role": "角色标识(如:pm/dev/manager等)",
  "project": "项目名称",
  "event": "事件名称",
  "status": "状态(pending/in_progress/completed等)",
  "priority": "优先级(high/medium/low)",
  "tags": ["标签1", "标签2"],
  "context": {
    "自定义上下文信息": "支持任意JSON结构"
  },
  "metadata": {
    "自定义元数据": "支持任意JSON结构"
  }
}

维度说明

维度 字段 说明 示例值
分类 category 记忆类型 task、event、project、note、decision
角色 role 相关角色 pm、dev、manager、designer
项目 project 所属项目 website-redesign、app-v2
事件 event 相关事件 sprint-2024-q1、release-2.0
状态 status 当前状态 pending、in_progress、completed、archived
优先级 priority 重要程度 high、medium、low
标签 tags 自定义标签 ["urgent", "backend", "api"]
上下文 context 背景信息 任意 JSON 结构
元数据 metadata 额外信息 任意 JSON 结构

操作手册

1. 建立连接

功能:初始化数据库连接并创建集合(如不存在)

命令

python scripts/milvus_manager.py --action init

参数

  • --action init:执行初始化操作
  • --collection:集合名称(可选,默认:task_memory)
  • --recreate:是否重建集合(可选,会删除现有数据)

示例

# 初始化默认集合
python scripts/milvus_manager.py --action init

# 初始化指定集合
python scripts/milvus_manager.py --action init --collection project_memory

# 重建集合(清空数据)
python scripts/milvus_manager.py --action init --recreate

输出

✓ 已加载环境配置文件:/path/to/.env
✓ 成功连接到 Milvus 实例:http://your-instance.milvus.ivolces.com:19530
✓ 成功创建集合:task_memory

2. 存储记忆

功能:将记忆信息保存到数据库

命令

python scripts/milvus_manager.py --action save --memory-file \x3C文件路径>

参数

  • --action save:执行保存操作
  • --memory-file:记忆信息文件路径(JSON 格式)
  • --collection:集合名称(可选)

准备记忆文件

创建 memory.json 文件:

{
  "content": "完成用户认证模块的重构,采用 JWT 令牌方案",
  "category": "task",
  "role": "dev",
  "project": "website-redesign",
  "event": "sprint-2024-q1",
  "status": "completed",
  "priority": "high",
  "tags": ["backend", "auth", "jwt"],
  "context": {
    "tech_stack": ["Python", "FastAPI"],
    "estimated_hours": 16,
    "completed_date": "2024-03-15"
  },
  "metadata": {
    "assignee": "张三",
    "reviewer": "李四",
    "related_docs": ["api-docs.md", "auth-guide.md"]
  }
}

示例

# 保存记忆
python scripts/milvus_manager.py --action save --memory-file ./memory.json

# 保存到指定集合
python scripts/milvus_manager.py --action save --memory-file ./memory.json --collection project_memory

输出

✓ 已加载环境配置文件:/path/to/.env
✓ 成功连接到 Milvus 实例:http://your-instance.milvus.ivolces.com:19530
✓ 任务已保存,ID:550e8400-e29b-41d4-a716-446655440000

更多示例

// 项目记忆
{
  "content": "Website 重构项目,目标是在 Q2 完成前端升级",
  "category": "project",
  "project": "website-redesign",
  "status": "in_progress",
  "priority": "high",
  "tags": ["frontend", "react", "typescript"],
  "context": {
    "start_date": "2024-01-01",
    "target_date": "2024-06-30",
    "budget": "500k"
  }
}

// 事件记忆
{
  "content": "2024 Q1 冲刺计划会议,确定优先级排序",
  "category": "event",
  "event": "sprint-2024-q1",
  "project": "website-redesign",
  "tags": ["meeting", "planning"],
  "context": {
    "date": "2024-01-05",
    "participants": ["PM", "Tech Lead", "Devs"],
    "decisions": ["优先完成用户认证", "推迟支付模块"]
  }
}

// 决策记忆
{
  "content": "决定采用微服务架构重构后端系统",
  "category": "decision",
  "role": "manager",
  "project": "backend-refactor",
  "tags": ["architecture", "critical"],
  "context": {
    "date": "2024-02-20",
    "reason": "现有单体架构无法支撑业务增长",
    "alternatives": ["继续单体架构", "SOA架构"]
  }
}

3. 查询搜索

功能:按条件检索历史记忆

命令

python scripts/milvus_manager.py --action query [过滤参数]

参数

  • --action query:执行查询操作
  • --category:按分类过滤
  • --role:按角色过滤
  • --project:按项目过滤
  • --event:按事件过滤
  • --status:按状态过滤
  • --priority:按优先级过滤
  • --limit:返回数量限制(默认:10)
  • --collection:集合名称(可选)

示例

# 查询所有待处理的任务
python scripts/milvus_manager.py --action query --status pending

# 查询特定项目的所有记忆
python scripts/milvus_manager.py --action query --project website-redesign

# 查询开发角色的任务
python scripts/milvus_manager.py --action query --role dev --category task

# 查询特定事件的相关记忆
python scripts/milvus_manager.py --action query --event sprint-2024-q1

# 组合查询:高优先级的进行中任务
python scripts/milvus_manager.py --action query --status in_progress --priority high

# 查询最近 20 条记录
python scripts/milvus_manager.py --action query --limit 20

输出

✓ 已加载环境配置文件:/path/to/.env
✓ 成功连接到 Milvus 实例:http://your-instance.milvus.ivolces.com:19530
✓ 查询到 3 个任务

查询结果:
[
  {
    "memory_id": "550e8400-e29b-41d4-a716-446655440000",
    "content": "完成用户认证模块的重构",
    "category": "task",
    "role": "dev",
    "project": "website-redesign",
    "status": "completed",
    "priority": "high",
    "created_at": "2024-03-15T10:30:00",
    "tags": ["backend", "auth"]
  },
  ...
]

获取单条记忆详情

python scripts/milvus_manager.py --action get --memory-id \x3C记忆ID>

4. 更新记录

功能:修改已存储记忆的状态或内容

命令

python scripts/milvus_manager.py --action update --memory-id \x3CID> --status \x3C新状态>

参数

  • --action update:执行更新操作
  • --memory-id:记忆唯一标识
  • --status:新状态值
  • --collection:集合名称(可选)

示例

# 更新任务状态为完成
python scripts/milvus_manager.py --action update \
  --memory-id 550e8400-e29b-41d4-a716-446655440000 \
  --status completed

# 更新任务状态为进行中
python scripts/milvus_manager.py --action update \
  --memory-id 550e8400-e29b-41d4-a716-446655440000 \
  --status in_progress

输出

✓ 已加载环境配置文件:/path/to/.env
✓ 成功连接到 Milvus 实例:http://your-instance.milvus.ivolces.com:19530
✓ 找到任务:550e8400-e29b-41d4-a716-446655440000
✓ 任务已保存,ID:550e8400-e29b-41d4-a716-446655440000
✓ 任务状态已更新:550e8400-e29b-41d4-a716-446655440000 -> completed

5. 删除记录

功能:从数据库中移除记忆

命令

python scripts/milvus_manager.py --action delete --memory-id \x3CID>

参数

  • --action delete:执行删除操作
  • --memory-id:记忆唯一标识
  • --collection:集合名称(可选)

示例

# 删除指定记忆
python scripts/milvus_manager.py --action delete \
  --memory-id 550e8400-e29b-41d4-a716-446655440000

输出

✓ 已加载环境配置文件:/path/to/.env
✓ 成功连接到 Milvus 实例:http://your-instance.milvus.ivolces.com:19530
✓ 任务已删除:550e8400-e29b-41d4-a716-446655440000

使用场景

场景 1:项目任务管理

用户:"把网站重构项目的任务保存到长期记忆"

执行

  1. 提取任务信息
  2. 创建记忆文件(category=task, project=website-redesign)
  3. 调用存储命令

场景 2:按项目查询历史

用户:"查询 website-redesign 项目的所有记忆"

执行

python scripts/milvus_manager.py --action query --project website-redesign --limit 50

场景 3:按角色查询任务

用户:"查看开发人员(dev)的所有待处理任务"

执行

python scripts/milvus_manager.py --action query --role dev --status pending

场景 4:更新任务进度

用户:"将任务 xxx 标记为完成"

执行

python scripts/milvus_manager.py --action update --memory-id xxx --status completed

场景 5:记录决策

用户:"记录这次架构决策到长期记忆"

执行

  1. 提取决策内容
  2. 创建记忆文件(category=decision)
  3. 调用存储命令

资源索引

注意事项

配置要求

  • 使用前必须配置 .env 文件
  • 如果配置不完整,脚本会提示缺少的配置项
  • .env 文件支持多个位置自动加载

数据管理

  • 合理使用分类、角色、项目等维度便于检索
  • 使用标签增加灵活性
  • 定期清理不需要的记忆
  • 重要数据建议备份

性能优化

  • 查询时使用合理的过滤条件
  • 避免返回过多结果(合理设置 limit)
  • 为常用查询维度建立索引
Usage Guidance
Before installing or running this skill: (1) be aware the script will attempt to read a .env file (script dir, cwd, or skill root) and will import any keys it finds into the process—avoid placing unrelated secrets in those .env files; (2) the skill requires MILVUS_URI and MILVUS_TOKEN (credentials) even though the registry metadata does not declare them—treat this as a red flag and only provide credentials you control and trust; (3) the skill will make network calls to whatever MILVUS_URI you supply and will create/modify collections and data there—do not point it at production systems containing sensitive PII or high-value data without testing first; (4) there is no automated install of pymilvus; ensure you install the listed dependency in a safe/isolated environment; (5) because the skill source is 'unknown', prefer to review scripts/milvus_manager.py locally, run in an isolated environment, and use dedicated, least-privilege Milvus credentials (or a test instance) before granting access.
Capability Assessment
Purpose & Capability
The skill's name/description and the included scripts consistently implement a Milvus memory manager (connect, create collection, save/query/update/delete memories). However, the registry metadata declares no required environment variables or primary credential while the SKILL.md and scripts clearly expect MILVUS_URI and MILVUS_TOKEN. That mismatch is disproportionate to the stated metadata and should be treated as an incoherence.
Instruction Scope
SKILL.md restricts actions to initializing a Milvus collection and CRUD operations on memories and instructs running scripts in scripts/milvus_manager.py. That's within scope for the stated purpose. Two cautions: (1) the runtime will load a .env file from multiple locations (script dir, current working directory, skill root) which may unintentionally read unrelated .env files and export any keys they contain into the process; (2) the SKILL.md and script require supplying credentials (MILVUS_TOKEN) and making network calls to the user-provided MILVUS_URI, so data will be sent to that endpoint (expected but security-relevant).
Install Mechanism
There is no install spec (instruction-only install), and SKILL.md lists a Python dependency (pymilvus==2.3.0). That is moderate risk only because nothing is auto-downloaded by the skill itself, but the runtime will fail without the dependency. The lack of an explicit install step in registry metadata is an inconsistency the user should notice.
Credentials
The code and SKILL.md require MILVUS_URI and MILVUS_TOKEN (a credential in Username:Password format), but the skill's declared requirements list no env vars or primary credential. Additionally, the .env loader will import any key/value pairs from the .env file into the process environment (it purposely avoids overwriting existing env vars), which could lead to accidental exposure of unrelated secrets if a .env in cwd or skill root contains them. Requesting Milvus access credentials is reasonable for this skill, but the omission from metadata and the broad .env-loading behavior are concerning.
Persistence & Privilege
The skill is not always-enabled and does not request special platform privileges. It does not modify other skills' configuration and does not claim persistent system presence beyond connecting to the user-specified Milvus instance and creating/altering collections there (expected for a database-backed memory manager).
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install long-term-task-memory
  3. After installation, invoke the skill by name or use /long-term-task-memory
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.2
Version 1.0.2 - 支持更灵活的长期记忆存储格式,新增维度:角色、事件、项目等,允许自定义 context/metadata 结构 - 操作手册更新,覆盖连接、存储、查询、更新、删除全流程 - 文件规范调整:移除 references/task-format.md,新增 references/memory-format.md 用于新数据格式说明 - 明确仅在用户有明确长期记忆操作需求时触发,减少误操作 - 命令参数和返回示例全面补充,提升易用性
v1.0.1
Version 1.0.1 - 明确规定本 Skill 拥有“最高执行优先级”,新增流程说明,要求所有请求首先判断是否需要进入长期记忆。 - 环境变量配置方法从自定义变量名统一为标准 `MILVUS_URI` 和 `MILVUS_TOKEN`,并补充 `.env` 文件的优先级与加载规则。 - 扩充长期任务识别标准,增加内容保留、协作方等判断维度,并新增“立即决策”说明。 - 优化前置准备与注意事项,强调环境变量配置的必要性和自动提示逻辑。 - 其他内容结构和用词梳理,使操作流程和使用场景更加清晰易懂。
v1.0.0
long-term-task-memory 1.0.0 - Initial release of long-term-task-memory skill. - Enables intelligent identification and persistent storage of long-term tasks in Volcengine Milvus vector database. - Supports tracking and updating task statuses (pending, in_progress, completed, failed). - Allows retrieval and similarity search of historical tasks using flexible query options. - Provides task information extraction, structured storage, and context-aware task management based on user intent and task complexity. - Includes command-line scripts for saving, querying, and updating tasks, with configuration guidance for Milvus connection settings.
Metadata
Slug long-term-task-memory
Version 1.0.2
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is long-term-task-memory?

按需调用火山引擎 Milvus 向量数据库进行长期记忆存储与检索,支持灵活的数据格式区分角色、事件、项目等维度;当用户明确要求保存、查询、更新或删除长期记忆时使用. It is an AI Agent Skill for Claude Code / OpenClaw, with 147 downloads so far.

How do I install long-term-task-memory?

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

Is long-term-task-memory free?

Yes, long-term-task-memory is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does long-term-task-memory support?

long-term-task-memory is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created long-term-task-memory?

It is built and maintained by zuoanCo (@zuoanco); the current version is v1.0.2.

💬 Comments