mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-25 22:53:17 +09:00
Dream-cycle #2760 (SCM routed memory 86% LongMemEval): agents retrieve dramatically better on long-memory workloads when queries are routed to the RIGHT memory tier — episodic (session recall), semantic (learned patterns), or procedural (skills/recipes). Ruflo had all three tiers writing to different namespaces but `memory search` never discriminated. v1 MVP: keyword-scored classifier. Ships two integration surfaces: 1. Standalone: `ruflo memory classify -q "…" [--intent auto|mixed|episodic| semantic|procedural]` — prints the resolved intent + confidence + suggested namespaces. `--format json` for pipelines. 2. Search hint: `ruflo memory search -q "…" --intent auto` — logs the SCM router's decision + suggests a specific --namespace value the user can rerun with. Intentionally does NOT mutate the search backend behavior in v1 — the routing is advisory so no baseline retrieval is disturbed. v2 will apply when the search backend adds a multi-namespace OR filter. Namespace map (matches ruflo's actual write conventions): episodic → sessions, session-checkpoints, trajectory, trajectories, routing-outcomes, commands, feedback semantic → patterns, learned-patterns, adr-patterns, adr-edges, reasoning-patterns, concepts procedural → skills, agents, workflow-templates, playbooks, recipes Classifier weighting: keyword length / 6 (longer phrases score higher because they're less ambiguous — "how do i" beats "how"). Confidence threshold 0.35; below → mixed fallback so a low-confidence guess doesn't misroute. E2E: "when did we last touch auth" → episodic (conf 100%) "how does JWT work" → semantic (conf 100%) "how do I onboard a new coder subagent" → procedural (conf 100%) "auth" → mixed (conf 0, no keywords) Regression tests: 7/7 pass (three canonical intents + mixed fallback + explicit override + auto delegates to classifier + mixed explicit). Refs: dream-cycle #2760 (2026-07-22). Co-Authored-By: RuFlo <ruv@ruv.net>