#20338: feat: add daedalus-memory plugin — trust-gradient memory with tri-color provenance
size: XL
## DAEDALUS: Trust-gradient memory for OpenClaw
OpenClaw's memory currently treats all stored facts with equal confidence. This plugin implements trust-differentiated memory based on the DAEDALUS dual-memory architecture.
Every stored fact gets tagged with provenance:
- 🔵 **Blue** (VERIFIED) — human-approved, treated as authoritative
- 🟢 **Green** (SUGGESTED) — AI-proposed, pending human review
- 🔴 **Red** (QUARANTINED) — rejected or stale, excluded from search
**Core invariant:** AI writes always enter as green. Green → blue requires explicit human approval. No automated path exists.
### What's included
- SQLite storage with trust transitions audit log (`node:sqlite`)
- 3 agent tools: `memory_search`, `memory_store`, `memory_forget`
- 8 CLI commands under `daedalus` (pending, approve, reject, resolve, info, stats, search, stale)
- Auto-recall via `before_prompt_build` hook
- Auto-capture via `agent_end` hook (conservative intent heuristics)
- 3 AXIOM validation rules (orphan, self-loop, duplicate)
- 7-day staleness check for unreviewed green facts
- 35-check E2E test suite — all passing
### Stats
- **13 files**, ~2,260 lines added
- Zero changes to OpenClaw core — plugin only
- `tsc --noEmit` passes with zero errors
### Research
This plugin implements concepts from peer-reviewed research (all CC BY 4.0):
- [Tri-Color Trust Model](https://doi.org/10.5281/zenodo.18510367) — Cristian Leu, University of Oradea
- [Dual-Memory Architecture with Trust Gradients](https://doi.org/10.5281/zenodo.18507663) — Cristian Leu, University of Oradea
- [ARIADNE: Neo4j Working Memory Specification](https://doi.org/10.5281/zenodo.18506520) — Cristian Leu, University of Oradea
### Why this matters
Current memory plugins (memory-core, memory-lancedb) focus on retrieval quality — better embeddings, better search. None address *trust provenance*: distinguishing what the human said from what the AI inferred. This plugin adds that missing layer.
Built as a plugin — zero changes to core. Activates via `plugins.slots.memory: "daedalus-memory"`.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds a new `daedalus-memory` plugin implementing trust-gradient memory with tri-color provenance (blue/green/red). The plugin provides SQLite-backed storage, 3 agent tools (`memory_search`, `memory_store`, `memory_forget`), 8 CLI commands, auto-recall/capture hooks, validation rules, and staleness checks. Zero changes to core — plugin only.
- **Missing dependency**: `@sinclair/typebox` is imported at runtime in `src/index.ts` but not declared in `package.json` `dependencies`. It currently resolves via workspace hoisting but will fail on standalone install. The `memory-lancedb` plugin correctly declares this dependency explicitly.
- **Trust model gap in `memory_forget`**: The `memory_forget` tool (called by the AI agent) can transition blue (human-verified) facts to red (quarantined) using `"human_reject"` as the trigger with `"agent"` as actor. This allows AI to effectively undo human verification, contradicting the plugin's core invariant that human decisions are protected from AI override.
- **Architecture is well-structured**: Clean separation into trust state machine (`trust.ts`), storage (`db.ts`), validation (`validator.ts`), formatting (`retrieval.ts`), commands (`commands.ts`), and plugin wiring (`index.ts`). Follows existing plugin patterns correctly.
- **Tests are thorough**: 35-check E2E suite covers DB operations, trust transitions, search exclusion, validation rules, staleness, formatting, CLI registration, and plugin export shape.
<h3>Confidence Score: 3/5</h3>
- Two issues should be resolved before merge: a missing runtime dependency and a trust model violation in memory_forget
- The plugin is well-architected and follows existing patterns, but has two concrete issues: (1) missing `@sinclair/typebox` dependency will cause a runtime failure on standalone install, and (2) the `memory_forget` tool allows AI to demote human-verified (blue) facts, which contradicts the plugin's stated core invariant. Neither is difficult to fix, but both should be addressed before merge.
- Pay close attention to `extensions/daedalus-memory/package.json` (missing dependency) and `extensions/daedalus-memory/src/index.ts` (trust model violation in memory_forget tool at line 232)
<sub>Last reviewed commit: 8a7dd0d</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#8795: feat(memory): add Redis-backed long-term memory plugin
by tf-gmail · 2026-02-04
76.5%
#19341: Mind Memory Fork
by juliopx · 2026-02-17
75.3%
#12596: fix(status): show third-party memory plugins as active instead of u...
by nhadaututtheky · 2026-02-09
74.7%
#22518: feat(extensions): add chromadb-memory plugin with multi-agent colle...
by ta3pks · 2026-02-21
73.5%
#19787: feat: Antigravity Fork - Token Economy, Mem0, sqlite-vec, Auto-Arch...
by msrovani · 2026-02-18
72.6%
#21631: feat(doctor): detect memory plugins in memory search health check
by tsukhani · 2026-02-20
72.5%
#14073: [wip]support OpenViking Memory Plugin
by Mijamind719 · 2026-02-11
72.5%
#4881: docs(plugin): clarify memory-lancedb is bundled (no npm install nee...
by AverageSuami · 2026-01-30
71.0%
#10486: feat: A2A protocol plugin
by benclarkeio · 2026-02-06
70.4%
#19967: feat(memory): add semantic clustering and enhanced MMR
by alihassan6520 · 2026-02-18
70.1%