[Dream Cycle 2026-06-23] memory: semantic drift from repeated summarization cycles — AgentDB has no governance layer + plugins,automation scan
- Dominant language
- TypeScript
- Stars
- 72.6k
- Forks
- 8.6k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 85
Description
## Tonight's Rotation
| Field | Value |
|-------|-------|
| **SLOT** | 3 |
| **DEEP surface** | memory |
| **SCAN surfaces** | plugins, automation |
| **Session commit** | `ec1a18799651130fa7c98361219a54c4672cfbdf` |
| **Date** | 2026-06-23 |
| **ADR** | ADR-166 |
---
## Drift Check
- **Prior dream-cycle issues (last 7):** #2435 (2026-06-22, DEEP=intelligence, ADR-165), #2429 (2026-06-21, DEEP=security, ADR-164), #2427 (2026-06-20, DEEP=performance, ADR-163), #2419 (2026-06-19, DEEP=swarm, ADR-162), #2410 (2026-06-18, DEEP=memory, ADR-161), #2401 (2026-06-17, DEEP=intelligence), #2393 (2026-06-16, DEEP=security)
- **Memory repetition check:** #2410 (2026-06-18) covered bi-temporal HNSW (Engram +10.4pp), OPD-Evolver, CoreMem Riemannian retrieval, MemTrace, GateMem, User-as-Code. Tonight's finding (semantic drift from repeated summarization cycles + write-path governance gap) is orthogonal — it addresses the *write* side of the memory stack vs #2410's *retrieval* side. No substitution needed.
- **⚠️ needs-merge ACTIVE (29 nights):** All 7 listed issues remain OPEN; zero dream-cycle PRs merged in 29 nights. Human reviewer should prioritize oldest open dream-cycle PR.
- **ADR numbering:** Highest committed = ADR-154; in-flight PRs claim ADR-155–165. Tonight uses **ADR-166**.
- **Self-score of last night's gist (#2435, intelligence — FLARE myopic commitment gap — SONA has no lookahead simulation):**
- Grade A/B benchmark (FLARE arXiv:2601.22311 Grade B, AAAI 2026 arXiv:2511.17332v2 Grade B): ✅ 2 pts
- ≥4 competitor rows (LangGraph, CrewAI, AutoGen, OpenAI Agents SDK, Ruflo — 5 rows): ✅ 2 pts
- Specific actions (ADR-165 depth-3 lookahead buffer, `lookaheadEnabled: false` flag, 1–10ms cost estimate): ✅ 2 pts
- Witness present (session commit + SHA-256 + witness stamp): ✅ 2 pts
- <1500 words: ✅ 1 pt
- Novel finding (SONA myopic commitment gap — no lookahead at planning layer): ✅ 1 pt
- **Self-score: 10/10**
- **gh CLI:** Not available in environment — FALLBACK=true. Gist not published externally; stored at `v3/docs/research/dream-2026-06-23-memory.md` in PR branch.
---
## Deep Dive Findings — Memory
### SOTA Summary (2026-06-23)
| Finding | Source | Confidence |
|---------|--------|------------|
| SSGM: repeated summarization cycles cause semantic drift and topology-induced knowledge leakage in long-lived agent memory; three-mechanism governance framework proposed (consistency verification, temporal decay modeling, dynamic access control) | arXiv:2603.11768 (Mar 2026) | B — paper claim, abstract-level; no public benchmark |
| HyMem: dual-tier dynamic retrieval scheduling (lightweight summary tier + on-demand deep LLM tier) achieves 92.6% computational cost reduction vs full-context on LOCOMO and LongMemEval while maintaining SOTA-parity performance | arXiv:2602.13933 (Feb 2026) | B — paper benchmark crosschecked |
| Active Context Compression (Focus agent): autonomous "sawtooth" compression (compress-and-prune) achieves 22.7% token reduction (14.9M→11.5M tokens) with identical accuracy (3/5=60%) on SWE-bench Lite; ~6 compressions/task | arXiv:2601.07190 (Jan 2026) | B — small-n=5 benchmark, reproducible methodology |
| Memory survey (arXiv:2603.07670): formalizes write–manage–read loop; identifies learned forgetting, causal retrieval, and trustworthy reflection as the three open 2026 research gaps | arXiv:2603.07670 (Mar 2026) | A — systematic survey of reproducible literature |
| Only 1-in-12 enterprises operates at full multi-agent maturity; memory governance cited as top production blocker | FifthRow enterprise survey Apr 2026 | C — single vendor survey, labeled |
### Gap vs Current Ruflo
| Component | Current State | Gap |
|-----------|---------------|-----|
| AgentDB write path | Append-only; no pre-commit consistency gate | Any summarized memory is written regardless of semantic fidelity |
| ReasoningBank | HNSW trajectory store with binary success/fail verdicts | No drift detection between original trajectory and stored pattern |
| Memory consolidation | Manual only; no automated summarization cycle | No quality verification on any compression step |
| HNSW retrieval | Flat cosine similarity (ADR-161 adds bi-temporal schema) | No temporal decay weighting on retrieval scores |
| Memory governance | None documented | No SSGM-equivalent layer — zero consistency, decay, or topology-leak protection |
### Recommended Action
**ADR-166** (filed in this PR): Implement `MemoryGovernor` middleware with 3-phase write-path gate:
1. **Consistency check**: cosine similarity between original chunk embedding and summary embedding must be ≥0.85 to commit; else route to `PendingReview` queue
2. **Temporal decay tagging**: attach `decay_factor` (λ=0.05 default) for `exp(-λ·age_days)` retrieval weighting
3. **Topology leak scan**: reject writes where summary entity set overlaps >30% with entities from a different security context
Feature-flagged (`CLAUDE_FLOW_MEMORY_GOVERNANCE=false` by default). Estimated scope: <400 lines, no new dependencies.
---
## Scan Findings — Plugins
**Source:** fbakkensen.github.io (Mar 2026), agensi.io marketplace, github.com/agentic-community/mcp-gateway-registry
| Finding | Source | Confidence |
|---------|--------|------------|
| Claude Code, GitHub Copilot, Cursor, OpenAI Codex, and Gemini CLI all ship incompatible plugin formats; no universal cross-platform standard exists | fbakkensen.github.io Mar 2026 | C — practitioner blog, labeled |
| SKILL.md open standard emerging for cross-platform plugin portability across Claude Code, Codex CLI, Cursor, Gemini CLI | agensi.io + community | C — vendor + community claim, labeled |
| Agensi marketplace runs automated security scans on submitted plugins; 80/20 revenue split for plugin creators | agensi.io 2026 | C — vendor site, labeled |
**Competitive signal:** LangGraph, CrewAI, and AutoGen plugins are framework-native and non-portable. Ruflo's 21-plugin IPFS/Pinata registry is architecturally differentiated on decentralization, but lacks SKILL.md cross-platform compatibility and automated security scanning — two emerging ecosystem table-stakes.
**One-sentence finding:** Plugin marketplace fragmentation persists in 2026 (5 incompatible formats across major tools); Ruflo's IPFS registry is decentralized but lacks SKILL.md portability and automated security scanning, ceding ecosystem reach to emerging standards — no ADR needed (implementation-level: add SKILL.md manifest emission to `plugins install` output).
---
## Scan Findings — Automation
**Source:** arXiv:2603.22386 (workflow optimization survey), arXiv:2509.11079 (DAAO), FifthRow enterprise survey Apr 2026
| Finding | Source | Confidence |
|---------|--------|------------|
| DAAO: Difficulty-Aware Agentic Orchestration dynamically adjusts workflow complexity per query — simpler workflows for easy queries, complex multi-agent strategies for harder ones | arXiv:2509.11079 | B — paper claim, abstract-level |
| Static workflow templates vs dynamic runtime graph methods: survey shows dynamic methods achieve higher accuracy on heterogeneous task mixes, at cost of planning overhead | arXiv:2603.22386 (Mar 2026) | B — survey methodology |
| Only 1-in-12 enterprises at full multi-agent maturity; most blocked by static, non-adaptive orchestration | FifthRow Apr 2026 | C — single vendor survey, labeled |
**Competitive signal:** Ruflo's 17 hooks + 12 workers fire on static lifecycle events (pre-task, post-edit, etc.); no difficulty-aware dynamic routing exists. This mirrors the static workflow gap identified by arXiv:2603.22386.
**One-sentence finding:** 2026 automation research shows difficulty-aware dynamic workflow scheduling (DAAO) consistently outperforms static event-triggered hooks on heterogeneous task mixes; Ruflo's hook system fires statically and has no query-complexity signal — no ADR needed (implementation-level: add complexity classifier to `hooks route` dispatch).
---
## Competitors Reviewed
| Framework | Memory Governance | Drift Detection | Auto-Compression | Plugin Standard | 2026 Signal |
|-----------|------------------|----------------|------------------|-----------------|-------------|
| **LangGraph 0.4** | Checkpointer (state snapshots + time-travel replay) | No semantic drift detect | No | None (proprietary LangSmith) | Apr 2026: distributed runtime |
| **CrewAI 0.105** | Pluggable backends (Qdrant, Chroma) | No | No | No (proprietary) | Jun 2026: pluggable default backends |
| **AutoGen 1.0 GA** | Session-scoped typed tools | No | No | No | Feb 2026: event-driven GA; maintenance mode |
| **OpenAI Agents SDK** | Stateless; Memory API beta | No | No | No | 2026: platform integration matured |
| **Mem0** | Multi-signal fusion + update/delete API | Partial (entity-level update) | Yes (selective) | N/A | Apr 2026: LoCoMo 92.5, LongMemEval 94.4 |
| **Ruflo 3.6.10** | **None** | **No** | No | IPFS/Pinata (proprietary) | Fastest SONA 0.0043ms; governance gap |
---
## Report Link
> `gh gist create` not available in environment (FALLBACK=true). Report stored in branch.
**Report file**: [`v3/docs/research/dream-2026-06-23-memory.md`](https://github.com/ruvnet/ruflo/blob/dream/2026-06-23-memory/v3/docs/research/dream-2026-06-23-memory.md)
**ADR**: [`v3/docs/adr/ADR-166-dream-cycle-memory-governance-semantic-drift.md`](https://github.com/ruvnet/ruflo/blob/dream/2026-06-23-memory/v3/docs/adr/ADR-166-dream-cycle-memory-governance-semantic-drift.md)
---
## Witness
| Field | Value |
|-------|-------|
| **Session commit** | `ec1a18799651130fa7c98361219a54c4672cfbdf` |
| **Report SHA-256** | `23a6aee55f45b2de94ca35cd870feda04a98c33e58e07b826cae2b11b5de68e3` |
| **Witness stamp** | `f54252f86de2fbcf96044fce81fe62719fde0ef02e0f64a17bbe2266d474167f` |
**Verifier**: `sha256sum dream-2026-06-23-memory.md` → must equal Report SHA-256 → concat `ec1a18799651130fa7c98361219a54c4672cfbdf` → `sha256sum` → must equal witness stamp.
Contributor guide
Research direction
Start with v3/docs/research/dream-2026-06-23-memory.md and v3/docs/adr/ADR-166-dream-cycle-memory-governance-semantic-drift.md. Trace the AgentDB write path, ReasoningBank, memory consolidation, and HNSW retrieval areas described there; the work is done when the proposed governance behavior is implemented behind the stated feature flag and verified against the three listed checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100