One-Line Summary: SONA is ruflo's pattern-matching layer that learns which strategies tend to succeed for which task signatures, sitting one level above ReasoningBank — instead of replaying trajectories verbatim, SONA distills them into reusable patterns that bias the agent's planner toward known-good moves.

Prerequisites: ReasoningBank, trajectory learning, A* planner for agents

What Is SONA?

If ReasoningBank stores raw trajectories, SONA stores patterns extracted from them. A pattern is a (signature → strategy) pair: when the agent sees a task with this signature, the strategies that worked were these. The signature can be anything informative: task description embedding, project type, file types touched, stage of work.

SONA is reductive: it discards trajectory details to retain only what generalizes. That makes recall fast (pattern lookup is cheaper than trajectory retrieval), reduces storage, and produces guidance that the planner can act on directly without parsing trajectories.

The "neural" part is that the patterns themselves can be learned (rather than rule-based). In practice, SONA is a clustering layer over ReasoningBank entries with a periodic distillation pass that rewrites cluster summaries.

How It Works

A simplified pipeline:

  1. Trajectories land in ReasoningBank as the agent runs.
  2. Periodic clustering groups trajectories by signature similarity.
  3. Cluster summarization (LLM-as-summarizer) extracts the dominant strategy for each cluster.
  4. Pattern catalog stores (signature → strategy) entries.
  5. At runtime, the agent's planner consults SONA for the current task; matching patterns get loaded as planning hints.

The signature definition is the design choice. Coarse signatures (just task type) generalize well but miss nuance. Fine signatures overfit. SONA in production typically uses multi-component signatures (task + project + file type + stage) with weighted matching.

Why It Matters

SONA is the layer that turns "the system has memories" into "the system has learned." Without it, ReasoningBank is just a search index — useful but passive. With SONA, the system can suggest strategies the user never explicitly asked it to remember.

The honest qualifier: SONA's effectiveness depends on having enough trajectories with reliable outcome labels. In practice this means it works best for high-volume teams or shared deployments. For a solo developer with limited usage history, the patterns are too sparse to be useful.

Key Technical Details

  • Pattern hygiene: Stale patterns (worked once a year ago, no longer applicable) actively harm. Periodic re-validation against recent trajectories is essential.
  • Confidence scoring: Each pattern carries a confidence (how many trajectories support it, how recent). Low-confidence patterns are advisory; high-confidence patterns are stronger biases.
  • Pattern conflicts: Multiple patterns may apply with different recommendations. The planner has to merge or pick.
  • Privacy: Cross-team or cross-org pattern sharing leaks information about codebases. SONA in ruflo is per-tenant by default.
  • Cold start: A fresh deployment has no patterns. SONA bootstraps from public trajectories or shipped defaults.
  • The "neural" descriptor is mostly marketing: Most SONA implementations are clustering + LLM summarization, not neural networks. The name conveys the self-improving property, not the architecture.

How Harnesses & Frameworks Implement This

Harness / FrameworkSONA-equivalent layer
Claude CodeNone
Claude Agent SDKDIY
rufloFirst-class — SONA is a named subsystem
LangGraphDIY
AutoGenDIY
CrewAILimited
OpenAI Agents SDKTracing → manual analysis; no automated pattern layer
Codex CLI / Cursor

Connections to Other Concepts

  • reasoning-bank.md — SONA's input.
  • trajectory-learning.md — SONA is one shape of trajectory-derived learning.
  • micro-lora-adapters-at-the-harness-layer.md — A more parametric alternative.
  • adaptive-replanning.md — SONA patterns inform replanning.

Further Reading

  • ruvnet, ruflo USERGUIDE — SONA section.