Memory tools let agents accumulate knowledge across sessions, retrieve it semantically at the start of every task, and improve routing accuracy through neural training. The underlying store is HNSW-indexed via AgentDB, giving sub-millisecond vector search across large pattern libraries. The SONA (Self-Optimizing Neural Architecture) system and ReasoningBank sit on top of this store and power the intelligence loop that makes Ruflo smarter over time.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_search
Semantic vector search across agent memory. Call this before starting any task to surface patterns, prior implementations, and known errors that are relevant to the current work. This is the single most impactful habit for improving agent output quality over time.
Natural language search query. Ruflo embeds this using MiniLM (384 dimensions, local ONNX — no API call) and performs HNSW approximate nearest-neighbor search.
Memory namespace to search. Omit to search all namespaces. Common namespaces:
| Namespace | Contents |
|---|---|
patterns | Successful implementation strategies |
results | Completed task outputs |
errors | Known failure modes and mitigations |
architecture | Design decisions and ADR content |
Maximum number of results to return. Increase for broader exploration; keep low for targeted retrieval in time-sensitive tasks.
Minimum cosine similarity score (0–1) for a result to be included. Results below this threshold are discarded.
| Score | Meaning | Action |
|---|---|---|
| > 0.7 | Strong match | Use the pattern directly |
| 0.5–0.7 | Partial match | Adapt the pattern to the current context |
| <0.5 | Weak match | The pattern is not relevant; create a new one |
memory_store
Store knowledge with vector embeddings for future retrieval. Call this after completing a task successfully to make the solution available to future sessions. The content is embedded locally and indexed into HNSW immediately — no API call required.
Unique identifier for this memory entry. Use descriptive, namespaced keys like
auth-jwt-pattern or perf-n+1-fix-2025-01. Keys are overwritten on collision.Content to store. Write in plain language that will be meaningful to a future search query. Include: what you did, why it worked, any gotchas, and relevant code snippets.
Memory namespace. Use the recommended namespaces for consistent retrieval:
patterns— Proven implementation strategiesresults— Completed task summarieserrors— Known failure modes with mitigationsarchitecture— Design decisions and ADR content
Time to live in seconds. If set, the entry expires and is removed from the index automatically. Omit for permanent storage.
memory_usage
Get memory system statistics including total stored entries, namespace breakdown, database size, and cache performance.
Total number of entries across all namespaces.
Per-namespace entry counts, e.g.
{ "patterns": 42, "errors": 18, "results": 103 }.Total AgentDB database size on disk in bytes.
LRU cache hit rate (0–1) for recent retrievals. Values below 0.5 indicate the cache size should be increased.
neural_train
Train the SONA neural learning system on stored patterns. SONA (Self-Optimizing Neural Architecture) uses the patterns in memory to improve routing accuracy, agent selection, and task→solution mapping. Run this periodically or after a productive session.
Patterns namespace to train on. Defaults to the
patterns namespace. Training on a focused namespace produces more targeted routing improvements.Number of training iterations. Higher values produce more refined routing but take longer. Typical range: 10–100. The system uses EWC++ (Elastic Weight Consolidation) to prevent forgetting previously learned patterns during new training runs.
neural_status
Get the current status of the SONA neural system and the ReasoningBank.
System status:
ready, training, or degraded.Number of patterns indexed in the ReasoningBank.
Current routing accuracy score (0–1) measured against a held-out validation set.
ISO 8601 timestamp of the last
neural_train run.neural_patterns
Query the ReasoningBank for patterns that match a natural language query. This is a lower-level alternative to memory_search that queries the trained neural representation directly rather than the raw vector store, and may surface different results for abstract or cross-domain queries.
Natural language query matched against the ReasoningBank’s learned representations.
Maximum number of matching patterns to return.
Intelligence Loop
All memory tools participate in the five-stage intelligence loop that runs automatically on each session:session-restore → intelligence.init(), session-end → intelligence.consolidate()). You can inspect its state at any time:
