@ssheleg/agent-stack 0.14.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +71 -0
- package/package.json +1 -1
- package/plugins/agent-stack/.claude-plugin/plugin.json +1 -1
- package/plugins/agent-stack/skills/agent-orchestrator/SKILL.md +18 -19
- package/plugins/agent-stack/skills/agent-orchestrator/references/memory-architecture.md +326 -0
- package/plugins/agent-stack/skills/agent-orchestrator/references/memory-landscape.md +128 -0
- package/plugins/agent-stack/skills/agent-orchestrator/references/memory-lifecycle.md +154 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.16.0 — the whole survey, not just its taxonomy
|
|
4
|
+
|
|
5
|
+
v0.15.0 took the taxonomy and the named failure modes. This takes the rest: the write
|
|
6
|
+
path and the landscape, as two references under the spine that already exists.
|
|
7
|
+
|
|
8
|
+
- **`memory-lifecycle.md` — how an entry is made, changed and thrown away.** Five formation
|
|
9
|
+
operations with the cost of each stated rather than implied: semantic summarization is
|
|
10
|
+
*lossy by design* and wrong for evidence-critical tasks; structured construction buys
|
|
11
|
+
multi-hop and pays schema rigidity; latent is a black box; parametric cannot be precisely
|
|
12
|
+
removed. Summarization's two shapes fail differently — incremental drifts because each
|
|
13
|
+
summary is built from the last, partitioned loses cross-partition dependencies — and
|
|
14
|
+
**summarizing by fixed window is partitioned summarization with the worst partition rule**.
|
|
15
|
+
- **Updating is not consolidation.** One resolves conflict, the other abstracts, and a
|
|
16
|
+
system needs both. The field's own trajectory is worth copying rather than rediscovering:
|
|
17
|
+
early systems deleted the superseded entry and broke temporal continuity; the better
|
|
18
|
+
pattern is **temporal annotation** — mark a validity window instead — which also makes the
|
|
19
|
+
stability–plasticity decision reversible, and it has no general answer.
|
|
20
|
+
- **Consolidation has a cost this pack did not state**: it risks information smoothing, and
|
|
21
|
+
the outlier it smooths away is often the entry worth keeping.
|
|
22
|
+
- **`memory-landscape.md` — build or adopt, measure, and what is not practice yet.** Around
|
|
23
|
+
twenty-five open-source frameworks give you an index and leave you the judgement: what
|
|
24
|
+
becomes a memory, when to retrieve, what to abstain on, what to demote. **Adopt for the
|
|
25
|
+
index, not for the judgement.** Frameworks are compared by the axes that separate them
|
|
26
|
+
rather than by a list that expires.
|
|
27
|
+
- Benchmarks are split into memory-oriented and long-horizon-that-stresses-memory, and the
|
|
28
|
+
first question is neither: it is `agent-evals`' question — **what fails if memory is
|
|
29
|
+
silently disabled?** A memory never queried and a memory that is empty score identically
|
|
30
|
+
on every benchmark; only the retrieval log separates them.
|
|
31
|
+
- Frontiers are marked as frontiers, with one exception acted on: **expose memory operations
|
|
32
|
+
as tools the agent calls.** It makes every memory decision legible in the trace, including
|
|
33
|
+
the decision NOT to retrieve — which is the silent failure this whole subject is about,
|
|
34
|
+
and which a background memory module cannot show you.
|
|
35
|
+
- Three things the pack deliberately does NOT implement are named as absent rather than
|
|
36
|
+
quietly added: frequency-based forgetting, temporal annotation, dual-phase updating. Each
|
|
37
|
+
is a real change to a mechanism in production, and a reference's job is to say what the
|
|
38
|
+
options are, not to rewrite `patterns.md` from a survey.
|
|
39
|
+
- The citation now has **one home**. The member's own validator refused three files each
|
|
40
|
+
repeating the pinned source — "a fact with two homes disagrees with itself on the first
|
|
41
|
+
edit" — so the spine holds it and the siblings name it.
|
|
42
|
+
|
|
43
|
+
## v0.15.0 — memory architecture, and the axes the layer table does not have
|
|
44
|
+
|
|
45
|
+
- **`agent-orchestrator/references/memory-architecture.md`** — form, function and dynamics
|
|
46
|
+
as the three axes of a memory decision, with the layer table demoted to what it is: one
|
|
47
|
+
property of the answer. Source pinned with a read date — *Memory in the Age of AI Agents:
|
|
48
|
+
A Survey*, arXiv:2512.13564v2, 13 Jan 2026, read 2026-08-27.
|
|
49
|
+
- **Retrieval was two mentions across 1,938 lines of references**, and it is four decisions:
|
|
50
|
+
whether to retrieve at all and from which store, what query to retrieve with, which
|
|
51
|
+
strategy runs the search, what reaches the prompt. The first is the one nobody
|
|
52
|
+
instruments — an agent that overestimates its own knowledge and skips retrieval answers
|
|
53
|
+
confidently from nothing, with **no error, no empty result and no latency spike**.
|
|
54
|
+
- **Facts are now separated from experience, and by entity.** Layers 3 and 4 are
|
|
55
|
+
experiential; nothing in them is a factual store. A stale fact about the USER makes the
|
|
56
|
+
agent rude, a stale fact about the ENVIRONMENT makes it wrong — one expiry rule for both
|
|
57
|
+
is wrong twice.
|
|
58
|
+
- **Forgetting gains the long-tail trap.** Frequency-based eviction is the easy policy and
|
|
59
|
+
the one that deletes the rarely-read entry preventing the rare expensive mistake. Where
|
|
60
|
+
storage is not the binding constraint: demote, not delete.
|
|
61
|
+
- Also carried: forms beyond token-level and what each costs (parametric memory cannot be
|
|
62
|
+
selectively deleted; latent memory cannot be inspected), why `agent-sync`'s leases are
|
|
63
|
+
coordination rather than shared memory, and abstention under low-confidence retrieval —
|
|
64
|
+
which needs a similarity floor, because semantic search always returns K results and an
|
|
65
|
+
empty store looks identical to an irrelevant one.
|
|
66
|
+
- **§7 was split rather than trimmed.** The house auditor refused the first attempt at
|
|
67
|
+
4981 tokens against a 4750 working limit and named the remedy itself. The context-budget
|
|
68
|
+
trap, layer 0 carryover and workspace scale moved into the new reference; the body is now
|
|
69
|
+
**4659 tokens — below the 4708 it sat at before any of this**.
|
|
70
|
+
- Discoverability, measured: against *"agent memory architecture: forms, functions,
|
|
71
|
+
dynamics, retrieval, forgetting"* this skill ranked **8th** among installed skills and now
|
|
72
|
+
ranks **1st**. The description is 965 chars, inside the 970-char working limit.
|
|
73
|
+
|
|
3
74
|
## v0.14.1 — the workforce axis: provider lifecycle and workspace-scale memory
|
|
4
75
|
|
|
5
76
|
(v0.14.0 was burned during release engineering: its tag landed on a commit a
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "agent-stack",
|
|
3
3
|
"displayName": "Agent Stack",
|
|
4
4
|
"description": "Two skills: agent-orchestrator — tool-calling loops, multi-stage pipelines with checkpoints, provider routing with fallback, four-layer memory, context engineering, plus the wallet side of reselling LLM access; and agent-evals — run/trace/thread evals, judges, and fixtures grown from production.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.16.0",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "ssheleg",
|
|
8
8
|
"url": "https://x.com/sshlg93"
|
|
@@ -3,8 +3,8 @@ name: agent-orchestrator
|
|
|
3
3
|
description: >-
|
|
4
4
|
Use when building an agent system — an orchestrator, an LLM-powered tool, a chatbot with tool
|
|
5
5
|
use, an AI pipeline — or metering and billing the LLM access it burns. Covers tool-calling
|
|
6
|
-
loops, pipelines with human checkpoints, provider routing with fallback/retry,
|
|
7
|
-
|
|
6
|
+
loops, pipelines with human checkpoints, provider routing with fallback/retry, memory
|
|
7
|
+
architecture, retrieval and decay, context budgets, sub-agent coordination, error hierarchies; the
|
|
8
8
|
work as a graph — parallel layers, fake edges, a checker before convergence; for resale:
|
|
9
9
|
tiered wallets, one markup boundary, two-phase commit across database and provider API,
|
|
10
10
|
spend-delta polling, budget and loop guards, per-tenant keys. Triggers - "agent",
|
|
@@ -232,23 +232,22 @@ Four layers, each with a different lifetime and a different reason to exist:
|
|
|
232
232
|
| 3 Long-term learnings | per resource | months | what worked, with a confidence score |
|
|
233
233
|
| 4 Insights | per project | permanent | conclusions that outlived their resource |
|
|
234
234
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
**
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
rules: `references/patterns.md` → **Workspace-scale memory**.
|
|
235
|
+
What enters layers 3 and 4 is decided by `references/patterns.md` — **Confidence
|
|
236
|
+
Management**, **Learning Extraction Heuristics**, **Fuzzy Deduplication**, **Conflict
|
|
237
|
+
Resolution**.
|
|
238
|
+
|
|
239
|
+
**These four are lifetimes, and lifetime is not the taxonomy.** Layers 3 and 4 are
|
|
240
|
+
*experiential*; **nothing here is a factual store**, and a stale fact about the USER makes
|
|
241
|
+
the agent rude while one about the ENVIRONMENT makes it wrong. Retrieval is absent here and
|
|
242
|
+
is four decisions, the first of which — whether to retrieve at all — fails as a confident
|
|
243
|
+
answer built from nothing, in no error log.
|
|
244
|
+
|
|
245
|
+
**Design a memory layer from
|
|
246
|
+
[`references/memory-architecture.md`](references/memory-architecture.md)**, not from this
|
|
247
|
+
table — it also carries the context-budget trap, layer 0 carryover and workspace scale.
|
|
248
|
+
The write path is [`references/memory-lifecycle.md`](references/memory-lifecycle.md);
|
|
249
|
+
what to build on and measure with is
|
|
250
|
+
[`references/memory-landscape.md`](references/memory-landscape.md).
|
|
252
251
|
## 8. Self-Learning Feedback Loops
|
|
253
252
|
|
|
254
253
|
Three cycles feed the memory layers, and they differ by what supplies the signal: a failed
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
# Memory architecture — deciding what the agent remembers before deciding where to put it
|
|
2
|
+
|
|
3
|
+
**Load this when** an agent is being given memory for the first time, when an existing
|
|
4
|
+
memory layer is being extended, or when memory is present and behaving badly — recall that
|
|
5
|
+
misses, a store that grows without bound, an agent confidently answering from nothing.
|
|
6
|
+
|
|
7
|
+
**Spec pinned:** *Memory in the Age of AI Agents: A Survey — Forms, Functions and
|
|
8
|
+
Dynamics*, Hu et al., `https://arxiv.org/abs/2512.13564` (arXiv:2512.13564v2, 13 Jan 2026;
|
|
9
|
+
NUS / RUC / Fudan / PKU / NTU and others) · read 2026-08-27. Paper list:
|
|
10
|
+
`https://github.com/Shichun-Liu/Agent-Memory-Paper-List`.
|
|
11
|
+
|
|
12
|
+
`SKILL.md` §7 owns the four **layers** and their lifetimes, and §8 the loops that feed
|
|
13
|
+
them. Both answer *how long does this live*. **This file is upstream of that**: it decides
|
|
14
|
+
what kind of memory is being built at all, and lifetime is one property of the answer
|
|
15
|
+
rather than the taxonomy. The survey's own position, and the reason this file exists:
|
|
16
|
+
*"traditional taxonomies such as long/short-term memory have proven insufficient to capture
|
|
17
|
+
the diversity and dynamics of contemporary agent memory systems."*
|
|
18
|
+
|
|
19
|
+
## Contents
|
|
20
|
+
|
|
21
|
+
- [The source, and what this file adds](#the-source-and-what-this-file-adds)
|
|
22
|
+
- [1. Three axes, and lifetime is not one of them](#1-three-axes-and-lifetime-is-not-one-of-them)
|
|
23
|
+
- [2. Form — what physically carries it](#2-form--what-physically-carries-it)
|
|
24
|
+
- [3. Function — what it is for](#3-function--what-it-is-for)
|
|
25
|
+
- [4. Dynamics — formation, evolution, retrieval](#4-dynamics--formation-evolution-retrieval)
|
|
26
|
+
- [5. Retrieval is four decisions, not one](#5-retrieval-is-four-decisions-not-one)
|
|
27
|
+
- [5.5 The budget, layer 0, and workspace scale](#55-the-budget-layer-0-and-workspace-scale)
|
|
28
|
+
- [6. Forgetting, and the long-tail trap](#6-forgetting-and-the-long-tail-trap)
|
|
29
|
+
- [7. Shared memory when there is more than one agent](#7-shared-memory-when-there-is-more-than-one-agent)
|
|
30
|
+
- [8. Trustworthy memory](#8-trustworthy-memory)
|
|
31
|
+
- [9. What this pack does NOT claim](#9-what-this-pack-does-not-claim)
|
|
32
|
+
- [10. The checklist](#10-the-checklist)
|
|
33
|
+
- [11. The rest of it](#11-the-rest-of-it)
|
|
34
|
+
|
|
35
|
+
## The source, and what this file adds
|
|
36
|
+
|
|
37
|
+
The survey is a map of published work, not a build guide: it classifies roughly two
|
|
38
|
+
hundred systems and states open problems. What is taken from it here is the **taxonomy and
|
|
39
|
+
the named failure modes**, because those are what an architect needs before writing a
|
|
40
|
+
schema. What is added is the decision order — form, then function, then dynamics — and the
|
|
41
|
+
wiring to what this pack already owns: §7's layers, §8's learning loops, `patterns.md`'s
|
|
42
|
+
confidence arithmetic, `context-engineering.md`'s budget, and `agent-evals` for judging
|
|
43
|
+
whether any of it helped.
|
|
44
|
+
|
|
45
|
+
**Where the survey and this pack disagree, the pack says so rather than quietly adopting.**
|
|
46
|
+
§7's four layers are a *deployment* shape that has survived contact with real systems; the
|
|
47
|
+
survey's three functions are an *analytical* shape. They are not rivals — the mapping is in
|
|
48
|
+
§3 below — and a schema built from either alone is missing what the other sees.
|
|
49
|
+
|
|
50
|
+
## 1. Three axes, and lifetime is not one of them
|
|
51
|
+
|
|
52
|
+
Every memory decision is three independent questions. Answer them in this order; answering
|
|
53
|
+
the third first is how a vector store arrives before anyone has said what it holds.
|
|
54
|
+
|
|
55
|
+
| Axis | The question | Answered in |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| **Form** | what physically carries it | §2 |
|
|
58
|
+
| **Function** | what it is FOR | §3 |
|
|
59
|
+
| **Dynamics** | how it is formed, evolved and retrieved | §4, §5, §6 |
|
|
60
|
+
|
|
61
|
+
Long-term and short-term are **not** a fourth axis. They are a consequence: the survey's
|
|
62
|
+
formulation is that short- and long-term effects *"emerge not from discrete architectural
|
|
63
|
+
modules but from the temporal patterns with which formation, evolution and retrieval are
|
|
64
|
+
engaged."* A single store read once per task behaves as short-term; the same store read
|
|
65
|
+
across tasks behaves as long-term. Design the patterns, and the lifetimes follow.
|
|
66
|
+
|
|
67
|
+
## 2. Form — what physically carries it
|
|
68
|
+
|
|
69
|
+
Three realizations. Most agent work uses the first and never learns the other two exist,
|
|
70
|
+
which is fine until the first one's costs bite.
|
|
71
|
+
|
|
72
|
+
| Form | What it is | Reach for it when | What it costs |
|
|
73
|
+
|---|---|---|---|
|
|
74
|
+
| **Token-level** | text, key-value, documents, graphs — anything the model reads as tokens | almost always; it is legible, auditable and editable by hand | every read spends context, and the store competes with the task for the window |
|
|
75
|
+
| **Parametric** | the knowledge is in weights — fine-tuning, model editing, adapters | a behaviour must hold with no retrieval step and no context cost, and it changes rarely | not auditable, not selectively deletable, and **wrong entries are expensive to remove** — which collides with §8's right to be forgotten |
|
|
76
|
+
| **Latent** | compressed internal states — KV reuse, latent tokens | throughput or privacy dominates and the content need not be read by a person | opaque: nobody can inspect what it holds, so a defect in it is invisible until behaviour is wrong |
|
|
77
|
+
|
|
78
|
+
Token-level splits further by structure — flat (1D), planar/tabular (2D), hierarchical or
|
|
79
|
+
graph (3D). Structure is a **retrieval** decision, not a storage one: a graph is worth its
|
|
80
|
+
cost when queries are multi-hop, and is overhead when they are lookups.
|
|
81
|
+
|
|
82
|
+
**The default, stated so it is a choice and not an accident:** token-level, flat, until a
|
|
83
|
+
measured retrieval failure justifies structure. Structure added before that is a schema
|
|
84
|
+
maintained for a query nobody runs.
|
|
85
|
+
|
|
86
|
+
## 3. Function — what it is for
|
|
87
|
+
|
|
88
|
+
Three pillars. The name matters because **the update rule and the trust level differ per
|
|
89
|
+
pillar**, and a store that mixes them applies one rule to all three.
|
|
90
|
+
|
|
91
|
+
| Function | Answers | Subtypes | Update rule |
|
|
92
|
+
|---|---|---|---|
|
|
93
|
+
| **Factual** | *what does the agent know* | **user** facts (identity, stable preferences, task constraints, commitments) · **environment** facts (document state, resource availability, what other agents can do) | corrected on contradiction; the newest assertion usually wins |
|
|
94
|
+
| **Experiential** | *how does the agent improve* | case-based (whole solutions and trajectories) · strategy-based (insights, workflows, patterns) · skill-based (functions, code, tools it wrote) | earned from a **contrast** — see §8 of `SKILL.md`; never from a single success |
|
|
95
|
+
| **Working** | *what is it thinking about now* | single-turn (input condensation, observation abstraction) · multi-turn (state consolidation, hierarchical folding) | discarded at the task boundary unless promoted |
|
|
96
|
+
|
|
97
|
+
**The split this pack was missing, and why it matters.** §7's layers do not separate *user*
|
|
98
|
+
facts from *environment* facts, and the two have opposite failure modes. A user fact that
|
|
99
|
+
goes stale makes the agent **rude** — it addresses a person by a preference they abandoned.
|
|
100
|
+
An environment fact that goes stale makes the agent **wrong** — it acts on a file that
|
|
101
|
+
moved, a budget that was spent, a tool that was removed. So environment facts need a
|
|
102
|
+
freshness policy and a re-check on use; user facts need a correction path and a way for the
|
|
103
|
+
person to see and edit what is held about them. One TTL for both is wrong twice.
|
|
104
|
+
|
|
105
|
+
**Mapping to §7's layers**, so the two shapes can be held at once:
|
|
106
|
+
|
|
107
|
+
| §7 layer | Function it actually serves |
|
|
108
|
+
|---|---|
|
|
109
|
+
| 1 Chat history | working, multi-turn |
|
|
110
|
+
| 2 Working memory (per resource) | working promoted to factual-about-this-task |
|
|
111
|
+
| 3 Long-term learnings | experiential — strategy-based |
|
|
112
|
+
| 4 Insights | experiential — strategy-based, cross-resource |
|
|
113
|
+
| *(missing)* | **factual: user and environment** — add it as its own store, not as a learning |
|
|
114
|
+
|
|
115
|
+
## 4. Dynamics — formation, evolution, retrieval
|
|
116
|
+
|
|
117
|
+
Three operators, and a system is defined by which of them it runs and how often.
|
|
118
|
+
|
|
119
|
+
- **Formation** — what becomes a memory candidate at all. Selective, never the whole
|
|
120
|
+
transcript: *"extracting information with potential future utility rather than storing
|
|
121
|
+
the entire interaction history verbatim."* Owned here by §8 and
|
|
122
|
+
`patterns.md` → **Learning Extraction Heuristics**.
|
|
123
|
+
- **Evolution** — consolidation, updating, forgetting. Owned by `patterns.md` →
|
|
124
|
+
**Confidence Management**, **Fuzzy Deduplication**, **Conflict Resolution**. Forgetting is
|
|
125
|
+
under-specified there; §6 below closes it.
|
|
126
|
+
- **Retrieval** — this pack had almost nothing on it. §5 is the whole of it.
|
|
127
|
+
|
|
128
|
+
## 5. Retrieval is four decisions, not one
|
|
129
|
+
|
|
130
|
+
*"Memory retrieval is not a static search operation but a dynamic cognitive process."* Four
|
|
131
|
+
stages, in execution order. A system that implements only the third — the usual case — is
|
|
132
|
+
running one of four.
|
|
133
|
+
|
|
134
|
+
### 5.1 Timing and intent — whether to retrieve at all, and from which store
|
|
135
|
+
|
|
136
|
+
**The failure this stage exists to prevent has a name and it is silent.** When an agent
|
|
137
|
+
overestimates its own knowledge and does not retrieve, there is no error, no empty result
|
|
138
|
+
and no latency spike — there is a confident answer built from nothing. It is invisible to
|
|
139
|
+
every health check that watches for failures.
|
|
140
|
+
|
|
141
|
+
- **Always-on retrieval** is the safe default and it is not free: it spends context on
|
|
142
|
+
every turn and injects noise into questions that needed none.
|
|
143
|
+
- **Model-decided** retrieval is cheaper and introduces exactly the silent mode above.
|
|
144
|
+
- **Fast–slow** is the compromise worth the wiring: answer, self-assess, and retrieve
|
|
145
|
+
deeper only when the first answer is judged insufficient.
|
|
146
|
+
|
|
147
|
+
**Instrument it or do not ship it.** Log retrieval decisions including the negatives —
|
|
148
|
+
*asked, decided not to retrieve* — and give `agent-evals` a fixture where the answer is
|
|
149
|
+
only obtainable from memory. A memory that is never queried scores the same as a memory
|
|
150
|
+
that is empty, and only the log tells them apart.
|
|
151
|
+
|
|
152
|
+
### 5.2 Query construction — what to retrieve with
|
|
153
|
+
|
|
154
|
+
The user's words are not a good query against your index, and this stage is the one most
|
|
155
|
+
often skipped entirely. Two techniques, and they compose:
|
|
156
|
+
|
|
157
|
+
- **Decomposition** — break a compound question into sub-queries, retrieve per part.
|
|
158
|
+
Use when the question spans several facts that no single entry holds.
|
|
159
|
+
- **Rewriting** — restate the query in the index's own language, or generate a hypothetical
|
|
160
|
+
answer and search with *that* (HyDE). Use when user phrasing and stored phrasing diverge
|
|
161
|
+
— which is most of the time for a store written by the agent itself.
|
|
162
|
+
|
|
163
|
+
### 5.3 Strategy — how the search runs
|
|
164
|
+
|
|
165
|
+
| Strategy | Strong at | Weak at |
|
|
166
|
+
|---|---|---|
|
|
167
|
+
| **Lexical** (BM25, TF-IDF) | exact identifiers, tool names, error strings, precision | paraphrase, synonyms |
|
|
168
|
+
| **Semantic** (embeddings) | paraphrase, fuzzy match — the usual default | drift and forced top-K, which return *something* however irrelevant |
|
|
169
|
+
| **Graph** | multi-hop, relational, temporal constraints | cost, and a schema to maintain |
|
|
170
|
+
| **Hybrid** | lexical precision plus semantic reach | two systems to tune |
|
|
171
|
+
|
|
172
|
+
**Semantic-only retrieval always returns K results.** There is no "nothing matched" unless
|
|
173
|
+
a similarity floor is set, so an empty store and an irrelevant store look identical to the
|
|
174
|
+
model. Set the floor, and make "nothing relevant" a value the caller can act on.
|
|
175
|
+
|
|
176
|
+
### 5.4 Post-retrieval — what actually reaches the prompt
|
|
177
|
+
|
|
178
|
+
Raw hits are redundant, stale and mutually contradictory. Two operations:
|
|
179
|
+
|
|
180
|
+
- **Re-rank and filter** — drop low-relevance and expired items. Temporal validity is a
|
|
181
|
+
filter, not a tiebreak: a fact with a validity window that has closed is wrong, not
|
|
182
|
+
merely old.
|
|
183
|
+
- **Aggregate and compress** — merge duplicates and reconstruct one coherent context.
|
|
184
|
+
|
|
185
|
+
This is where `context-engineering.md`'s budget applies. §7's warning holds at every stage:
|
|
186
|
+
every layer competes for one window, so give working memory a floor or a large set of old
|
|
187
|
+
generalities will quietly evict what the user said a minute ago.
|
|
188
|
+
|
|
189
|
+
## 5.5 The budget, layer 0, and workspace scale
|
|
190
|
+
|
|
191
|
+
Moved here from `SKILL.md` §7 when that file reached its body budget: these are memory
|
|
192
|
+
*architecture*, and this is the file about it.
|
|
193
|
+
|
|
194
|
+
**The trap is the budget, not the storage.** Every layer competes for the same context
|
|
195
|
+
window, so allocation is decided per call rather than per layer. A session that trims chat
|
|
196
|
+
history to fit a large set of learnings has quietly chosen old generalities over what the
|
|
197
|
+
user said sixty seconds ago. **Give layer 1 a floor.** This is the same window
|
|
198
|
+
`context-engineering.md` governs, and §5.4's post-retrieval stage is where a retrieval
|
|
199
|
+
that ignores it does its damage.
|
|
200
|
+
|
|
201
|
+
**Layer 0 — carryover state.** Goal, artifacts, verified work and restrictive mode cross a
|
|
202
|
+
compaction boundary as copied typed blocks, not prose (`SKILL.md` §12). It is a memory
|
|
203
|
+
layer whose whole job is surviving one specific event.
|
|
204
|
+
|
|
205
|
+
**Workspace scale.** Managing persistent workspaces rather than sessions shifts the scopes
|
|
206
|
+
— run, workspace, global, doctrine — and adds the journal-spine rules:
|
|
207
|
+
`patterns.md` → **Workspace-scale memory**.
|
|
208
|
+
|
|
209
|
+
## 6. Forgetting, and the long-tail trap
|
|
210
|
+
|
|
211
|
+
Three policies, and they are orthogonal — a system usually needs more than one:
|
|
212
|
+
|
|
213
|
+
- **Time-based decay** — natural aging. `patterns.md` → Confidence Management.
|
|
214
|
+
- **Frequency-based** — LRU/LFU, evict what is not read.
|
|
215
|
+
- **Importance-driven** — score on temporal, frequency and semantic signals together, and
|
|
216
|
+
increasingly let a model judge salience rather than a counter.
|
|
217
|
+
|
|
218
|
+
**The trap, stated because frequency-based forgetting is the easy one to reach for:**
|
|
219
|
+
LRU-style eviction *"may eliminate long-tail knowledge, which is seldom accessed but
|
|
220
|
+
essential for correct decision-making."* The rarely-read entry is often the one that
|
|
221
|
+
prevents a rare and expensive mistake — the incident, the exception, the one customer whose
|
|
222
|
+
setup differs. **When storage is not the binding constraint, do not delete: demote.** Move
|
|
223
|
+
it out of the default retrieval path and keep it reachable by explicit query.
|
|
224
|
+
|
|
225
|
+
Deletion is also a **correctness** operation, not only a capacity one — see §8.
|
|
226
|
+
|
|
227
|
+
## 7. Shared memory when there is more than one agent
|
|
228
|
+
|
|
229
|
+
The progression, and both ends are wrong:
|
|
230
|
+
|
|
231
|
+
- **Isolated memories with message passing** — no interference, but redundancy, fragmented
|
|
232
|
+
context and communication overhead that grows with team size.
|
|
233
|
+
- **A naive global store** — every agent reads and writes one space. This buys joint
|
|
234
|
+
attention and costs **memory clutter, write contention, and no role- or permission-aware
|
|
235
|
+
access control**.
|
|
236
|
+
|
|
237
|
+
**What this pack already has, and what it is not.** `agent-sync` gives leases, race-free id
|
|
238
|
+
reservation and a run journal: it decides *who may write this file right now*. That is
|
|
239
|
+
coordination, and it is not shared memory — it says nothing about what an agent should be
|
|
240
|
+
allowed to *read*, or whose experiential memory is trustworthy enough to act on. An agent
|
|
241
|
+
system that needs both needs both.
|
|
242
|
+
|
|
243
|
+
**The design rule:** make shared writes **attributed and scoped**. An entry carries who
|
|
244
|
+
wrote it and under what role, and a reader may weigh it accordingly. Unattributed shared
|
|
245
|
+
memory means one agent's wrong conclusion becomes every agent's premise, with nothing in
|
|
246
|
+
the record to trace it back.
|
|
247
|
+
|
|
248
|
+
## 8. Trustworthy memory
|
|
249
|
+
|
|
250
|
+
Three pillars, and the survey's position is that these stop being features and become
|
|
251
|
+
requirements once an agent is deployed and persistent.
|
|
252
|
+
|
|
253
|
+
**Privacy.** Agent memory holds user-specific, persistent and potentially sensitive content
|
|
254
|
+
— a different risk class from a document index. Memory modules have been shown to **leak
|
|
255
|
+
private data through indirect prompt injection**: text the agent read becomes text the
|
|
256
|
+
agent stored becomes text the agent will repeat. Three controls: do not store what the task
|
|
257
|
+
does not need (the same rule `error-tracking` applies before events reach a third party),
|
|
258
|
+
scope reads, and make **verifiable forgetting** possible — which is exactly what parametric
|
|
259
|
+
memory (§2) cannot offer, and the strongest argument for keeping deletable knowledge in
|
|
260
|
+
token-level form.
|
|
261
|
+
|
|
262
|
+
**Explainability.** *"Users and developers still lack tools to trace which memory items
|
|
263
|
+
were retrieved, how they influenced generation, or whether they were misused."* Minimum
|
|
264
|
+
bar, and it is cheap if built in from the start: every retrieval is logged with the ids it
|
|
265
|
+
returned, and every answer that used memory can name the entries it used. Retrofitted, it
|
|
266
|
+
is a rewrite.
|
|
267
|
+
|
|
268
|
+
**Hallucination robustness.** The point of memory is fewer invented answers, and a memory
|
|
269
|
+
layer can add them: a confidently retrieved stale entry is worse than an empty store,
|
|
270
|
+
because it carries authority. **Abstention under low-confidence retrieval** — say *"I do not
|
|
271
|
+
have this"* rather than answer from the best of a bad set — is the single highest-value
|
|
272
|
+
behaviour here, and it needs the similarity floor from §5.3 to be expressible at all.
|
|
273
|
+
|
|
274
|
+
## 9. What this pack does NOT claim
|
|
275
|
+
|
|
276
|
+
Named so a reader does not take this file for more than it is:
|
|
277
|
+
|
|
278
|
+
- **No benchmark numbers are reproduced here.** The survey tabulates benchmarks (LoCoMo,
|
|
279
|
+
LongMemEval, MemBench, StreamBench and others, §6.1); which of them fits a given system
|
|
280
|
+
is an `agent-evals` question and none of them is quoted as a result.
|
|
281
|
+
- **The frontier sections are frontiers.** RL-trained memory management, latent/generative
|
|
282
|
+
memory, and offline consolidation are stated in the survey as open directions, not
|
|
283
|
+
settled practice. They are in §2 as forms with costs, and nothing here recommends
|
|
284
|
+
building on them.
|
|
285
|
+
- **This file was written from the survey, not from running these systems.** Where the pack
|
|
286
|
+
has its own measured experience — §7's layers, `patterns.md`'s confidence arithmetic —
|
|
287
|
+
that is marked as the pack's and is not attributed to the paper.
|
|
288
|
+
|
|
289
|
+
## 10. The checklist
|
|
290
|
+
|
|
291
|
+
Before an agent gets memory, answer these. An unanswered row is a decision that will be
|
|
292
|
+
made by accident:
|
|
293
|
+
|
|
294
|
+
1. **Which functions does it need?** Factual-user, factual-environment, experiential,
|
|
295
|
+
working — name each one you are building. Not all four are always needed; the ones you
|
|
296
|
+
skip should be skipped on purpose.
|
|
297
|
+
2. **What form carries each?** Default token-level and flat. Any other answer names the
|
|
298
|
+
cost it is paying for (§2).
|
|
299
|
+
3. **What forms a memory?** The contrast rule for experiential (§8 of `SKILL.md`); an
|
|
300
|
+
explicit write path for factual. Never "log the transcript".
|
|
301
|
+
4. **When is it retrieved, and is that decision logged — including the negatives?** (§5.1)
|
|
302
|
+
5. **What is the query?** Raw user text is the answer only if you have checked it works.
|
|
303
|
+
(§5.2)
|
|
304
|
+
6. **Is there a relevance floor, so "nothing relevant" is expressible?** (§5.3)
|
|
305
|
+
7. **What expires, what decays, what is demoted rather than deleted?** (§6)
|
|
306
|
+
8. **If more than one agent writes it: who wrote this entry, under what role?** (§7)
|
|
307
|
+
9. **Can a person see, correct and delete what is held about them?** (§8)
|
|
308
|
+
10. **What eval fails if memory is silently disabled?** If none, the memory layer is
|
|
309
|
+
unmeasured and its value is a belief. (`agent-evals`)
|
|
310
|
+
|
|
311
|
+
## 11. The rest of it
|
|
312
|
+
|
|
313
|
+
This file is the decision spine and it deliberately stops at decisions. Two siblings carry
|
|
314
|
+
the depth, both pinned to the same survey and the same read date:
|
|
315
|
+
|
|
316
|
+
- [`memory-lifecycle.md`](memory-lifecycle.md) — the **write path**. Five ways to turn
|
|
317
|
+
experience into an entry and how each one fails, consolidation at three granularities,
|
|
318
|
+
why temporal annotation beats deletion when a fact is superseded, dual-phase updating,
|
|
319
|
+
and the three forgetting policies. It ends with a table of what this pack already
|
|
320
|
+
implements and three things it deliberately does not.
|
|
321
|
+
- [`memory-landscape.md`](memory-landscape.md) — **build or adopt**, the axes that actually
|
|
322
|
+
separate the twenty-odd open-source memory frameworks, which benchmarks measure what, and
|
|
323
|
+
which frontier ideas are directions rather than practice. Its last section is the one
|
|
324
|
+
frontier worth acting on now: exposing memory operations as tools the agent calls, which
|
|
325
|
+
makes every memory decision visible in the trace — including the decision not to
|
|
326
|
+
retrieve.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Memory landscape — what exists to build on, what to measure with, where it is going
|
|
2
|
+
|
|
3
|
+
**Load this when** deciding whether to build a memory layer or adopt one, choosing what to
|
|
4
|
+
evaluate it against, or judging whether a technique somebody is proposing is settled
|
|
5
|
+
practice or a research direction.
|
|
6
|
+
|
|
7
|
+
**Source:** the survey pinned in [`memory-architecture.md`](memory-architecture.md)
|
|
8
|
+
— §6 resources, §7 positions and frontiers. That file is its one home; repeating the citation here would give it two.
|
|
9
|
+
|
|
10
|
+
**Read the dates on everything here.** This is the fastest-moving part of the subject, and
|
|
11
|
+
a landscape file is stale the day after it is written. What does not go stale is the
|
|
12
|
+
*shape*: which axes the frameworks differ on, and which of the frontier ideas is a
|
|
13
|
+
direction rather than a practice.
|
|
14
|
+
|
|
15
|
+
## Contents
|
|
16
|
+
|
|
17
|
+
- [1. Build or adopt](#1-build-or-adopt)
|
|
18
|
+
- [2. Frameworks, by what actually separates them](#2-frameworks-by-what-actually-separates-them)
|
|
19
|
+
- [3. Evaluating a memory layer](#3-evaluating-a-memory-layer)
|
|
20
|
+
- [4. Frontiers — and which of them is not practice yet](#4-frontiers--and-which-of-them-is-not-practice-yet)
|
|
21
|
+
- [5. The one that changes how you build today](#5-the-one-that-changes-how-you-build-today)
|
|
22
|
+
|
|
23
|
+
## 1. Build or adopt
|
|
24
|
+
|
|
25
|
+
An ecosystem of open-source memory frameworks exists — the survey tabulates around
|
|
26
|
+
twenty-five, including MemGPT, Mem0, Memobase, MemoryOS, MemOS, Zep, LangMem, Cognee,
|
|
27
|
+
Memary, MIRIX, and vector stores used as memory (Pinecone, Chroma, Weaviate).
|
|
28
|
+
|
|
29
|
+
**What most of them give you** is storage plus retrieval: a vector or graph database, an
|
|
30
|
+
API, a short/long-term split. **What most of them leave to you** is the part that decides
|
|
31
|
+
whether the memory works — *"they often leave agent behavior and evaluation protocols to
|
|
32
|
+
the application."*
|
|
33
|
+
|
|
34
|
+
So the honest framing of the choice:
|
|
35
|
+
|
|
36
|
+
| | Adopting a framework | Building on your own store |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| You get | schema, indexing, retrieval, a short/long split | nothing you did not write |
|
|
39
|
+
| You still own | formation policy, what enters at all, forgetting policy, retrieval timing, **evals** | the same list |
|
|
40
|
+
| Argues for it | not writing an index; graph or temporal support you would not build | your entries are few and structured, and a table plus a query is genuinely enough |
|
|
41
|
+
|
|
42
|
+
**The decision is usually smaller than it looks.** The parts that go wrong — deciding what
|
|
43
|
+
becomes a memory, when to retrieve, what to abstain on, what to demote — are yours in both
|
|
44
|
+
columns. Adopt for the index, not for the judgement.
|
|
45
|
+
|
|
46
|
+
## 2. Frameworks, by what actually separates them
|
|
47
|
+
|
|
48
|
+
Rather than a list that expires, the axes that distinguish them — check a candidate on
|
|
49
|
+
these:
|
|
50
|
+
|
|
51
|
+
- **Does it model experiential memory, or only factual?** Several store facts well and have
|
|
52
|
+
no notion of a strategy learned from a trajectory. If the agent is supposed to improve,
|
|
53
|
+
this is the axis that matters.
|
|
54
|
+
- **What is the structure?** Hierarchical short/long-term, graph, temporal knowledge graph,
|
|
55
|
+
flat vectors, profile-based. This decides which queries are cheap. (§3 of
|
|
56
|
+
`memory-architecture.md`.)
|
|
57
|
+
- **Is temporal validity first-class?** A store that can express *"this was true until
|
|
58
|
+
March"* supports soft updating; one that cannot will make you delete history to stay
|
|
59
|
+
correct.
|
|
60
|
+
- **Does it report results on memory benchmarks at all?** Most do not. Absence is not
|
|
61
|
+
failure, but a framework with published LoCoMo or LongMemEval numbers has at least been
|
|
62
|
+
measured by someone.
|
|
63
|
+
- **Multimodal?** Most are text-only. The survey is explicit that **no system provides
|
|
64
|
+
truly omnimodal support** yet.
|
|
65
|
+
|
|
66
|
+
## 3. Evaluating a memory layer
|
|
67
|
+
|
|
68
|
+
The survey groups benchmarks two ways, and the split is the useful part.
|
|
69
|
+
|
|
70
|
+
**Memory-oriented** — built to test memory directly. `LoCoMo` and `LongMemEval` are the two
|
|
71
|
+
most frequently reported and the closest thing to a common yardstick. `PersonaMem`,
|
|
72
|
+
`PrefEval`, `MemoryBank`, `PerLTQA`, `MPR` stress user modelling and preference tracking.
|
|
73
|
+
`StreamBench`, `LifelongAgentBench`, `MemoryAgentBench`, `Evo-Memory` test lifelong and
|
|
74
|
+
self-evolving behaviour — new information arriving while old information becomes obsolete
|
|
75
|
+
or conflicting. `HaluMem` targets memory-induced hallucination specifically.
|
|
76
|
+
|
|
77
|
+
**Long-horizon agent benchmarks that stress memory implicitly** — `SWE-Bench Verified`,
|
|
78
|
+
`GAIA`, `WebArena`, `ToolBench`, `ALFWorld`. Memory is not the measured target, but
|
|
79
|
+
performance depends on it.
|
|
80
|
+
|
|
81
|
+
**Which to use is not the first question.** The first question is the one `agent-evals`
|
|
82
|
+
asks: **what fails if memory is silently disabled?** A public benchmark measures a system
|
|
83
|
+
against a distribution that is not yours. A fixture built from your own traces, where the
|
|
84
|
+
answer is obtainable *only* from memory, catches the failure mode this whole subject is
|
|
85
|
+
about — the agent that skips retrieval and answers confidently from nothing
|
|
86
|
+
(`memory-architecture.md` §5.1). Build that fixture first; reach for a public benchmark
|
|
87
|
+
when you need to compare against somebody else's system.
|
|
88
|
+
|
|
89
|
+
**Instrument the negatives.** A memory never queried and a memory that is empty score
|
|
90
|
+
identically on every benchmark. Only the retrieval log separates them.
|
|
91
|
+
|
|
92
|
+
## 4. Frontiers — and which of them is not practice yet
|
|
93
|
+
|
|
94
|
+
Marked plainly, because the risk with a survey's frontier section is building on a
|
|
95
|
+
direction as though it were a technique.
|
|
96
|
+
|
|
97
|
+
| Frontier | State | What it would change |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| **Memory generation** (over retrieval) | direction | memory synthesized on demand for the current task rather than fetched and concatenated. Two shapes: *retrieve-then-generate*, which is buildable now and is essentially §5.4 post-retrieval taken seriously; and *direct generation* with no retrieval step, which is research |
|
|
100
|
+
| **Automated memory management** | early | the agent reasons about its own memory through **explicit tool calls** — add/update/delete/retrieve as actions in its loop rather than a module beside it. See §5 |
|
|
101
|
+
| **RL-driven memory** | research | the progression is RL-free → RL for selected operations (reranking, the write policy) → fully learned. Most production systems are and will remain RL-free |
|
|
102
|
+
| **Multimodal memory** | partial | vision is furthest along, audio underexplored, and **no omnimodal system exists** |
|
|
103
|
+
| **Shared memory for multi-agent** | early | from isolated stores with message passing, through naive global stores, toward **role- and trust-aware** access. `memory-architecture.md` §7 |
|
|
104
|
+
| **Trustworthy memory** | **requirement, not frontier** | privacy, explainability, hallucination robustness. `memory-architecture.md` §8 |
|
|
105
|
+
| **Offline consolidation** ("sleep") | direction | a dedicated interval to reorganize, prune and replay, away from latency constraints. The buildable half of it is the **dual-phase update** in `memory-lifecycle.md` §4 |
|
|
106
|
+
|
|
107
|
+
## 5. The one that changes how you build today
|
|
108
|
+
|
|
109
|
+
Of everything above, **automated memory management via explicit tool calls** is the item
|
|
110
|
+
worth acting on now, and it costs little.
|
|
111
|
+
|
|
112
|
+
Instead of a memory module that runs beside the agent — summarizing on a timer, evicting on
|
|
113
|
+
a policy, retrieving on every turn — expose memory operations as **tools the agent calls**:
|
|
114
|
+
`memory.search`, `memory.write`, `memory.update`, `memory.forget`. Three consequences, and
|
|
115
|
+
they are what make it worth doing rather than an aesthetic preference:
|
|
116
|
+
|
|
117
|
+
1. **The decisions become legible.** Every memory operation is a tool call in the trace,
|
|
118
|
+
which means `agent-evals` can judge them and the retrieval log from
|
|
119
|
+
`memory-architecture.md` §5.1 exists for free — including the negatives, because a turn
|
|
120
|
+
with no `memory.search` call is visibly a turn that chose not to retrieve.
|
|
121
|
+
2. **The agent can reason about them** — retrieve, find it insufficient, decompose and
|
|
122
|
+
retrieve again, which is the fast–slow pattern that the timing stage needs anyway.
|
|
123
|
+
3. **They inherit everything the tool layer already has** — descriptions the model can act
|
|
124
|
+
on (`agent-harness`), error hierarchies, budgets and loop guards (`SKILL.md` §2).
|
|
125
|
+
|
|
126
|
+
**The cost, so it is a choice:** more model calls, and a model that can decline to use
|
|
127
|
+
memory at all. That second one is the silent failure mode again, which is why point 1
|
|
128
|
+
matters — with tool calls you can *see* it happen, and with a background module you cannot.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Memory lifecycle — how an entry is made, changed and thrown away
|
|
2
|
+
|
|
3
|
+
**Load this when** writing the code that decides what becomes a memory, how a new entry
|
|
4
|
+
meets the ones already there, and what leaves. `memory-architecture.md` decides *what kind*
|
|
5
|
+
of memory is being built and owns retrieval; this file is the **write path**.
|
|
6
|
+
|
|
7
|
+
**Source:** the survey pinned in [`memory-architecture.md`](memory-architecture.md)
|
|
8
|
+
— §5.1 formation, §5.2 evolution. That file is its one home; repeating the citation here would give it two.
|
|
9
|
+
|
|
10
|
+
The three operators run at **different frequencies**, and that is the design. Formation can
|
|
11
|
+
run per turn, evolution per task boundary or offline, retrieval per call. Short- and
|
|
12
|
+
long-term behaviour is a consequence of those frequencies, not of separate boxes.
|
|
13
|
+
|
|
14
|
+
## Contents
|
|
15
|
+
|
|
16
|
+
- [1. Formation — five ways to turn experience into an entry](#1-formation--five-ways-to-turn-experience-into-an-entry)
|
|
17
|
+
- [2. Choosing among them](#2-choosing-among-them)
|
|
18
|
+
- [3. Evolution — consolidation](#3-evolution--consolidation)
|
|
19
|
+
- [4. Evolution — updating, and the stability–plasticity dilemma](#4-evolution--updating-and-the-stabilityplasticity-dilemma)
|
|
20
|
+
- [5. Evolution — forgetting](#5-evolution--forgetting)
|
|
21
|
+
- [6. What this pack already implements](#6-what-this-pack-already-implements)
|
|
22
|
+
|
|
23
|
+
## 1. Formation — five ways to turn experience into an entry
|
|
24
|
+
|
|
25
|
+
*"Instead of passively logging all interaction history, the memory system selectively
|
|
26
|
+
identifies information with long-term utility."* Five operations, and they compose — one
|
|
27
|
+
system commonly runs several.
|
|
28
|
+
|
|
29
|
+
| Operation | What it produces | Strength | The cost, stated |
|
|
30
|
+
|---|---|---|---|
|
|
31
|
+
| **Semantic summarization** | a compact narrative of a long stream | drastically shorter context; ideal for long dialogue | **lossy by design** — specific details and subtle cues get smoothed out, so it is wrong for evidence-critical tasks |
|
|
32
|
+
| **Knowledge distillation** | discrete reusable facts or strategies | fine-grained, function-specific | produces flat units with no relation between them |
|
|
33
|
+
| **Structured construction** | a graph or tree — entities, relations, hierarchy | explainability and multi-hop queries | **schema rigidity**; extraction and maintenance cost is high, and nuance that does not fit the schema is lost |
|
|
34
|
+
| **Latent representation** | vectors or KV states | high density, cross-modal, no decoding loss | **a black box** — cannot be inspected, edited or verified by a person |
|
|
35
|
+
| **Parametric internalization** | changed weights | zero retrieval cost, "instinctive" access | catastrophic forgetting, high update cost, and **cannot be precisely removed** |
|
|
36
|
+
|
|
37
|
+
### Summarization has two shapes and they fail differently
|
|
38
|
+
|
|
39
|
+
- **Incremental** — fuse each new chunk into the running summary. Supports streaming and
|
|
40
|
+
avoids reprocessing the whole history. Fails by **semantic drift**: errors compound
|
|
41
|
+
across iterations, because each summary is built from the last one.
|
|
42
|
+
- **Partitioned** — summarize segments independently, then aggregate. Finer-grained and
|
|
43
|
+
parallelizable. Fails by **losing cross-partition dependencies**, and by cutting at
|
|
44
|
+
arbitrary boundaries unless segments are chosen semantically rather than by length.
|
|
45
|
+
|
|
46
|
+
If you summarize by fixed window size, you have chosen partitioned summarization with the
|
|
47
|
+
worst possible partition rule.
|
|
48
|
+
|
|
49
|
+
### Distillation splits by what it is distilling
|
|
50
|
+
|
|
51
|
+
- **Factual** — dialogue turns into stated facts, user intent, environment state. Watch for
|
|
52
|
+
*goal drift*: separate confirmed constraints from unresolved intents, or the agent starts
|
|
53
|
+
treating a floated idea as a decision.
|
|
54
|
+
- **Experiential** — strategies from trajectories. **From contrast, not from success.** The
|
|
55
|
+
survey's own split confirms what §8 of `SKILL.md` already requires: success-only
|
|
56
|
+
distillation learns the agent's habits, and the systems that work compare successful and
|
|
57
|
+
failed runs, or reflect against ground truth.
|
|
58
|
+
|
|
59
|
+
## 2. Choosing among them
|
|
60
|
+
|
|
61
|
+
The question is not which is best. It is **what the memory will be asked for later**:
|
|
62
|
+
|
|
63
|
+
| If the later question is… | Form it now with |
|
|
64
|
+
|---|---|
|
|
65
|
+
| "what happened, roughly" | semantic summarization |
|
|
66
|
+
| "what is true about X" | knowledge distillation, factual |
|
|
67
|
+
| "how do I do this kind of task" | knowledge distillation, experiential |
|
|
68
|
+
| "what connects to what" / multi-hop | structured construction |
|
|
69
|
+
| "match this to anything similar" at volume | latent |
|
|
70
|
+
| "behave this way, always, with no lookup" | parametric — and read §2 of `memory-architecture.md` on why this is rarely the answer |
|
|
71
|
+
|
|
72
|
+
**A schema chosen before this question has been asked is a guess.** The commonest and most
|
|
73
|
+
expensive version of that guess is a knowledge graph built because graphs sound thorough,
|
|
74
|
+
then maintained for multi-hop queries nobody runs.
|
|
75
|
+
|
|
76
|
+
## 3. Evolution — consolidation
|
|
77
|
+
|
|
78
|
+
Merging new entries with existing ones so learning is cumulative rather than a growing pile
|
|
79
|
+
of near-duplicates. Three granularities:
|
|
80
|
+
|
|
81
|
+
- **Local** — a new entry retrieves its top-K nearest and a model decides whether to merge.
|
|
82
|
+
Cheapest, and the one to build first.
|
|
83
|
+
- **Cluster-level** — align a new cluster with similar existing clusters and fuse. Captures
|
|
84
|
+
regularities across instances that local merging cannot see.
|
|
85
|
+
- **Global integration** — periodically distil system-level insight from the whole store.
|
|
86
|
+
|
|
87
|
+
**The cost of consolidation, which is the reason not to run it aggressively:**
|
|
88
|
+
*"it risks information smoothing, where outlier events or unique exceptions are lost during
|
|
89
|
+
the abstraction process."* The exception is often the entry worth keeping — see §5.
|
|
90
|
+
|
|
91
|
+
## 4. Evolution — updating, and the stability–plasticity dilemma
|
|
92
|
+
|
|
93
|
+
Updating resolves *conflict*; consolidation performs *abstraction*. They are different
|
|
94
|
+
operations and a system needs both.
|
|
95
|
+
|
|
96
|
+
**The trajectory the field took, and it is worth copying rather than rediscovering:**
|
|
97
|
+
early systems detected a conflict and **replaced or deleted** the old entry — destructive,
|
|
98
|
+
and it erased historical context and broke temporal continuity. The better pattern is
|
|
99
|
+
**temporal annotation**: mark the superseded fact with a validity window instead of
|
|
100
|
+
deleting it. Soft, time-aware updating keeps both semantic consistency and history.
|
|
101
|
+
|
|
102
|
+
**Dual-phase updating** is the shape that survives real load: a soft online update for
|
|
103
|
+
responsiveness, then an offline reflective pass that merges similar entries and resolves
|
|
104
|
+
conflicts properly. Eventual consistency, deliberately — because doing full reflective
|
|
105
|
+
consolidation inline puts a model call on the write path of every interaction.
|
|
106
|
+
|
|
107
|
+
**The dilemma has no general answer:** *"determining when to overwrite existing knowledge
|
|
108
|
+
versus when to treat new information as noise. Incorrect updates can overwrite critical
|
|
109
|
+
information."* What a system can do is make the decision **reversible** — which is the
|
|
110
|
+
argument for annotation over deletion, again.
|
|
111
|
+
|
|
112
|
+
## 5. Evolution — forgetting
|
|
113
|
+
|
|
114
|
+
Three policies on three different signals — creation time, access frequency, judged
|
|
115
|
+
importance. They are orthogonal and most systems need more than one.
|
|
116
|
+
|
|
117
|
+
| Policy | Signal | Watch for |
|
|
118
|
+
|---|---|---|
|
|
119
|
+
| **Time-based** | age | evicting on age alone drops stable facts that were simply written early |
|
|
120
|
+
| **Frequency-based** | reads | **the long-tail trap** — see below |
|
|
121
|
+
| **Importance-driven** | a composite, increasingly a model's judgement of salience | the judge becomes a dependency, and an unaudited judge silently sets policy |
|
|
122
|
+
|
|
123
|
+
**The long-tail trap, stated because frequency-based eviction is the easy one to reach
|
|
124
|
+
for:** *"heuristic forgetting mechanisms like LRU may eliminate long-tail knowledge, which
|
|
125
|
+
is seldom accessed but essential for correct decision-making."* The entry read twice a year
|
|
126
|
+
is often the incident, the exception, the one customer whose setup differs — precisely the
|
|
127
|
+
entry that prevents an expensive mistake.
|
|
128
|
+
|
|
129
|
+
**The rule:** where storage is not the binding constraint, **demote rather than delete**.
|
|
130
|
+
Move it out of the default retrieval path, keep it reachable by explicit query. The survey
|
|
131
|
+
reports this is what many systems do in practice: *"when storage cost is not a critical
|
|
132
|
+
constraint, many memory systems avoid directly deleting certain memories."*
|
|
133
|
+
|
|
134
|
+
Deletion remains a **correctness and privacy** operation — a person asking to be forgotten
|
|
135
|
+
is not a capacity decision, and `memory-architecture.md` §8 covers it.
|
|
136
|
+
|
|
137
|
+
## 6. What this pack already implements
|
|
138
|
+
|
|
139
|
+
Stated so this file is read as an extension and not as a replacement:
|
|
140
|
+
|
|
141
|
+
| Survey concept | Where it already lives here |
|
|
142
|
+
|---|---|
|
|
143
|
+
| Formation, experiential, from contrast | `SKILL.md` §8 · `patterns.md` → Learning Extraction Heuristics |
|
|
144
|
+
| Consolidation, local | `patterns.md` → Fuzzy Deduplication |
|
|
145
|
+
| Updating, conflict resolution | `patterns.md` → Conflict Resolution |
|
|
146
|
+
| Forgetting, time-based | `patterns.md` → Confidence Management |
|
|
147
|
+
| Global integration, cross-scope | `patterns.md` → Cross-Resource Learning Transfer |
|
|
148
|
+
| **Frequency-based forgetting** | **nowhere — and the long-tail trap above is why that is a deliberate omission rather than a gap to close carelessly** |
|
|
149
|
+
| **Temporal annotation instead of deletion** | **nowhere** — Conflict Resolution currently resolves rather than annotates |
|
|
150
|
+
| **Dual-phase updating** | **nowhere** — the pack updates inline |
|
|
151
|
+
|
|
152
|
+
The last three are named as absent rather than quietly added: each is a real change to a
|
|
153
|
+
mechanism that is in production, and this file's job is to say what the options are, not to
|
|
154
|
+
change `patterns.md` from a survey.
|