memory-management
它能做什么
这项技能引导智能体把模式和知识保存在持久记忆中,并按含义进行搜索。适合希望智能体从早先任务中学习、并复用有效做法的人。
适用场景
- ✓当你希望保存一个成功的解决方案,以便日后复用的时候。
- ✓当你需要找到与新任务相似的过去工作的时候。
- ✓当多个智能体需要共享它们所学到的东西的时候。
技能链接
https://github.com/ruvnet/ruflo/blob/main/.agents/skills/memory-management/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我们用于 JWT 登录的方法保存为可复用的模式,然后在我询问身份验证时找出相似的模式。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会把每个模式存放在一个键和命名空间下,在你提问时按含义搜索记忆,并取回匹配的条目。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Memory Management Skill
Purpose
AgentDB memory system with HNSW vector search. Provides 150x-12,500x faster pattern retrieval, persistent storage, and semantic search capabilities for learning and knowledge management.
When to Trigger
- need to store successful patterns
- searching for similar solutions
- semantic lookup of past work
- learning from previous tasks
- sharing knowledge between agents
- building knowledge base
When to Skip
- no learning needed
- ephemeral one-off tasks
- external data sources available
- read-only exploration
Commands
Store Pattern
Store a pattern or knowledge item in memory
npx @claude-flow/cli memory store --key "[key]" --value "[value]" --namespace patterns
Example:
npx @claude-flow/cli memory store --key "auth-jwt-pattern" --value "JWT validation with refresh tokens" --namespace patterns
Semantic Search
Search memory using semantic similarity
npx @claude-flow/cli memory search --query "[search terms]" --limit 10
Example:
npx @claude-flow/cli memory search --query "authentication best practices" --limit 5
Retrieve Entry
Retrieve a specific memory entry by key
npx @claude-flow/cli memory get --key "[key]" --namespace [namespace]
Example:
npx @claude-flow/cli memory get --key "auth-jwt-pattern" --namespace patterns
List Entries
List all entries in a namespace
npx @claude-flow/cli memory list --namespace [namespace]
Example:
npx @claude-flow/cli memory list --namespace patterns --limit 20
Delete Entry
Delete a memory entry
npx @claude-flow/cli memory delete --key "[key]" --namespace [namespace]
Initialize HNSW Index
Initialize HNSW vector search index
npx @claude-flow/cli memory init --enable-hnsw
Memory Stats
Show memory usage statistics
npx @claude-flow/cli memory stats
Export Memory
Export memory to JSON
npx @claude-flow/cli memory export --output memory-backup.json
Scripts
| Script | Path | Description |
|---|---|---|
memory-backup |
.agents/scripts/memory-backup.sh |
Backup memory to external storage |
memory-consolidate |
.agents/scripts/memory-consolidate.sh |
Consolidate and optimize memory |
References
| Document | Path | Description |
|---|---|---|
HNSW Guide |
docs/hnsw.md |
HNSW vector search configuration |
Memory Schema |
docs/memory-schema.md |
Memory namespace and schema reference |
Best Practices
- Check memory for existing patterns before starting
- Use hierarchical topology for coordination
- Store successful patterns after completion
- Document any new learnings
常见问题
什么是命名空间?
命名空间是一个命名分组,用来把相关的记忆条目放在一起。
我能按含义搜索吗?
能。这项技能包括一个语义搜索命令,可以查找相似的条目。
什么时候应该跳过它?
这项技能说明,对于不需要学习任何内容的一次性任务,应跳过它。
详情
作者的原始描述
AgentDB memory system with HNSW vector search. Provides 150x-12,500x faster pattern retrieval, persistent storage, and semantic search capabilities for learning and knowledge management. Use when: need to store successful patterns, searching for similar solutions, semantic lookup of past work, learning from previous tasks, sharing knowledge between agents, building knowledge base. Skip when: no learning needed, ephemeral one-off tasks, external data sources available, read-only exploration.
repo: ruvnet/ruflo
热度
- GitHub 星标
- 81k
- 排名
- #1533
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。