
Memory Management
Persist agent patterns and retrieve semantically similar past solutions with AgentDB HNSW memory via the claude-flow CLI.
Overview
Memory Management is an agent skill most often used in Build (agent-tooling), also Operate (iterate) and Grow-related learning loops, that persists and semantically searches agent patterns via AgentDB and HNSW through th
Install
npx skills add https://github.com/ruvnet/ruflo --skill memory-managementWhat is this skill?
- AgentDB memory with HNSW vector search for semantic pattern lookup
- Documented 150x–12,500x faster pattern retrieval positioning in skill frontmatter
- CLI flows: `memory export`, consolidation via worker dispatch, `memory stats`
- Triggers on storing successes, sharing knowledge between agents, and building a knowledge base
- Explicit skip guidance for ephemeral one-off tasks with no learning value
- 150x–12,500x faster pattern retrieval (per skill description)
- HNSW vector search for semantic lookup
Adoption & trust: 658 installs on skills.sh; 58.5k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agents forget prior solutions so you re-debug the same integrations and workflows every sprint.
Who is it for?
Indie builders operating long-lived agent stacks with @claude-flow/cli who want cross-session learning and shared memory between workers.
Skip if: One-off tasks with no reuse, read-only exploration with no writes, or teams that forbid local memory stores and CLI dispatch hooks.
When should I use this skill?
You need to store successful patterns, search for similar solutions, run semantic lookup of past work, learn from previous tasks, or share knowledge between agents.
What do I get? / Deliverables
Patterns land in persistent vector memory with export, consolidation, and stats so future runs can semantically retrieve similar successful work.
- Timestamped memory JSON backup from export
- Consolidated memory store with post-run stats output
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is agent-tooling because the skill wires persistent vector memory into multi-agent workflows during product construction. Agent-tooling covers memory, hooks, and orchestration primitives rather than a single app feature surface.
Where it fits
After a successful API integration run, export and index the pattern so the next feature branch can retrieve it semantically.
When a recurring production issue appears, search memory for similar incident resolutions before spinning new workers.
Store post-mortem fixes from a release review so launch regressions trigger matching memories on the next deploy cycle.
Consolidate support-triage patterns agents used successfully so lifecycle and content agents reuse the same playbook.
How it compares
Use as procedural agent infrastructure, not a generic note app—pairs with orchestration hooks rather than replacing a hosted vector DB product.
Common Questions / FAQ
Who is memory-management for?
Solo and indie developers running claude-flow / AgentDB workflows who need persistent semantic memory across agent tasks and workers.
When should I use memory-management?
Use during Build when wiring agent tooling, during Operate when iterating on recurring production fixes, and whenever you need to store or search successful patterns—not for ephemeral one-off chats.
Is memory-management safe to install?
Scripts run shell, npx, and filesystem backup paths; review the Security Audits panel on this Prism page and audit what memory export contains before sharing backups.
SKILL.md
READMESKILL.md - Memory Management
#!/bin/bash # Memory Management - Backup Script # Export memory to backup file set -e BACKUP_DIR="${BACKUP_DIR:-./.backups}" TIMESTAMP=$(date +%Y%m%d_%H%M%S) BACKUP_FILE="${BACKUP_DIR}/memory_${TIMESTAMP}.json" mkdir -p "$BACKUP_DIR" echo "Backing up memory to $BACKUP_FILE..." npx @claude-flow/cli memory export --output "$BACKUP_FILE" echo "Backup complete: $BACKUP_FILE" #!/bin/bash # Memory Management - Consolidate Script # Optimize and consolidate memory set -e echo "Running memory consolidation..." npx @claude-flow/cli hooks worker dispatch --trigger consolidate echo "Memory consolidation complete" npx @claude-flow/cli memory stats --- name: memory-management description: > 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. --- # 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 ```bash npx @claude-flow/cli memory store --key "[key]" --value "[value]" --namespace patterns ``` **Example:** ```bash 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 ```bash npx @claude-flow/cli memory search --query "[search terms]" --limit 10 ``` **Example:** ```bash npx @claude-flow/cli memory search --query "authentication best practices" --limit 5 ``` ### Retrieve 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 ``` ### List 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 ``` ### Delete Entry Delete a memory entry ```bash npx @claude-flow/cli memory delete --key "[key]" --namespace [namespace] ``` ### Initialize HNSW Index Initialize HNSW vector search index ```bash npx @claude-flow/cli memory init --enable-hnsw ``` ### Memory Stats Show memory usage statistics ```bash npx @claude-flow/cli memory stats ``` ### Export Memory Export memory to JSON ```bash 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 1. Check memory for existing patterns before starting 2. Use hierarchical topology for coordination 3. Store successful patterns after completion 4. Document any new learnings