memory-management
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMemory Management Skill
内存管理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.
基于HNSW向量搜索的AgentDB内存系统。为学习和知识管理提供150倍至12500倍的快速模式检索、持久化存储以及语义搜索能力。
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
- 需要存储成功模式
- 搜索相似解决方案
- 对过往工作进行语义查询
- 从先前任务中学习
- Agent间共享知识
- 构建知识库
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
bash
npx @claude-flow/cli memory store --key "[key]" --value "[value]" --namespace patternsExample:
bash
npx @claude-flow/cli memory store --key "auth-jwt-pattern" --value "JWT validation with refresh tokens" --namespace patterns在内存中存储模式或知识条目
bash
npx @claude-flow/cli memory store --key "[key]" --value "[value]" --namespace patterns示例:
bash
npx @claude-flow/cli memory store --key "auth-jwt-pattern" --value "JWT validation with refresh tokens" --namespace patternsSemantic Search
语义搜索
Search memory using semantic similarity
bash
npx @claude-flow/cli memory search --query "[search terms]" --limit 10Example:
bash
npx @claude-flow/cli memory search --query "authentication best practices" --limit 5使用语义相似度搜索内存
bash
npx @claude-flow/cli memory search --query "[search terms]" --limit 10示例:
bash
npx @claude-flow/cli memory search --query "authentication best practices" --limit 5Retrieve Entry
获取条目
Retrieve a specific memory entry by key
bash
npx @claude-flow/cli memory get --key "[key]" --namespace [namespace]Example:
bash
npx @claude-flow/cli memory get --key "auth-jwt-pattern" --namespace patterns通过key获取特定内存条目
bash
npx @claude-flow/cli memory get --key "[key]" --namespace [namespace]示例:
bash
npx @claude-flow/cli memory get --key "auth-jwt-pattern" --namespace patternsList Entries
列出条目
List all entries in a namespace
bash
npx @claude-flow/cli memory list --namespace [namespace]Example:
bash
npx @claude-flow/cli memory list --namespace patterns --limit 20列出命名空间中的所有条目
bash
npx @claude-flow/cli memory list --namespace [namespace]示例:
bash
npx @claude-flow/cli memory list --namespace patterns --limit 20Delete Entry
删除条目
Delete a memory entry
bash
npx @claude-flow/cli memory delete --key "[key]" --namespace [namespace]删除内存条目
bash
npx @claude-flow/cli memory delete --key "[key]" --namespace [namespace]Initialize HNSW Index
初始化HNSW索引
Initialize HNSW vector search index
bash
npx @claude-flow/cli memory init --enable-hnsw初始化HNSW向量搜索索引
bash
npx @claude-flow/cli memory init --enable-hnswMemory Stats
内存统计
Show memory usage statistics
bash
npx @claude-flow/cli memory stats显示内存使用统计信息
bash
npx @claude-flow/cli memory statsExport Memory
导出内存
Export memory to JSON
bash
npx @claude-flow/cli memory export --output memory-backup.json将内存导出为JSON格式
bash
npx @claude-flow/cli memory export --output memory-backup.jsonScripts
脚本
| Script | Path | Description |
|---|---|---|
| | Backup memory to external storage |
| | Consolidate and optimize memory |
| 脚本 | 路径 | 描述 |
|---|---|---|
| | 将内存备份到外部存储 |
| | 整合并优化内存 |
References
参考资料
| Document | Path | Description |
|---|---|---|
| | HNSW vector search configuration |
| | Memory namespace and schema reference |
| 文档 | 路径 | 描述 |
|---|---|---|
| | HNSW向量搜索配置 |
| | 内存命名空间与架构参考 |
Best Practices
最佳实践
- Check memory for existing patterns before starting
- Use hierarchical topology for coordination
- Store successful patterns after completion
- Document any new learnings
- 开始前检查内存中是否已有现有模式
- 使用分层拓扑进行协调
- 完成后存储成功的模式
- 记录所有新的学习内容