Agents that forget are agents that repeat mistakes. Ruflo’s memory system gives every agent — and the swarms they form — a persistent, searchable store of patterns, decisions, and outcomes that survives process restarts and accumulates value over time. When the same class of problem appears again, the router retrieves the relevant past solution instead of starting from scratch. Under the hood, memory is backed by AgentDB with HNSW (Hierarchical Navigable Small World) indexing. HNSW turns a naïve O(n) brute-force scan into a sub-millisecond approximate nearest-neighbour search — benchmarked at 150x–12,500x faster than brute force at production-sized indices.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.
Memory Backends
| Backend | Description | When to Use |
|---|---|---|
agentdb | HNSW-indexed vector database; 150x–12,500x faster search, full semantic retrieval | Large indices, production workloads |
sqlite | Lightweight local SQLite store; structured queries, no HNSW | Small projects, structured-only data |
hybrid | SQLite for structured queries + AgentDB for semantic search — default | Recommended for all general use |
in-memory | Fast, ephemeral; no disk persistence | Testing, short-lived pipelines |
hybrid (ADR-009): structured lookups (getByKey) route to SQLite, semantic searches (semanticSearch, search) route to AgentDB. You get the best of both backends transparently.
Vector Search Details
| Property | Value |
|---|---|
| Embedding dimensions | 384 (local ONNX) or 1536 (OpenAI) |
| Search algorithm | HNSW — sub-millisecond retrieval |
| Similarity metric | Cosine similarity, scored 0–1 |
| Score > 0.7 | Strong match — use the retrieved pattern directly |
| Score 0.5–0.7 | Partial match — adapt the retrieved pattern |
| Score < 0.5 | Weak match — create a new pattern |
hnswRetrievalCount vs bruteForceRetrievalCount stats (available in v3.7+) show which path your queries actually hit, so you can tune the index parameters (hnswM, hnswEfConstruction) for your workload.
CLI Memory Commands
TypeScript API
The@claude-flow/memory package exports UnifiedMemoryService (and its canonical alias MemoryService) along with fluent query builders and factory functions.
RVF — RuVector Format
RVF (RuVector Format) is Ruflo’s persistence format for saving and restoring agent memory across sessions. It packages the HNSW index, metadata, and learning state into a single portable snapshot that can be backed up, transferred, or loaded on a fresh instance. Theruflo-rvf plugin and @claude-flow/memory RvfMigrator handle RVF read/write. Key operations:
- Save —
memory.backupornpx ruflo@latest memory backupflushes a final RVF snapshot before shutdown - Restore — on initialisation, the service loads the most recent RVF snapshot automatically when
persistenceEnabled: true - Bidirectional migration —
RvfMigratorcan round-trip entries between RVF and the AgentDB/SQLite backends
RVF snapshots are taken automatically on a configurable interval (
snapshotInterval, default every 1,000 store() calls) and on clean shutdown. Set snapshotInterval: 0 to disable interval-based snapshots while still getting the final flush on close().Memory Tiers (AgentDB Hierarchical Store)
AgentDB implements three tiers that mimic human memory:memory distill command (or the background consolidate worker). The agentdb_hierarchical-store and agentdb_hierarchical-recall MCP tools expose tier-aware operations directly.
MCP Tools
| Tool | Description |
|---|---|
memory_store | Store a key-value pair with optional namespace and tags |
memory_search | Semantic vector search — returns entries ranked by similarity score |
memory_usage | Report memory backend stats: index size, cache hit rate, entry count |
memory_searchbefore starting any task — retrieve relevant past patterns- Complete the task
memory_storeafter a successful outcome — save the pattern for future retrieval
Neural Learning Integration
Memory is not just a lookup table — it feeds the neural learning pipeline. Every entry stored viamemory_store or a post-task hook can flow into:
neural_train— the MCP tool that triggers a SONA learning sweep over recent patterns- ReasoningBank — distils trajectories into reusable patterns via the RETRIEVE → JUDGE → DISTILL → CONSOLIDATE → ROUTE cycle
- PatternLearner — extracts and indexes recurring patterns for fast future retrieval
- LearningBridge — connects memory insights to the SONA neural pipeline at 0.12 ms/insight
