Why pay for every saved lesson on every request?
Maya maintains a financial-question agent. In our teaching example, it has 5 saved lessons, each assigned 800 serialized tokens. Her next query concerns units and reporting periods. A full-memory prompt rereads all 4,000 lesson tokens—even the lessons about other issues.
Saving experience should not force every request to reread the archive. §2.2, Proposition 1
Maya wants to retain experience without making every request pay for all of it.
About these example values
Maya, the query, graph, padded lesson records and feedback are invented teaching inputs, not an experiment from the paper. Their token lengths are assigned, not measured with a tokenizer.
Keep the archive; select the context
GraphMemory retains reusable lessons in a directed graph but answers from a bounded, query-specific subgraph, then uses reflection and local edits to improve future lesson content and retrieval relations. §2.3; §3
Keep the archive separate from the text sent to the answering model. Choose a few starting lessons, follow a limited number of useful connections, and send only those lessons. After answering, use feedback to update the archive and its connections for later questions.
For Maya, selection starts at A, the unit-normalization lesson. Traversal loads A, B, C for 2,400 tokens under the paper's content cap. Later harmful evidence lowers A→B's priority; the next retrieval loads A, C, D, still 2,400 tokens.
Relative to ACE, two interfaces change: what the Generator reads and what the Curator writes. The Curator can maintain relations as well as lessons. Helpful/harmful evidence ranks those relations without training a retrieval policy. §3; §5
The language model stays frozen. Saving “normalize units” neither changes its weights nor puts the instruction into its next prompt automatically; the read interface must supply it. Textual updates are proposed edits, not literal gradients. §1; §2.1
Why a graph is a choice, not the guarantee
The framework also admits similarity retrieval over embedded blocks. Fixed retrieval limits bound exposure; a graph could still be used to load every node. §2.3
Follow one query through the read and write paths
ACE's Generator answers, its Reflector critiques using feedback, and its Curator edits persistent lessons. GraphMemory places retrieval before the answer and applies graph updates after it. Current-target information can affect only later predictions. §3; §B.3
Teaching example. The graph persists; each answer gets a fresh budgeted context. Feedback changes later answers, never the answer just made. §3; §B.1–B.3
The seven parts and exact budgets
- Directed evidence-weighted graph
- Each node has an identifier, routing key and full procedural bullet. A directed edge says its target lesson may be useful after its source. It stores separate helpful and harmful counters. §B.1
- Routing index
- Identifiers and short keys, not full lessons. §B.1
- LLM Retriever
- Structured JSON chooses up to two index sections and six entry nodes; invalid identifiers are discarded. §B.2
- Bounded traversal
- Consider at most two outgoing neighbors per loaded node, ranked by score then target identifier. Use at most two hops, 12 loaded nodes and 2,500 serialized-content tokens. Load duplicates once. A FIFO queue visits entries, neighbors, then grandchildren: this is not a global best-first search. Algorithm 1
- Generator
- Answer from loaded text; report ordered influential loaded nodes. Adjacent identifiers form candidate transitions, not causal findings or necessarily traversed edges. §B.1; §B.3
- Reflector
- After prediction, label validated candidates helpful, harmful or neutral, with confidence from zero to one. Update existing edges only. §B.1
- Curator
- Apply validated local lesson and relation edits. Creating or removing edges is explicit; new edges start with zero counters. §3; §B.1
Glossary
- Context engineering
- Adapting a frozen model through supplied instructions, demonstrations, strategies or evidence. §1
- Context block
- A focused lesson from an experience: a strategy, correction or failure mode. §2.2
- Memory bank
- Accumulated lesson blocks: the evolving external memory state. §2.2
- Retrieval interface
- The query-dependent mechanism deciding what stored information to expose. §2.3
- Routing index
- Identifiers and short keys, excluding full bullet content. §B.1
- Directed edge
- A possible useful successor lesson, not a predefined factual predicate. §B.1
- Helpful and harmful confidence-weighted totals, treated as fractional pseudo-counts. §B.1
- Influence trace
- An ordered Generator attribution report; adjacent nodes define candidate pairs. §B.1
- Posterior-mean weight
- A smoothed edge-ranking score, not a calibrated probability of task improvement. §B.1
A harmful transition changes the next read
Predict before tracing. A, B and C were loaded; the Generator reports [A,B,C]. A→B exists; B→C does not. Reflection labels A→B harmful and B→C helpful, each with confidence 1. Before the Curator acts, what changes?
Only A→B's harmful counter changes. A helpful label cannot create B→C. Harmful evidence lowers A→B's score; deleting it requires a separate Curator operation. §B.1
Teaching fixture, not a benchmark. A=normalize units; B=percent conversion; C=align reporting periods; D=check denominator; E=cross-check ratio. Each padded record contributes 800 tokens, including its share of serialization overhead. The initial edges are A→B, A→C, A→D and B→E, all with zero counters. Semantic outputs below are supplied, not generated.
- Select entry A.Entries=[A]; Q=[(A,0)]; loaded=[]; visited=[]; tokens=0.
The fixture supplies this valid semantic entry choice; it does not imitate an LLM's understanding.
- Load A; queue its top two neighbors.Loaded=[A]; visited=[A]; tokens=800; Q=[(B,1),(C,1)].
All three outgoing edges tie at one half. Target-identifier order puts B and C before D; only the top two are considered.
- Finish the breadth-first queue.B loads: 1,600 tokens; Q=[(C,1),(E,2)]. C loads: 2,400 tokens; Q=[(E,2)]. E is visited but rejected: 3,200 would exceed 2,500. Final loaded=[A,B,C]; visited=[A,B,C,E]; Q=[].
B queues E behind C. Admission is checked before loading or expanding E: reachable does not mean supplied to the Generator.
- Answer, then report influence.Context=[A,B,C], 2,400 tokens; M=[A,B,C]; pairs=[A→B,B→C]. No graph edits yet.
Adjacent reported influences define candidates. They need not replay traversal edges, and are not evidence of causal benefit.
- Process evidence on existing edges.A→B: S=0, F=1, score=1/3. A→C, A→D, B→E: S=0, F=0, score=1/2. B→C: absent.
Harmful confidence increments F on A→B. The helpful B→C label cannot create a missing edge.
- Separately create B→C.Curator creates B→C: S=0, F=0, score=1/2. A→B remains present; all 5 lessons remain stored.
The explicit validated Curator operation starts a new edge at zero evidence. It does not inherit the earlier helpful label.
- Retrieve afresh from A.A successors: C:1/2, D:1/2, B:1/3. After A: Q=[(C,1),(D,1)]. Final loaded=[A,C,D]; tokens=2,400; max loaded depth=1.
C and D now win the local top-two ranking. B and its edge are still stored; this read simply does not select them.
Rules: §B.1–B.3, Algorithm 1. Result: 5 lessons remain stored (4,000 fixture tokens); both reads load 2,400 tokens, but different lessons.
What validation rejects
Hallucinated or unloaded identifiers, duplicate pairs, invalid labels and confidences outside the allowed range are discarded. Each unique transition is updated at most once per example. §B.1
A graph is not the guarantee
The graph still stores all five fixture lessons, but the Retriever returns no valid entry identifier. How many memory-content tokens reach the Generator?
Zero. This implementation answers without a memory block when selection is empty. Sending the whole archive would violate its explicit no-full-memory-fallback policy. §B.2
Full-playbook exposure versus selective exposure
Same input: Maya's query and the same 5 stored lessons.
Full-memory read
All lessons enter the prompt: 4,000 fixture tokens.
GraphMemory read
Select A, traverse: A, B, C, 2,400 fixture tokens initially.
One difference: a bounded retrieval interface mediates exposure; persistent storage is not automatically the prompt. §2.2; §3
A graph with a full-memory fallback
Same input: the same graph and query, but no valid selected entry.
Hypothetical fallback
Serialize all 4,000 fixture tokens.
The paper's implementation
Supply 0 memory-content tokens; generate without a memory block.
One difference: the fallback policy determines whether failed routing restores full-memory exposure. The fallback here is a counterexample, not GraphMemory behavior. §B.2
The full-memory comparison is not a literal append-only ACE implementation
ACE and Dynamic Cheatsheet can edit, merge and delete. The append-only scaling analysis is an idealized regime, not a claim that every update is a literal append. §2.2
Change future retrieval without erasing memory
Make the next retrieval exclude B without deleting it. Then find a setting where the content bound leaves no companion lessons.
Teaching simulation: supplied entry choice, fixed-confidence reflection and a canned Curator edit. No accuracy, total-system-token or latency prediction.
Try these changes
- With harmful feedback and the paper's cap, exclude B while checking that A→B still exists.
- Switch to neutral. Which successor wins a tie?
- Choose no valid entry at the largest cap. Can capacity fix routing?
- Reduce the cap to one padded record. Are any transitions observed?
Next: [A, C, D] · 2,400 tokens
A→B: S=0, F=1; score=1/3; still stored
B→C after evidence: absent
B→C after curation: S=0, F=0; score=1/2
Stored: 5 lessons · 4,000 tokens
The next read reroutes without deleting B or A→B.
Each read starts fresh from storage, not the last prompt. Loaded content never exceeds the cap. Evidence alone never creates or deletes edges. §B.1; Algorithm 1
Model assumptions and raw snapshots
Record lengths are assigned teaching values; labels stand for padded text. The model implements FIFO traversal, visited-on-pop admission, local top-two ranking and identifier tie-breaks, two-hop and 12-node limits. Smaller caps are teaching interventions; the paper uses 2,500.
Only one experience and another read are modeled. The semantic LLM decisions are canned. Node revisions, merges, removals, variable confidence, index sections and multiple entries are omitted. The influence sequence is filtered to loaded identifiers; only observed existing edges receive evidence. The supplied Curator creates B→C only when both were loaded.
Default fixture: initial [A,B,C]; next [A,C,D].
Test vectors
What the equations bound—and what they do not
Average loss evaluates a context across examples. A locally extracted lesson can simply encode its source answer, so successful local extraction is not equivalent to optimizing global risk. Our deterministic fixture deliberately has no scored answer or accuracy model. §2.1–2.2; §A.2
With the model frozen, seek admissible context text with the lowest average expected task loss. Eq. 1
Symbols → the worked example
| Symbol | Meaning and example value |
|---|---|
| Context risk, dataset, size and example index. No scored dataset is instantiated in the fixture. | |
| Expectation over model/execution randomness and task loss. The fixture is deterministic and omits task loss. | |
| Frozen model and supplied context. A canned answer/trace interface; initially serialized A, B, C. | |
| Input and target. Maya's units/periods query; no numeric target simulated. | |
| Admissible contexts, minimizing context, and set of minimizers. No global search or optimum computed. |
A black-box oracle proposes an edit; the system applies it. This is neither a gradient nor a guaranteed loss reduction. Eq. 3
Symbols → the worked example
| Symbol | Meaning and example value |
|---|---|
| Update index and black-box oracle. One supplied reflection/curation update. | |
| Current context, input and pre-reflection prediction. Initial A, B, C, Maya's query, and an unscored placeholder answer. | |
| Feedback/trace and proposed edit. Supplied trace and labels; the concrete edit creates B→C. | |
| Apply a textual edit; updated context state in the abstraction. The concrete implementation edits stored graph state and retrieves A, C, D afresh, rather than appending the previous read. |
Accumulating lessons and choosing which lessons to expose are separate operations. Eq. 7
Symbols → the worked example
| Symbol | Meaning and example value |
|---|---|
| Before/after memory bank and update index. All 5 fixture lessons remain after one experience. | |
| New lesson and adding it to storage, not every prompt. This accumulation abstraction illustrates node addition; the fixture instead makes a relation edit, adding no node. | |
| Retrieval interface, query and newly composed context. Supplied selection plus bounded traversal on Maya's query yields A, C, D after the update. |
Fixed block-length and retrieval-count limits bound retrieved memory content independently of experience count—not complete system costs. Eq. 8; §B.5
Symbols → the worked example
| Symbol | Meaning and example value |
|---|---|
| Token length and retrieved context. Initially A, B, C: 2,400 assigned tokens. | |
| Retrieval, processed-experience count and query. The fixture shows one update, not an asymptotic stream. | |
| Fixed maximum blocks, tokens per block and their product. The implementation allows 12 nodes; fixture blocks have 800 assigned tokens. Product: 9,600; the extra 2,500-token cap is tighter. | |
| Independent of experience count when both limits are fixed. Excludes stored graph and routing/index inputs. |
Rank an edge by its smoothed helpful-evidence fraction—not a causal probability of improving an answer. Eq. 19
Symbols → the worked example
| Symbol | Meaning and example value |
|---|---|
| Directed edge, evidence-history step and score. A→B: 1/2 before, 1/3 after. | |
| Parameter, evidence history and expectation under the fractional-observation Beta model. Empty history, then one harmful observation at confidence 1. | |
| Helpful and harmful totals. A→B ends at (0, 1). | |
| Smoothing terms from the uniform prior; unchanged. |
Validated helpful or harmful confidence increments its counter; neutral feedback changes neither. This operation cannot create an edge. Eq. 21
Symbols → the worked example
| Symbol | Meaning and example value |
|---|---|
| Existing validated edge and before/after evidence steps. A→B qualifies; absent B→C does not. | |
| Current counters: both zero for A→B. | |
| Reflector confidence in . Fixed to 1 in this fixture. | |
| Resulting counters: (0, 1) under the harmful default. | |
| helpful / harmful / neutral | Reflector labels; default A→B is harmful. |
Scaling and optimization context
Under the append-only abstraction, final context has an upper bound and cumulative repeated memory exposure has an upper bound. Exact final growth additionally needs positive average block length bounded away from zero. Fixed-budget retrieval gives per query and cumulative retrieved content. These are memory-exposure bounds, not total-system-token bounds. Proposition 1; §A.3
The paper abstracts MIPROv2 and GEPA as candidate searches that yield contexts fixed during test inference. Its textual gradient analogy is structural, with no convergence guarantee; these searches are background, not the simulated mechanism. §A.1
Fewer tokens, slower individual predictions
GraphMemory uses far fewer test tokens than ACE but adds a Retriever call before the Generator. What latency conclusion follows from token counts alone?
Neither direction follows from token counts alone. Both alternatives overlook the extra call and execution path. Formula/Claude measured 4.7 s per sample for GraphMemory versus 2.6 s for ACE. Table 2; §B.5
These are offline memory-construction comparisons: one epoch, validation every 100 updates, then the highest-validation-accuracy memory checkpoint is tested on held-out data. Formula splits are 500/300/200; FiNER splits are 1,000/500/441 (train/validation/test). Within each comparison the backbone settings match; Claude ACE has an 80,000-token memory cap. §B.4
Validation chooses the memory; test measures that selected memory. A validation score and a held-out score are different measurements.
Accuracy and tokens, not one combined score
| Setting / system | Initial | Best val. (step) | Final test | Train tokens | Test tokens |
|---|---|---|---|---|---|
| Formula / Claude · GraphMemory | 0.70 | 0.87 (500) | 0.81 | ∼20M | ∼1.4M |
| Formula / Claude · ACE | 0.70 | 0.88 (300) | 0.85 | ∼131M | ∼18M |
| Formula / Qwen · GraphMemory | 0.69 | 0.88 (200) | 0.84 | ∼8M | ∼0.6M |
| Formula / Qwen · ACE | 0.67 | 0.88 (200) | 0.83 | ∼42M | ∼4M |
| FiNER / Claude · GraphMemory | 0.75 | 0.80 (700) | 0.75 | ∼57M | ∼9M |
| FiNER / Claude · ACE | 0.75 | 0.80 (200) | 0.78 | ∼327M | ∼42M |
| FiNER / Qwen · GraphMemory | 0.72 | 0.79 (900) | 0.77 | ∼31M | ∼5M |
| FiNER / Qwen · ACE | Not reported: hardware memory exceeded | ||||
§4, Table 1. Claude = Haiku 4.5; Qwen = Qwen3.8-27B.
For Formula/Claude, the prose reports 84.7% fewer training tokens and 92.2% fewer test tokens, at a 4.0-percentage-point test accuracy deficit. Formula/Qwen uses 19% of ACE's training-token budget. On FiNER/Claude, GraphMemory's displayed initial and final test accuracies are both 0.75; validation gains are not universal held-out gains. The prose gives a 2.94-point FiNER deficit separately from the two-decimal table. §4
Our inference: retain the introduction's Formula/Qwen “1.5 points” separately from Table 1's 0.84 versus 0.83. The text supplies no underlying values to reconstruct hidden precision. §1; Table 1
Construction is faster; each test request is slower
| Setting / system | Train total | Per step | Test total | Per sample |
|---|---|---|---|---|
| Formula · GraphMemory | 6.4 h | 46 s | 15.7 min | 4.7 s |
| Formula · ACE | 8.1 h | 58 s | 8.6 min | 2.6 s |
| FiNER · GraphMemory | 19.0 h | 68 s | 47.1 min | 6.4 s |
| FiNER · ACE | 28.9 h | 104 s | 26.5 min | 3.6 s |
The prose reports 21.0% and 34.3% less training time, but approximately 1.8× slower individual test predictions. Timing includes the extra retrieval call. §4; Table 2; §B.5
Estimated costs, hardware and accounting
Estimated construction costs (GraphMemory / ACE): Formula/Claude $24.00 / $157.20; Formula/Qwen $5.00 / $26.25; FiNER/Claude $68.40 / $392.40. FiNER/Qwen GraphMemory is $19.38. Costs assume a 95%–5% input–output token split. Per-million-token input/output rates are $1.00/$5.00 for Claude and $0.50/$3.00 for Qwen. These are approximate API-equivalent estimates, not measured local GPU bills. Table 1 and notes
Claude Haiku 4.5 runs through LiteLLM. Qwen3.8-27B runs locally, 4-bit quantized, on an RTX 6000 with 48 GB. ACE/Qwen on FiNER exceeded that memory; no matched ACE result is reported. Missing is not a zero score. §4
Whole-system token accounting includes the Retriever index, loaded node content, instructions, query and input/output tokens from Retriever, Generator, Reflector and Curator. The constant-content theorem covers only one part of that total. §B.5
These results do not establish indefinite continual improvement, production latency under other serving arrangements, or statistically reliable superiority across tasks. The authors call for broader evaluations and repeated runs. §5
Where this lesson stops making promises
- The index still grows. The complete index is read on each route; neither storage nor complete system costs have the constant bound. §B.5
- Evidence follows the policy. Highly ranked edges get more chances to be observed. Posterior-mean ranking does not reward uncertainty explicitly; scores are neither causal interactions nor calibrated accuracy probabilities. §B.1
- Edits can fail. Textual proposals need not decrease loss; source-example lessons can overfit. There is no gradient-descent or convergence guarantee. §2.1; §A.2
- The evaluation is preliminary. Two related tasks, two models, one primary baseline and one epoch. Broader comparisons, repeated runs, longer streams and cross-model transfer remain open. Embedding/hybrid retrieval, caching and better routing are proposed remedies, not evaluated fixes here. §5; §B.4
Our inference: without equally budgeted non-graph retrieval and component ablations, the whole-system ACE comparison cannot isolate the value of graph relations, evidence weighting or LLM entry selection. §4–5
Our inference: reporting precision should stay visible. The introduction's Formula/Qwen advantage and the FiNER prose deficit should not be used to invent unreported digits behind Table 1's displayed accuracies. §1; §4, Table 1
Questions left open
- How do equally budgeted embedding, hybrid and graph retrieval compare in accuracy, tokens and latency?
- Would uncertainty-aware exploration improve relation evidence?
- Do apparent late-stage stability benefits persist across repeated runs and longer streams?
- Can memory built by a larger model reliably transfer to a smaller one?
- What routing interface works when even the compact index is expensive to read?
Explain it without the diagram
Answer each in your head before opening its reference answer.
Reconstruct the mechanism
In the default update, which counters change, when does B→C first exist, and why does the next retrieval load A,C,D?
Check the update
A→B changes from zero counters to (0, 1); its score becomes 1/3. B→C stays absent during evidence processing and first exists after explicit Curator creation, with zero counters and score 1/2. A→C and A→D still score one half, so they win the local top-two rule. Candidates, evidence updates and structural edits are different operations. §B.1–B.2
Transfer the bound
New teaching case: a deployment stores 100,000 lessons and guarantees at most four retrieved blocks of at most 200 tokens each. Its Retriever still reads every index entry. What bounds Generator lesson content, and which costs can still grow?
Check the bound
At most 800 lesson-content tokens reach the Generator. The archive and full routing index can still grow; total retrieval input, system cost and latency are not proved constant. Multiply fixed retrieved-block count by fixed block size—not by archive size. Proposition 2; §B.5
Find the boundary
In Maya's fixture, retain the 2,500-token cap but make entry selection invalid. What do generation and evidence updating receive, and what would raising the cap repair?
Check the failure mode
Generation receives no memory block. No loaded-node transitions are available to update. Raising the cap repairs nothing: there is no valid starting node and no full-memory fallback. Capacity cannot supply a missing semantic route. §B.2