Learning in a world of notes

Training compounds the benefits of text memory, making agents more intelligent, cost effective, and robust.

Continual learning is about more than internalizing new knowledge — it’s about learning to leverage the memory systems at your disposal. Text memory, like notes, wikis, and skill files, is the main way today’s agents accumulate knowledge. But having good notes isn’t enough; you need to know how to use them well. Training allows agents to hone their judgement so that they know what their notes are useful for, which notes to read, and when to supplement notes with primary sources. This post studies how training and text memory multiply, making agents more intelligent, cost effective, and robust.

We study the interaction of text memory and training in a simple setting: we give a model a fixed set of high-quality notes and an optimized prompt, and then we train it with reinforcement learning. By learning to use their notes, models achieve substantial gains — anywhere from 7 to 20pp improvement in accuracy across our benchmarks. Trained models outperform both their untrained counterparts and frontier models with the same notes.

It also turns out that training costs roughly 5-30% as much as building a good text memory system. And because the trained models cost less per query at inference time than frontier models of similar accuracy, the cost of training is amortized over queries, paying for itself within days.

Finally, notes are dynamic — agents keep exploring and updating their notes with what they learn. Yet trained models turn out to be surprisingly robust to these changes. A model trained once on an initial version of its notes still beats an untrained one after 23M tokens of text edits. The model learns general strategies for using notes rather than overfitting to their contents, so it doesn’t need to be retrained after every edit.

Together, these results show that training compounds the benefits of text memory. Agents of the future won’t just read and write notes, they will learn to remember.

Setup

Figure 1:Experimental setup

Harness

Fixed during RL

Notes notes/

Raw files files/

developer-setup.mdOutdatedOn your laptop:python -m venv .venv
.venv/bin/pip install -r requirements.txt

RL training

I’m a new engineer. Which setup instructions should I follow, and which are outdated?
Agent
Update model weights
  • Final answer

    Use the plan from engineering-onboarding.md.

    The local Python steps in developer-setup.md are outdated.

    Keep Git/editor local; run setup and checks in the container.

The harness, workspace, and notes stay fixed during RL while only the model weights change. This rollout is illustrative: the agent can consult notes and source files in any order.

Workspaces and tasks. We evaluate on three workspaces.

  • Harvey C&H is a synthetic law firm introduced in our previous post, with about 100M tokens covering client matters, including emails, memos, legal documents, and spreadsheets. Tasks require searching across the firm’s prior work, such as finding antitrust matters that received regulatory clearance and locating the supporting documents. We report results on a 125-question subset of the benchmark.1

  • Hex Shorelane Commerce is a data warehouse of a synthetic office-supplies business with realistic inconsistencies in identifiers and definitions. We evaluate on DataBench2, data analysis tasks that require querying the warehouse while navigating these inconsistencies. Examples include explaining trends across sales channels and deciding whether to approve increases in paid media spend based on historical data.

  • Engram Internal is an October 2026 snapshot of our own Notion workspace, covering research, engineering, product planning, and customer conversations. Tasks require reconciling updates over time and grounding recommendations in the company’s work, such as tracing how team goals evolved across daily stand-ups.

Starting point. We use Qwen 3.8 27B on Harvey C&H and Engram Internal, and GLM-5.3-Flash on Hex. The agents run in the Pi harness with access to the workspace and its notes, and on Hex, the warehouse is reached through Hex’s MCP server rather than a filesystem.

Unless stated otherwise, the notes are written by a separate note-building agent, using our internal recipe with Claude Sonnet and Haiku. The agent we train never writes notes; it only reads them, using a system prompt optimized by GEPA3. Our baseline is this agent, equipped with the notes and optimized prompt, before any training.

Training. We use a simple setup for this blog post: RL (GRPO4) with LoRA5, on training tasks disjoint from the evaluation sets. The reward combines task accuracy with a cost penalty, and varying its weight λ gives models with different balances of accuracy and efficiency. During training, the harness, workspace, notes, and system prompt stay fixed; only the model is updated.

Training compounds strong notes

Figure 2:Training with text notes improves accuracy and efficiency
Base modelBase + notesTrained with notes

Harvey C&H

Accuracy versus mean rollout tokens per query. Tab through points for values; green points also show the cost penalty.
Rollout tokens per query

Hex DataBench

Accuracy versus mean rollout tokens per query. Tab through points for values; green points also show the cost penalty.
Rollout tokens per query

Engram Internal

Accuracy versus mean rollout tokens per query. Tab through points for values; green points also show the cost penalty.
Rollout tokens per query
Rollout tokens per query
Training magnifies the gains of notes across our three workspaces. Sweeping the cost penalty leads to different points on the Pareto frontier.

We first ask whether reinforcement learning adds anything on top of high-quality notes and a carefully optimized prompt. In each workspace, we compare three methods: the base model working from the raw workspace alone, the base model with notes, and models trained with notes at several values of the cost penalty λ.

Across all three workspaces, the pattern is the same: notes help, and training adds a clear gain on top. On Harvey C&H, the notes already do most of the work, but training still raises accuracy to 80%. The gain is largest on Hex, where notes alone help only modestly and training lifts accuracy by 15 points. These gains don’t have to come at a higher inference cost: with a moderate efficiency penalty, the trained model beats the notes-only baseline on both accuracy and token use in every workspace. More broadly, across penalty settings, the trained models form a frontier above the training-free baselines.

Two ablations round out the picture (Appendix Table 2 and Figure 7). As a control, we train without notes. This still improves on the base model, but falls short of training with notes, so some of training’s gains depend on having notes to work with. Training also helps on top of notes from an alternative, more prose-heavy recipe, so its gains aren’t tied to one way of building notes.

Comparison to frontier models

Figure 3:Trained models compete with the frontier
Frontier modelFrontier + notesTrained model with notes
Hover, focus, or tap any point for its model, accuracy, and cost per query. Green stars are trained models; filled circles have notes and hollow circles do not. The cost axis is logarithmic.

A team that isn’t training would most likely use a frontier model with their notes. We also compare trained models with a range of OpenAI and Anthropic models at several reasoning-effort levels, each with and without the same notes6. On Hex, RL training with notes isn't fully able to match frontier performance, perhaps because the analysis task is too difficult for the small base model in these experiments. However, on Harvey C&H and our internal workspace, training with notes is enough to push small models to the Pareto frontier of cost and quality. On Harvey C&H, for example, the trained model matches GPT-6 Sol (medium effort) with notes at 78% accuracy, but costs $0.06 per query against $0.17.

The cost of training

Figure 4:Training cost is amortized over inference
Trained model
Performance-matched frontier model

Cumulative cost

20 users × 20 queries/day

Notes cost: $1,894.49Training cost: $372.57
Qwen 3.8-27B with notes, λ = 0.05 starts at $2,267.06 and costs $0.0608 per query. Shaded bands show $1,894.49 for notes and $372.57 for training. GPT-6 Sol medium with notes starts at $1,894.49 and costs $0.1677 per query. 400 queries per day.Break-even: 8.7 days3,487 queries
Table 1:Upfront costs and break-even estimates
BenchmarkNotes cost (including prompt optimization)Training costSelected modelCheapest frontier model within ±1 percentage pointBreak-even (20 users x 20 queries / day)
Harvey C&H$1,894.49$372.57Qwen 3.8-27B + notes, λ=0.05 (77.84%)GPT-6 Sol medium with notes (77.92%)8.7 days
Hex DataBench$245.31$45.12GLM-5.3-Flash + notes, λ=0 (38.00%)Sonnet 5.5 medium without notes (38.00%)7.4 days
Engram Internal$2,007.24$123.31Qwen 3.8-27B + notes, λ=0 (90.60%)Sonnet 5.5 high with notes (90.15%)0.7 days

Trained models often match frontier models given the same notes, at a much lower cost per query. But training adds an upfront cost that using a frontier model doesn’t. When does that cost pay off?

We find that the upfront cost of reinforcement learning is smaller than expected; taking gradients can be cheap compared to building good text memory7. Under our cost model, we find that training only costs around 5-30% as much as building notes8 and optimizing its prompt (Table 1).

Because training reduces the cost-per-query at inference time, the trained model pays for itself quickly. Compared with the cheapest frontier model with similar accuracy, it breaks even within days in every workspace—from under a day on Engram Internal to about 9 days on Harvey C&H, assuming a modest workload of 20 users sending 20 queries a day. Beyond that point, using the trained model is cheaper end-to-end than using a frontier model at the same accuracy.

Training endures in a changing world

Figure 5:Trained models are robust to changing notes
The gray line follows the base model as notes change. The green line starts at the initial-training marker and follows that same trained model as notes change. The separate purple point shows retraining on the final notes, reaching 79% accuracy.
Base modelInitial trainingReused modelRetraining
The green line reuses the model from the initial-training point as the notes change.

So far, we've investigated a simple setting where we train models to operate with a fixed set of notes. In practice, the world changes. As models work, notes are added, reorganized, and updated with new context. How often would we need to retrain the model? Do models trained to use notes remain effective as those notes change?

To test this, we simulate an agent exploring a workspace and writing notes over time. On Harvey C&H, the note-building agent starts with access to half of the firm’s client matters, and we reveal the rest in stages until it has seen the full workspace. At each stage, it updates the notes with what it finds. By the end, the notes have changed by about 23M tokens, more than three times their original size.

We train a model once on the initial set of notes, built over half of the workspace. As the notes are updated with more context, we reuse the trained model along with the updated notes, and compare it with the base model given the same notes.

The gains from training are surprisingly robust. Even as the updated notes lift the base model’s performance substantially, the trained model beats it at every stage, even after 23M tokens of edits. The reused model’s accuracy also rises as the notes improve even though it was trained on an earlier version, and retraining on the final notes does only slightly better. This suggests that a model learns generalizable strategies, so it doesn’t need retraining after every edit.

Training teaches strategies for using notes

What is the trained model actually learning? We first look at what the trained model carries over as the notes change in the experiment above. One simple behavior: the trained model learned to check what its notes are missing, comparing the matters they list against the workspace while the base model often takes the notes at face value. It doesn’t run this check on every query; it only does so after noticing something suspicious, such as a lookup returning fewer entries than expected (Figure 8, and the trace below). It’s a small habit about how to use notes, not what’s in them, and likely one reason the trained model keeps its advantage as the notes change.

Figure 6:Training teaches strategies for using notes
“What's our latest White Collar & Investigations matter where a litigation hold was actually put in place?”

Base + notes

Accuracy 0% · 64K total tokens

  1. Turns 1–2Notes

    Checks the practice areas in the notes. White Collar is not listed.

    Notes excerpt
    matter_metadata.jsonl · practice areas

    Antitrust · Banking & Finance · … Regulatory & Compliance · … Trusts & Estates

    no “White Collar & Investigations”

  2. Turn 7Raw documents

    Lists every file that mentions a litigation hold.

    Command & output
    rg -il "litigation hold" matters/

    <19,749 tokens of file paths>

  3. Turns 10–21Picks

    Settles on the closest practice the notes list—not White Collar—and reads the hold memos of its candidates.

    Notes excerpt
    matter_metadata.jsonl

    1045-00007 · “practice_area”: “Regulatory & Compliance”

Answer

matter 1045-00007, an SEC enforcement investigation filed under Regulatory & Compliance. The right matter, 1032-00007, is not in these notes at all; they cover only 133 of the 266 matters.

Training + notes

Accuracy 100% · 52K total tokens

  1. Turn 1Notes

    Checks the practice areas in the notes. White Collar is not listed.

    Notes excerpt
    matter_metadata.jsonl

    18 Mergers & Acquisitions · 17 Litigation · … 11 Regulatory & Compliance · …

  2. Turn 11Raw documents

    Counts which matter folders mention “white collar”.

    Command & output
    grep -rl -i "white collar" … | uniq -c

    66 1016-00009 · 30 1034-00001 · 22 1039-00005 · … 1 1032-00007

  3. Turns 13–14Gap check

    Notices missing matters. Compares the notes’ matter list with the folders.

    “These matter IDs don't exist in matter_metadata.jsonl? But the directories do exist.”

    133 meta_ids.txt · 266 dir_ids.txt; then the 133 folder IDs with no notes row

    Comparison command
    comm -23 /tmp/dir_ids.txt /tmp/meta_ids.txt
  4. Turn 34Raw documents

    Falls back to raw documents to find an unlisted matter with a confirmed litigation hold.

    Source excerpt
    1032-00007 · internal-investigation-plan-memo.md
    “Litigation hold issued to all custodians and IT systems | October 12, 2025 (completed)”
Answer

matter 1032-00007, an export-control investigation handled by the White Collar & Investigations group; the hold notice was issued October 12, 2025.

Harvey C&H: checking what the notes are missing.

We also compare the behaviors of the base model with notes versus the trained model (Figures and example traces are in Trained model behaviors and traces):

  • Harvey C&H: the trained model looks things up in the notes more often (26% more calls), but each lookup returns about a third less (36% fewer tokens). These narrower lookups get it what it needs cheaply, while the base model sometimes issues broad queries whose output gets cut off, leading to wrong answers (see the Harvey tab of Figure 10).
  • Hex: the trained model makes more notes lookups per question (9.2 vs. 6.8), but each returns less text. These focused searches can find details that broad reads of the same notes miss (see the Hex tab of Figure 10).
  • Engram Internal: the number of lookups stays about the same, but each returns less (19% fewer tokens), and more of them follow links from notes to their source files instead of directly searching across both.

What’s next

In this post, we investigated how training can amplify the benefits of text memory. Across three workspaces, training consistently improves a model’s ability to use its notes beyond what prompting alone achieves. That training is also cheap relative to building the notes, paying for itself within days. And a model trained once keeps its advantage as its notes change, even after 23M tokens of edits.

There are many interesting questions to explore from here:

Continual learning has many facets, but at its core it is about adapting to complex and changing worlds. Learning to leverage memory systems — learning to remember — is central to this goal. That’s what we’re working toward here at Engram.

Appendix

Training without notes

Table 2:Ablation study of training with and without notes
NotesTrainedHarvey C&H
Acc / Tokens
Hex
Acc / Tokens
Engram Internal
Acc / Tokens
——60.0% / 90.0k15.0% / 16.1k72.7% / 73.0k
✓—72.3% / 53.9k18.0% / 19.5k81.0% / 70.0k
—✓68.2% / 130.8k (λ = 0.1)27.0% / 26.9k (λ = 0.2)88.6% / 69.0k (λ = 0.1)
✓✓76.0% / 36.7k (λ = 0.1)37.0% / 17.8k (λ = 0.2)87.6% / 68.0k (λ = 0.1)

We report the performance of {notes, no notes} x {trained model, base model} across our three workspaces. We see that training a model without notes—that is, using RL to better navigate the workspace only—offers improvements over the base model without notes. However, it still falls short of training on top of the notes for both Harvey and Hex, and is comparable on Engram Internal.

Training across different notes recipes

Figure 7:Training boosts performance for various text memory systems

Harvey C&H

Our notes recipe is green; the alternative recipe is purple. A hollow circle shows the base model, filled circles show the base model with notes, and stars show trained models. Hover, tap, or tab to a point for accuracy, tokens, and the trained model’s cost penalty.
Our notes recipeAlternative notes recipe
BaseBase + notesTrained
Training with two different notes recipes.

These days, everyone has their own favorite flavor of harness and text memory. We’ve tried many different recipes and chose one that works well across workspaces, but a natural question is whether training’s gains depend on that choice.

To find out, we train a model on top of notes from an alternative recipe for Harvey C&H. Both recipes produce notes that cover similar content, but the alternative notes rely more on prose than on structured data.

Training improves accuracy over the untrained agent using the same notes at every cost penalty. We also see that the trained model with the alternative notes still trails behind the trained model with our notes. This suggests that training doesn’t depend on one particular way of building notes, and that better notes and training add to each other.

Trained model behaviors and traces

Figure 8:Trained models learn to check notes against the raw documents

Harvey C&H

Gap checks as notes cover more mattersThe base model almost never checks for gaps. The trained model checks more often when the notes cover less of the workspace. The dashed reference line shows the share of matters missing from the notes.Base model with notes: 0 of 125 questions (0%) at 50% coverageBase model with notes: 1 of 125 questions (1%) at 60% coverageBase model with notes: 2 of 125 questions (2%) at 70% coverageBase model with notes: 0 of 125 questions (0%) at 80% coverageBase model with notes: 0 of 125 questions (0%) at 90% coverageBase model with notes: 0 of 125 questions (0%) at 100% coverageTrained model with notes: 59 of 125 questions (47%) at 50% coverageTrained model with notes: 43 of 125 questions (34%) at 60% coverageTrained model with notes: 32 of 125 questions (26%) at 70% coverageTrained model with notes: 25 of 125 questions (20%) at 80% coverageTrained model with notes: 14 of 125 questions (11%) at 90% coverageTrained model with notes: 0 of 125 questions (0%) at 100% coverage
Harvey C&H: coverage checks as the notes expand.

Checking the notes for gaps. Here we take a closer look at the gap-checking behavior from the earlier section: given notes that cover only part of the workspace, the trained model checks which matters the notes are missing and searches those directly. Figure 8 shows this is a systematic difference between the two models. At each stage of the changing-notes experiment, we count how often each model runs the check. The base model almost never does. The trained model does, and how often it checks tracks how much is missing from the notes. This supports our qualitative observation that the check is triggered by noticing matters missing from the notes rather than run on every query.

Figure 9:Trained models use more efficient memory lookup

Notes output per lookup

Notes output per lookupDistribution of median notes-lookup output tokens per trace for the base and trained models on Harvey C&H.
Harvey C&H: output tokens per notes lookup.

General behaviors. Figure 9 plots the distribution of the number of tokens per lookup in the notes. On Harvey C&H, the trained model’s lookups shift dramatically towards shorter outputs; for Engram Internal, there is a slight increase in shorter outputs as well. Hex shows the biggest drop, from 567 to 166 tokens per lookup in a typical trace. Smaller results cost less and fail in fewer ways (Figure 10). A broad query can get cut off, so the agent misses part of the answer (Harvey tab). Or it can bury the one detail that matters: on Hex, the base model reads whole pages and 12K tokens of notes but misses where the subscription delays happen, while the trained model's focused search finds it and answers correctly with 30% fewer tokens (Hex tab).

Figure 10:Example traces from Harvey C&H and Hex DataBench
“Pull the matters filed to our Real Estate practice where title insurance was in place.”

Base + notes

Accuracy 43% · 98K total tokens

  1. Turn 1Notes

    Pulls the full notes row of every Real Estate matter at once. The output is too long, and the tool cuts it off.

    Command & output
    jq -c 'select(.practice_area | test("Real Estate"; "i"))' matter_metadata.jsonl | head -30

    16,308 tokens, ending “[Showing lines 4-8 of 8 (50.0KB limit) ...]”

  2. Turn 2Reasoning

    Works only from the part it saw.

    “I found four Real Estate matters: 1011-00007 ... 1026-00004 ... 1027-00004 ... 1030-00003”
  3. Turns 10–15Raw documents

    Reads the closing documents of the four it saw in full, 6K to 11K tokens a file.

Answer

two matters, 1026-00004 and 1027-00004. It never gets the notes rows of the other seven Real Estate matters, so it misses three that qualify.

Training + notes

Accuracy 86% · 61K total tokens

  1. Turn 5Notes

    Asks the notes for just the IDs of the Real Estate matters.

    Command & output
    jq -r 'select(.practice_area == "Real Estate") | .matter_id' matter_metadata.jsonl

    1036-00004 · 1043-00002 · 1031-00004 · ... all 11 IDs (121 tokens)

  2. Turns 9–16Raw documents

    Searches each matter's closing documents for the title-insurance lines.

    Closing-document search
    grep -n -i "title insurance\|title policy\|title premium" 1031-00004/Closing/funds-flow-memo.md
    “Title Insurance — Senior ALTA Loan Policy ...”

    (355 tokens)

    Post-signing search
    grep -rn "title" 1017-00009/Post-Signing/ | head -10
    “Title. A leasehold title insurance policy was issued by Commonwealth Fidelity Title Insurance Co. ...”

    (719 tokens)

Answer

five matters, including the three the base model missed (1036-00004, 1017-00009, 1031-00004). Both models miss one (1043-00003).

Harvey C&H: targeted lookups avoid truncated results.