[Dream Cycle 2026-07-28] memory: MemIR provenance-role collapse gap in AgentDB flat storage + plugins,automation scan
- Dominant language
- TypeScript
- Stars
- 72.7k
- Forks
- 8.6k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 83
Description
## Tonight's Rotation
| Field | Value |
|-------|-------|
| Date | 2026-07-28 |
| SLOT | 3 |
| Deep Surface | **memory** |
| Scan Surfaces | **plugins**, **automation** |
| Session Commit | `a158418a8b774f678dd36831be4ad1d5619b3395` |
| ADR | ADR-322 |
| Branch | `dream/2026-07-28-memory-typed-provenance` |
---
## Drift Check
**Prior dream-cycle issues (last 7):**
| # | Date | Deep Surface | Title Fragment |
|---|------|-------------|----------------|
| #2792 | 2026-07-27 | intelligence | PoTRE 49.92% HLE — heterogeneous ensembles |
| #2783 | 2026-07-26 | security | ShareLock MCP threshold poisoning + ChannelGuard gap |
| #2778 | 2026-07-25 | performance | AA-AgentPerf 23.6× gap |
| #2768 | 2026-07-24 | swarm | ClawArena privilege-granting bottleneck |
| #2763 | 2026-07-23 | memory | OAS budget-operator selection +48% consolidation gap |
| #2760 | 2026-07-22 | intelligence | SCM routed memory 86% LongMemEval |
| #2752 | 2026-07-21 | security | NCA gate + PlanFlip planning-phase injection |
**Drift flags:**
- Same finding phrase in ≥3 prior titles: **NONE** — no surface or phrase repeats 3+ times in 7 issues. Proceeding normally.
- **⚠️ NO dream-cycle PR merged in 14 nights** — all 7 recent issues remain OPEN with no corresponding merged PR. `needs-merge` review recommended.
- Prior gist self-score <5 three consecutive nights: **NO** — estimated score for #2792 (intelligence, PoTRE): 10/10 (A-grade benchmark=2, 4 competitor rows=2, 3 specific actions=2, witness present=2, <1500 words=1, novel finding=1).
**Note on today's surface vs 2026-07-23 (memory):** Prior memory deep covered OAS budget-operator budget selection gap (consolidation-always strategy). Today's finding is **provenance-role collapse** — a distinct architectural gap in flat memory storage, not consolidation strategy.
---
## Deep Dive Findings — memory
### SOTA Summary
Three converging 2026 papers identify flat/untyped memory as the dominant failure mode in long-session multi-agent systems:
1. **MemIR — Typed Memory Intermediate Representation** (arXiv 2605.25869, May 2026)
Traditional memory stores interactions as flat text, causing "provenance-role collapse" — agents cannot distinguish whether a retrieved fact came from a tool result, a user claim, or another agent's output. MemIR introduces a 3-layer representation: raw evidence → retrieval cues → factual claims, with multi-route atomic projection and provenance-scoped utilization (factual authorization restricted to supported claim atoms). Outperforms all baselines on LoCoMo and BEAM-100K. **Grade A** (peer-reviewed 2026 paper).
2. **MemSyco-Bench** (arXiv 2607.01071, Jul 2026)
Retrieved memories induce sycophancy: agents over-align with user-stated memories at the cost of factual accuracy. Covers 5 tasks: rejecting bad factual memories, respecting memory scope, resolving memory↔evidence conflicts, tracking updates, and personalization. **Grade A**.
3. **Always-On Agents survey + AOEP-v0** (arXiv 2606.30306, Jun 2026)
Survey of 435 works shows literature concentrates on accumulation/retrieval; governance, recovery, and forgetting are under-researched. Introduces AOEP-v0 evaluation protocol scoring state mutation and recovery obligations. **Grade A**.
4. **Mem0 April 2026 Algorithm** — hybrid triple-scorer (semantic similarity + BM25 + entity matching): LoCoMo **92.5**, LongMemEval **94.4**, BEAM-1M **64.1**, BEAM-10M **48.6**, +29.6 pts temporal reasoning, +23.1 pts multi-hop vs 2025 baseline. 3.74× token efficiency. **Grade B** (vendor benchmark, crosschecked against public blog).
5. **H-MEM** (EACL 2026, arXiv 2507.22925) — 4-level hierarchy (Domain → Category → Memory Trace → Episode) with index-based routing avoids exhaustive similarity; consistently outperforms MemoryBank across all 5 LoCoMo QA tasks. **Grade A** (ACL Anthology).
### Gap vs Current Ruflo
| Gap | Current Ruflo State | SOTA Approach |
|----|--------------------|-|
| **Provenance typing** | Flat text entries in AgentDB — no separation by source type | MemIR 3-layer typed representation |
| **Cross-agent namespace safety** | Multiple agents write to same `collaboration`/`patterns` namespaces without claim metadata | Provenance-scoped utilization prevents unauthorized claim promotion |
| **Sycophancy guard** | No memory conflict resolution; agents can retrieve user-stated falsehoods unchallenged | MemSyco-Bench tasks 3+4 (conflict resolution, update tracking) |
| **Memory governance lifecycle** | EWC++ consolidation; no explicit auditing/rollback/forgetting API | AOEP-v0 scores state mutation + recovery obligations |
| **Retrieval scoring** | HNSW cosine (single signal) | Mem0 triple-scorer: semantic + BM25 + entity; 3.74× token efficiency |
| **Hierarchical routing** | Flat HNSW search across all entries | H-MEM 4-level index-based routing; avoids exhaustive scans |
### Recommended Action
Implement ADR-322 (filed this session):
1. **Add `provenance_type` field to AgentDB `vector_indexes`** (values: `user_claim`, `agent_output`, `system_observation`, `tool_result`, `unknown`). Backward-compat default = `unknown`. Update `memory store` CLI + `memory_store` MCP tool to accept and store it.
2. **Plugin SDK provenance requirement**: All official plugins MUST pass `provenance_type` when writing to shared namespaces. Add `pre-edit` hook lint gate to catch flat namespace writes in plugin code.
3. **Webhook-trigger for `audit` worker**: Wire the `audit` background worker to a new `trigger_audit` MCP tool so it fires on-demand when a CI failure or security alert arrives — matching self-healing MCP-orchestrator pattern from production mid-2026.
---
## Scan Findings — plugins
**Source:** Zylos Research (May 2026), GitHub "Continuous AI" technical preview (Feb 2026), CrewAI changelog.
**Signal:** GitHub Continuous AI allows engineers to write workflow logic in plain Markdown; CrewAI Flows added event-driven mode; Microsoft Agent Framework ships A2A + MCP built in. OpenAgents is the only framework with native MCP + A2A dual support.
**One-sentence finding:** Ruflo's 21 IPFS-registered plugins write flat text to shared memory namespaces without claim provenance metadata, making them architecturally incompatible with the MemIR-style typed memory being proposed in ADR-322 — the plugin SDK contract needs updating before ADR-322 lands.
**Competitive signal:** CrewAI now has structural memory tiers (entity/short/long-term) with A2A support — plugins inherit tier context. Ruflo's plugin memory writes have no analogous tier or provenance enforcement today.
---
## Scan Findings — automation
**Source:** Zylos Research "Agentic CI/CD" (May 2026), Medium "Self-Healing Kubernetes with AI + MCP" (Jul 2026).
**Signal:** Self-healing CI/CD is the most mature agentic automation capability in production mid-2026. The pattern: alert webhook → orchestrator agent → specialist agents (diagnose → remediate → verify → learn) → auto-close incident. MCP is the standard glue layer; CrewAI Flows event-driven mode enables declarative trigger/response chains.
**One-sentence finding:** Ruflo's `audit` background worker runs on a cron schedule rather than on alert signal; wiring it to an event trigger (webhook or MCP `trigger_audit`) is the minimal step to match mid-2026 self-healing production patterns.
---
## Competitors Reviewed
| Competitor | Memory Architecture | Plugin Memory | Automation / Self-healing |
|------------|--------------------|----|--|
| **LangGraph** | Graph state checkpoint + time-travel; flat vector retrieval | No typed registry; external stores | LangGraph Platform; event-based workflows |
| **AutoGen** | Flat conversation history + external vector store | No typed registry | Pluggable tools; no webhook trigger |
| **CrewAI** | Entity + short-term + long-term tiers (structural) + A2A | Tier-aware memory context | CrewAI Flows event-driven mode (2026) |
| **OpenAI Agents SDK** | Context-window only; stateless | Native tool-calling only | Stateless; no self-healing |
| **Mem0** | Triple-scorer hybrid (sem+BM25+entity); 21 integrations | Flat facts, no provenance | — |
---
## Gist / Report Link
Full SOTA report with benchmarks and witness stamp committed to branch:
[`docs/dream-cycle-2026-07-28-memory.md`](https://github.com/ruvnet/ruflo/blob/dream/2026-07-28-memory-typed-provenance/docs/dream-cycle-2026-07-28-memory.md)
*(No external gist — `gh` CLI unavailable in this session; report is branch-committed and witness-stamped.)*
---
## Witness
| Field | Value |
|-------|-------|
| Session commit | `a158418a8b774f678dd36831be4ad1d5619b3395` |
| Report SHA-256 | `43158830adbafd7b1a8e755ac8a1c68b2bdf3b700536ea2ba16e833cb82e8296` |
| Witness stamp | `098f7d45fb76dcb4388818c5d1678d2d14ad546457613fc87b9e139df52b14c0` |
**Verify:** `sha256sum docs/dream-cycle-2026-07-28-memory.md` → concat with session commit → `sha256sum` → must equal witness stamp.
Contributor guide
Research direction
Start with ADR-322 and docs/dream-cycle-2026-07-28-memory.md, then trace AgentDB vector_indexes, the memory store CLI, the memory_store MCP tool, official plugin writes, and the audit worker. Done means the listed provenance field and plugin write requirement are addressed across those surfaces, with the requested audit trigger path also handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, databases, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100