Files
ruflo/plugins/ruflo-rag-memory/EXAMPLES.md
T
randRuFlo bb6a958c53 fix(plugins): review of 9 plugins (group D) - verified against the real CLI/MCP, bump versions
Checked every CLI command, flag and MCP tool the skills tell the model to use
against ruflo 3.56.5 and the tool registry. Fixed what was false:

- workflows 0.6.6: MCP tool names with underscores that do not exist; gaia-bench
  has no --dry-run/--task-id (unknown flags are ignored, so the documented cost
  estimate started a billed run); opt-in guard for native workflows; stale smoke
- security-audit 0.3.4: non-existent `security report`, wrong `audit` usage,
  scan depth table that described phases the scanner lacks; --fix gated
- swarm 0.3.7: `swarm watch/health/shutdown` do not exist; swarm-watch.mjs poller
- rag-memory 0.3.5: `ruflo recall`/`memory bridge` do not exist; shell-quoting
  of user text in /recall
- testgen 0.3.2: tdd-repair now enforces that the test is not edited; shell
  quoting; invalid --limit
- rvf 0.3.6: export went through the public IPFS marketplace; now memory export
- ruvllm 0.3.4: provider claims and persistence claims corrected
- observability 0.3.4: no invented traces when nothing wrote spans
- plugin-creator 0.4.3: required plugin.json fields and tool existence check

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 11:33:24 -04:00

2.9 KiB

Memory Plugin Examples

Store and Recall Across Sessions

Example 1: Remember a Code Pattern

# Session 1
npx ruflo memory store \
  --key "pattern-concurrent-queue" \
  --value "Use a bounded queue with semaphore for concurrent task processing; limits parallelism safely" \
  --namespace patterns

# Session 2 (next day, different project)
npx ruflo memory search -q "concurrent queue safe processing"
# Returns: "Use a bounded queue with semaphore..."

Example 2: Persist Bug Fixes

# Session 1: Solved a race condition
npx ruflo memory store \
  --key "fix-race-async-cleanup" \
  --value "Race condition in cleanup: use AbortController to signal cleanup before task dispatch" \
  --namespace solutions \
  --tags "async,cleanup,race"

# Session 2: Hit similar bug
npx ruflo memory search -q "race condition async"
# Gets the fix immediately

Example 3: Agent with Memory Bridge

// In a Claude Code agent
async function researchAuthPatterns() {
  // Search cross-session memory
  const findings = await memory_search_unified({
    query: "OAuth2 PKCE refresh token security",
    limit: 5
  });
  
  // findings[0] might be from a session 3 weeks ago
  console.log(findings[0].value); // Cross-session knowledge!
}

CLI Workflow

# Store architectural decision
npx ruflo memory store \
  --key "arch-event-sourcing" \
  --value "Event sourcing for user actions; snapshots every 10 events for performance" \
  --namespace patterns

# List all stored patterns
npx ruflo memory list --namespace patterns

# Search by semantic meaning (HNSW, fast!)
npx ruflo memory search --query "event-driven architecture" --namespace patterns

# Retrieve by key
npx ruflo memory retrieve --key "arch-event-sourcing" --namespace patterns

# Delete old entry
npx ruflo memory delete --key "old-pattern" --namespace patterns

Memory Namespaces

Use the right namespace for your intent:

Namespace Use For Example
patterns Reusable code/design patterns Auth flows, caching strategies
solutions Bug fixes and workarounds Race condition fix, memory leak
feedback User corrections and notes "Test style should use beforeEach"
security Vulnerability patterns "SQL injection risk in ORM queries"
tasks Task context and outcomes "API refactor: migrated 8 endpoints"

Integration with Auto-Memory Bridge

Claude Code auto-saves session memories to ~/.claude/projects/*/memory/. Import them into AgentDB:

# Current project (MCP, from Claude Code)
memory_import_claude({})

# All projects
memory_import_claude({ allProjects: true })

# From a terminal, in a project that has the ruflo helpers
node .claude/helpers/auto-memory-hook.mjs import-all

Then search across them:

npx ruflo memory search -q "authentication patterns"
# Returns unified results from ALL projects + sessions