---
title: "Dewee Memory: When AI must do more than remember"
url: "https://zuey.me/articles/dewee-memory-khi-ai-khong-chi-biet-nho?lang=en"
locale: en
access: free
full_text: true
published_at: "2026-10-28T07:21:47.097Z"
tags: ["Dewee", "AI Agents", "Context Engineering", "LLM"]
translations:
  vi: "https://zuey.me/articles/dewee-memory-khi-ai-khong-chi-biet-nho.md?lang=vi"
  zh: "https://zuey.me/articles/dewee-memory-khi-ai-khong-chi-biet-nho.md?lang=zh"
  ko: "https://zuey.me/articles/dewee-memory-khi-ai-khong-chi-biet-nho.md?lang=ko"
  ja: "https://zuey.me/articles/dewee-memory-khi-ai-khong-chi-biet-nho.md?lang=ja"
---
# Dewee Memory: When AI must do more than remember

> An engineering deep dive into Dewee's multi-layer memory architecture: temporal facts, reconciliation, Knowledge Graph, Dreaming, Knowledge Vault, Reflex/Jev admission and tenant governance.

AI agents can write thousands of lines of code, browse the web, operate tools and complete complex projects. Yet many still fail at the simplest question: **“Didn't I tell you this yesterday?”** :))))

While Mem0, Supermemory, Letta, ChatGPT and Claude Code are tackling long-term memory in different ways, building [Dewee](https://dewee.sh) taught us something important: **storing information is the easy part. Deciding what deserves to be remembered, whether it is still true, who may access it, and when it should be injected back into the model is the hard part.**

This is an architecture-level analysis grounded in the Dewee `dev` source at commit `5abb8d5` on October 28, 2026. It distinguishes implemented code, opt-in capabilities, and claims that still need empirical benchmarks.

### 1/ Storage is not memory

Suppose I say today, “I'm CTO at company A,” and tomorrow, “I'll join company B next month.” Two months later, I ask where I work now. A vector search can retrieve both sentences, but retrieval alone doesn't establish which statement is currently valid.

The agent must resolve identity, effective dates, provenance, authority and access scope. If a third party merely inferred that I changed jobs, should that override my explicitly confirmed employer? Should another tenant's agent see either fact? These are problems of temporal reasoning and information governance, not just semantic similarity.

### 2/ Multiple layers, different responsibilities

**L0 Working Memory** holds the current session, tool results and active reasoning context. A pre-compaction Memory Flush lets an agent persist useful facts before the history is summarized and truncated.

**L1 Episodic Memory** stores experiences: session summaries, short ~50-token `L0 abstracts`, topics, embeddings, provenance and recall signals. The default retention is 90 days. The agent can load a short abstract first and request the full episode only when it needs deeper detail.

**L2 Semantic Memory** stores entities, relationships and their changes over time in the Knowledge Graph. **Memory Facts** hold typed, versioned assertions; **Knowledge Vault** manages external workspace documents. These are complementary roles, not five interchangeable databases.

```mermaid
flowchart TD
 W["Working Memory L0"] --> E["Episodic Memory L1"]
 E --> K["Knowledge Graph L2"]
 E --> F["Memory Facts"]
 Docs["Workspace documents"] --> V["Knowledge Vault"]
 K --> R["Unified Retrieval"]; F --> R; V --> R; E --> R
 R --> A["Reflex / Jev Admission"]
```

*Conceptual memory architecture; individual sources may be disabled.*

### 3/ Memory Facts are structured assertions, not strings

A Dewee fact has a `subject`, `predicate`, `qualifier`, `value`, `cardinality`, `valid_from`, `valid_until`, `expires_at`, `observed_at`, `verification`, `asserted_by`, `confidence`, `source_refs`, `status` and version/supersession links.

`observed_at` records when the system learned something; `valid_from` records when it became true. Single-valued predicates are constrained differently from multi-valued predicates. One person may work on several projects at once, but a single-valued fact cannot simply accumulate contradictory current values without reconciliation.

The schema has dedicated slot, full-text, provenance and expiry indices. That is the difference between a bag of embeddings and a system with explicit truth lifecycle.

### 4/ Reconciliation: newer does not automatically mean truer

The deterministic `Reconcile()` engine chooses to **create, extend, supersede, dispute or skip** an assertion. Repeated evidence can strengthen an existing fact; a sufficiently authoritative newer statement can supersede a single-valued fact while retaining history.

Authority is ordered **operator > user > agent > extractor**, with verification strength as another factor. An extractor's guess cannot silently overwrite a direct user confirmation merely because it arrived later. Lower-authority contradictions can remain `disputed` for review.

Facts support `as_of` temporal queries, so an agent can answer “Where did I work last March?” using the fact effective at that time, rather than merely citing the most recent sentence. This is a deterministic policy layer, not a magical guarantee that all extracted facts are correct.

```mermaid
flowchart TD
 N["New fact"] --> V{"Valid and sourced?"}
 V -->|No| SK["Skip"]; V -->|Yes| M{"Same slot and value?"}
 M -->|Yes| EX["Extend"]; M -->|No| T{"Newer and authoritative?"}
 T -->|Yes| SU["Supersede"]; T -->|No| DI["Dispute or create"]
```

*Simplified fact reconciliation decision flow.*

### 5/ Knowledge Graph enables relational memory

On Monday, the agent learns Lauren works at company A. On Tuesday, company A develops product X. On Wednesday, product X uses technology Y. Answering “What is Lauren's product built with?” requires connecting several relationships, sometimes called multi-hop reasoning.

`SemanticWorker` extracts entities and relations. `DedupWorker` looks for semantically similar entities and merges duplicates. Temporal validity tracks entity versions, and historical relationships are not blindly reattached to a new version.

Having a graph doesn't prove perfect multi-hop answers. Extraction quality, identity resolution, retrieval and the language model still matter. The architectural distinction is that Dewee has explicit structures for relationships rather than relying only on cosine similarity.

### 6/ Dreaming: converting episodes into long-term knowledge

After `run.completed`, `EpisodicWorker` writes summaries and abstracts. `episodic.created` triggers semantic extraction and the asynchronous `DreamingWorker`. Dreaming batches selected episodes, synthesizes lasting knowledge, writes documents, indexes them and marks the source episodes as promoted.

Default behavior includes a 10-minute debounce, a threshold of five unpromoted episodes and batches of up to ten. The recall-scoring heuristic is **0.30 frequency + 0.35 relevance + 0.20 recency + 0.15 freshness**, with caps and time decay. These are shipped weights, not an independently calibrated accuracy score.

The critical engineering detail is **Store → Index → Promote**. If indexing fails, an unindexed artifact is cleaned up on a best-effort basis; if promotion fails, the indexed artifact is retained for retry. Batch IDs are derived from SHA-256 so identical retries can reuse work. This is much more than asking an LLM to summarize a chat.

```mermaid
flowchart LR
 RUN["run.completed"] --> E["EpisodicWorker"]
 E --> S["SemanticWorker"]
 E --> D["DreamingWorker"]
 D --> ST["Store"] --> IX["Index"] --> PR["Promote"]
```

*Retry-safe consolidation sequence.*

**Recall-score heuristic weights (not accuracy)** (bar chart)

| Label | Weight |
| --- | --- |
| Frequency | 30 |
| Relevance | 35 |
| Recency | 20 |
| Freshness | 15 |

- Y axis: unit: %, range 0 to 40

### 7/ Knowledge Vault connects documents and conversation memory

An agent learns not only from chats but from Markdown, project notes and files. Knowledge Vault provides a document registry, SHA-256 change detection, filesystem synchronization, bidirectional `[[wikilinks]]`, hybrid search and a unified interface over documents, episodes and the Knowledge Graph.

The documented unified-search default weights are **40% Vault, 30% Episodic, 30% KG**. A separate document-memory hybrid search uses **30% full-text, 70% vector**. These formulas operate at different stages and should not be confused.

Documents have personal, team or tenant-shared scope. The `vault_versions` schema is prepared but its full version-history capability should not yet be promoted as an operational feature.

**Unified Vault Search source weights** (doughnut chart)

| Label | Weight |
| --- | --- |
| Vault | 40 |
| Episodic | 30 |
| KG | 30 |

### 8/ Memory Admission: don't flood the context window

If I ask the agent to fix API authentication, memories about past API incidents and relevant technical notes may help; my coffee preference and holiday plans usually will not. Top-K similarity alone is not a usefulness decision.

Dewee can collect candidates from allowed sources, deterministically deduplicate them, cap the pool, have Reflex/Jev assess usefulness, rank accepted items and fill a token budget. Shipped defaults include ten global candidates, eight per source, a 200-token injection budget and a 1.5-second evaluation timeout.

Admission may accept **zero memories**. If evaluation times out or returns uncertain/invalid output, the read-side controller fails open to the legacy retrieval path without removing authorization checks. The retrieval seam is **opt-in and off by default**: this is implemented capability, not an assertion that Jev evaluates every production turn.

```mermaid
flowchart LR
 Q["User intent"] --> R["Retrieve"]
 R --> DD["Deduplicate"]
 DD --> J["Reflex/Jev evaluate"]
 J -->|accepted| B["Token budget"] --> L["LLM"]
 J -->|rejected| N["No injection"]
```

*Optional Jev-based context admission, not enabled for all turns by default.*

### 9/ Passive Channel Memory: learn from groups, with restraint

Team chats contain decisions, tasks, people, projects, preferences and events, but remembering everything is a privacy disaster. Dewee's `channelmemory` can scan eligible group messages and propose structured memories in those categories.

The feature is disabled by default and review mode is enabled by default. It supports excluded users, excluded patterns, sensitive-content redaction and review before promotion. Approved items enter the same episodic and semantic pipeline.

A chatbot that remembers everything said in a private group without enforcing who may see it is not intelligent. It is a security incident waiting to happen.

### 10/ Memory governance is part of the product

Dewee scopes memory across tenant, agent, user, team and chat context. Facts are checked for the right scope at query time and checked again before they become retrieval candidates; team isolation may additionally constrain chat scope.

`Soft delete` stops a fact from being actively recalled while retaining a history for audit. `Forget` is a stronger erasure workflow for supported stored facts/history. Removing a reviewed channel-memory source can also delete facts derived from it. Dangerous operations have more restricted CLI/API and administrative permissions.

This is not proof that every backup, derivative system and external copy is erased perfectly. It is evidence that source-aware lifecycle and fail-closed data access are architectural concerns rather than afterthoughts.

### 11/ How Dewee compares with other platforms

**Mem0** is a developer-focused memory engine with extraction, graph capabilities, temporal reasoning and managed APIs. **Supermemory** specializes in memory graphs, profiles, multimodal ingestion and retrieval. **Letta** builds stateful, self-managing agents with Git-based MemFS and dreaming. **Claude Code** uses transparent project files and auto-memory for coding. **ChatGPT** emphasizes consumer personalization; **LangGraph** offers primitives for building custom stateful systems.

Dewee's potential distinction is not an exclusive invention of graph, dreaming or hybrid search. It is the **combination of typed temporal facts, deterministic authority-aware reconciliation, knowledge consolidation, context admission and multi-tenant governance inside one agent runtime**.

Mem0 has published 94.4 on its LongMemEval assessment and Supermemory published 97% Recall@20 on LongMemEval-S. The methods and metrics differ, and Dewee has no equivalent published head-to-head benchmark. **These numbers cannot be turned into a ranking.**

**Different platforms, different goals**

| Platform | Core focus | Dewee's proposed differentiation |
| --- | --- | --- |
| Mem0 | Memory API, graph and temporal extraction | Full agent-runtime integration + authority-based facts |
| Supermemory | Profiles, knowledge graphs, ingestion and retrieval | Agent lifecycle + governed admission + tenant boundaries |
| Letta | Stateful agents, MemFS and dreaming | Temporal facts + scoped retrieval and decision layer |
| Claude Code | Transparent file-based coding memory | Multi-agent, cross-session, multi-user management |
| ChatGPT | Consumer personalization | Configurable agent-runtime and governance |
| LangGraph | Stateful-agent building blocks | Integrated platform memory and orchestration |

### 12/ What is not finished yet

Memory Facts default to `shadow`: facts can be learned and stored, but are not injected or exposed through the active Facts retrieval tier by default. Reflex read-side admission is separately opt-in. Automatic fact extraction currently depends on KG extraction being enabled.

The fact schema supports expiration, but extraction does not consistently infer complete end dates. A self-refreshing, always-on dynamic user profile is still a valuable opportunity. Memory Facts have a regression corpus for preference changes, job transitions, historical recall and contradictions, but Dewee still needs public end-to-end benchmarks.

The measurements to publish are retrieval precision/recall, update accuracy, stale-fact rate, cross-tenant isolation, p95 latency, token cost, abstention and multi-hop answer quality. Code-level sophistication is not the same as production accuracy.

### 13/ A larger context window is not a memory system

Putting a thousand conversations into a million-token context doesn't automatically tell the model which assertions are current, who verified them, who can see them or whether any of them are useful for the current task.

**A context window is capacity. A memory system is knowledge management across time, evidence and permissions.** Effective agent memory must answer: What do we know? Where did it come from? Is it still valid? Who has authority? Is it useful right now?

Sometimes the correct action is to inject no memory at all.

### 14/ Toward memory that manages itself

Episodic Memory, knowledge graphs, dreaming, temporal facts and hybrid retrieval are not individually new. Dewee's architectural thesis is that the full lifecycle matters: **interaction → extraction → reconciliation → consolidation → retrieval → admission → execution → feedback**.

The most defensible edge is the integration of **Memory Engineering, Agent Orchestration and Decision Engineering**. To prove superiority in end-to-end quality, we'll need reproducible benchmarks and measured deployments, not a larger list of buzzwords.

**AI doesn't lack the ability to store information. It lacks the reliable use of knowledge.** That's what we're building toward. Now, back to building.

> **INFO:** **Scope note:** Source code at commit 5abb8d5, Oct 28, 2026. Opt-in functionality is not automatically running in production. Competitor benchmark figures use different methodologies; no direct Dewee head-to-head is claimed.

### Sources and further reading

- [Dewee source, dev @ 5abb8d5](https://github.com/nextlevelbuilder/dewee)
- [Memory architecture](https://github.com/nextlevelbuilder/dewee/blob/dev/docs/07-bootstrap-skills-memory.md)
- [Knowledge Vault](https://github.com/nextlevelbuilder/dewee/blob/dev/docs/24-knowledge-vault.md)
- [Fact reconciliation](https://github.com/nextlevelbuilder/dewee/blob/dev/internal/memoryfacts/reconcile.go)
- [Dreaming Worker](https://github.com/nextlevelbuilder/dewee/blob/dev/internal/consolidation/dreaming_worker.go)
- [Memory Admission](https://github.com/nextlevelbuilder/dewee/blob/dev/internal/memory/admission.go)
- [LongMemEval, ICLR 2025](https://proceedings.iclr.cc/paper_files/paper/2025/hash/d813d324dbf0598bbdc9c8e79740ed01-Abstract-Conference.html)
- [Mem0 research](https://arxiv.org/abs/2504.19413)
- [Supermemory](https://supermemory.ai/product/)
- [Letta](https://docs.letta.com/configuration/memory)
- [Claude Code Memory](https://code.claude.com/docs/en/memory)
- [OpenAI Dreaming](https://openai.com/index/chatgpt-memory-dreaming/)
