Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ruvnet/ruflo/llms.txt

Use this file to discover all available pages before exploring further.

ruflo memory is the command surface for Ruflo’s persistent vector memory layer. Every entry is stored with an automatic ONNX embedding so that memory search can perform semantic similarity lookup — not just exact key matches. The backing store is a sql.js SQLite database (default path .swarm/memory.db), optionally accelerated by the HNSW index from @ruvector/core for 150×–12,500× faster retrieval on large collections.

Synopsis

ruflo memory <subcommand> [options]

Subcommands

SubcommandAliasDescription
initInitialize the memory database schema
storePersist a key/value pair with auto-generated embedding
retrievegetFetch a specific entry by key
searchSemantic or keyword search across all namespaces
listlsList entries, optionally filtered by namespace or tags
deletermDelete an entry by key
statsShow storage statistics, embedding provider, and HNSW state
configureconfigSet the memory backend, path, and HNSW parameters
cleanupPurge expired TTL entries and stale data
compressCompact the SQLite database
exportExport memory to a JSON file
importImport memory from a previously exported JSON file
distillCompress entries into structured intelligence (ADR-174)
backupCreate a timestamped backup of the memory database

Namespaces

Entries are scoped to a namespace — a logical partition of the memory store. Using namespaces keeps different types of knowledge separate and makes targeted searches faster.
NamespaceConventional use
defaultGeneral-purpose entries
patternsSuccessful code and workflow patterns
resultsTask outcomes and measurements
errorsFailures and the fixes that resolved them
notificationsHook-emitted notification log
The --namespace flag defaults to default on all subcommands. Omitting it never creates entries under the literal namespace "undefined" — that edge case is guarded in the CLI.

DB path resolution

The memory database path is resolved in this priority order:
  1. --path <path> flag (per-command override)
  2. CLAUDE_FLOW_DB_PATH environment variable
  3. $CLAUDE_FLOW_MEMORY_PATH/memory.db
  4. .swarm/memory.db in the current working directory

init

Create the memory database schema. Safe to call multiple times — exits cleanly if the database already exists (use --force to reinitialize from scratch).
ruflo memory init [options]
--backend / -b
string
default:"hybrid"
Storage backend: hybrid (SQLite + AgentDB), agentdb, sqlite, or in-memory.
--path / -p
string
Custom database file path.
--force / -f
boolean
default:"false"
Wipe and reinitialize the database (destructive).
--verbose
boolean
default:"false"
Show detailed schema output: tables created, indexes, HNSW configuration, and pattern learning settings.
--verify
boolean
default:"true"
Run a suite of verification tests after initialization and report pass/fail.
--load-embeddings
boolean
default:"false"
Pre-load the ONNX embedding model instead of lazily loading on first use.

store

Save a key/value entry and automatically generate a vector embedding for semantic search.
ruflo memory store --key <key> --value <value> [options]
--key / -k
string
required
Storage key within the namespace (e.g. api/auth, pattern/singleton).
--value
string
Text value to store. Can also be passed as the first positional argument.
--namespace / -n
string
default:"default"
Namespace to store the entry in.
--ttl
number
Time to live in seconds. Entries past their TTL are eligible for cleanup.
--tags
string
Comma-separated tags for grouping (e.g. auth,jwt,security).
--vector
boolean
default:"false"
Mark this entry for priority vector indexing (embedding is always generated regardless).
--upsert / -u
boolean
default:"false"
Update the value if the key already exists, rather than failing.
--path
string
Override the database file path.

retrieve

Fetch a single entry by its exact key and namespace.
ruflo memory retrieve --key <key> [options]
ruflo memory get --key <key> [options]     # alias
--key / -k
string
required
Key to retrieve. Can also be the first positional argument.
--namespace / -n
string
default:"default"
Namespace to look in.
--value-only
boolean
default:"false"
Print only the raw stored value to stdout with no decorators — suitable for piping into jq or JSON.parse.

Perform semantic, keyword, or hybrid search across stored entries. Returns results ranked by similarity score.
ruflo memory search --query <query> [options]
--query / -q
string
required
Search query. Can also be the first positional argument.
--namespace / -n
string
Restrict search to one namespace. Searches all namespaces if omitted.
--limit / -l
number
default:"10"
Maximum number of results to return.
--threshold
number
default:"0.7"
Minimum cosine similarity score (0–1). Results below this score are filtered out.Similarity score interpretation:
  • > 0.7 — strong match, use pattern directly
  • 0.5 – 0.7 — partial match, adapt before use
  • < 0.5 — weak match, consider creating a new entry
--type / -t
string
default:"semantic"
Search algorithm: semantic (cosine similarity over vectors), keyword (full-text), or hybrid (both combined).
--build-hnsw
boolean
default:"false"
Build or rebuild the HNSW index before searching. Enables the 150×–12,500× speedup on collections larger than ~1,000 entries.
--smart / -s
boolean
default:"false"
Use the SmartRetrieval pipeline: query expansion, Reciprocal Rank Fusion (RRF), Maximal Marginal Relevance (MMR), and recency weighting. Requires @claude-flow/memory with smartSearch support.
--path
string
Override the database file path.

list

List stored entries in a tabular view.
ruflo memory list [options]
--namespace / -n
string
Show only entries from this namespace.
--tags / -t
string
Filter by comma-separated tags.
--limit / -l
number
default:"20"
Maximum entries to display.

delete

Remove a single entry from the store.
ruflo memory delete --key <key> [options]
ruflo memory rm --key <key> [options]    # alias
--key / -k
string
required
Key to delete. Can also be passed as the first positional argument.
--namespace / -n
string
default:"default"
Namespace to delete from.
--force / -f
boolean
default:"false"
Skip the confirmation prompt.

stats

Show a full memory statistics dashboard including backend details, entry counts, storage size, oldest/newest entry timestamps, the active embedding provider, and HNSW index status.
ruflo memory stats [--path <dbPath>]
The embedding section distinguishes between semantic providers (MiniLM, MPNet, BGE, agentic-flow) and the 128-dim hash fallback. The HNSW section reports both live in-process state and the persistent count of indexed vectors from the MCP memory_stats tool.

distill

Compress raw memory_entries into structured intelligence records using the ADR-174 distillation pipeline.
ruflo memory distill [options]
Distillation extracts high-signal patterns from accumulated entries and writes them to the patterns table for use by the SONA router and ReasoningBank.

backup

Create a timestamped copy of the memory database.
ruflo memory backup [--output <path>]
--output
string
Destination path for the backup file. Defaults to .swarm/memory-backup-<timestamp>.db.

Examples

# Initialize the memory database
ruflo memory init

# Store a pattern with a namespace and tags
ruflo memory store \
  -k "auth/jwt-refresh" \
  --value "Implement JWT refresh with sliding window; revoke on logout" \
  -n patterns \
  --tags "auth,jwt,security"

# Update an existing entry in place
ruflo memory store -k "auth/jwt-refresh" --value "Updated pattern" --upsert
Always run ruflo memory search -q "<task keywords>" at the start of a complex task. If results come back with scores above 0.7, Ruflo has seen a similar task before and can reuse the stored approach — saving tokens and improving consistency.
The --force flag on memory init is destructive: it drops and re-creates all tables. Always run memory backup before reinitializing.

Build docs developers (and LLMs) love