Papers · 2026 · Reading: 19 min, plus 3 in closed details.
Paper · arXiv preprint, 2026 · arXiv 2609.27334

Just-in-Time Memory: Learning to Curate Task-Adaptive Memory for LLM Agents (JitMem)

Yefan Zhou, Yang Li (equal contribution), Zeyu Leo Liu, Semih Yavuz, Shafiq Joty
Salesforce AI Research · 23 September 2026 (arXiv v1, the only version on 3 October 2026)

In one line: Curating an agent's memory at read time, once the task is known, usually beat distilling trajectories at write time in this paper's tests: untrained against untrained it won 15 of 17 comparisons on ALFWorld, WebShop and tau2-bench. The RL-trained curator leads the strongest baseline by 16.2 and 16.3 points on ALFWorld and WebShop with a Qwen3-8B executor, but most of that comes from the RL training (57% and 92% of the gain over no memory), the baselines in that Qwen3-8B block match SkillOS's published numbers to the decimal (taken from that paper, not rerun), and the tau2-bench +3.9 is under two standard errors.

Scoped on 26 October 2026 from the database Takeaway, which said an untrained curator already wins "so the gain is the timing rather than the model"; the paper's own Tables 1 and 9 show that holds like for like but not for the headline cells, where RL training supplies most of the gain. The Notion property needs the same edit.

+16.2 / +16.3 SR points
over the strongest baseline, ALFWorld and WebShop
RL-trained JitMem against RL-trained SkillOS, Qwen3-8B executor · Table 1
15 of 17 comparisons
untrained read-time beats untrained write-time, same curator model
the two losses are both WebShop cells with the Qwen3-8B executor (derived) · Table 1
50 to 56 % fewer
executor input tokens than write-time memory
ALFWorld, GPT-5.4 executor; still above no memory · Table 4

How far to trust it: Believe the direction, not the headline's attribution. Untrained read-time curation beats untrained write-time memory with the same model in 15 of 17 comparisons, but the +16.2 and +16.3 come mostly from RL training (92% of the WebShop gain; the trained curator with no memory at all already beats every baseline there), 36 of the 60 baseline cells are SkillOS's published numbers rather than reruns, and the tau2-bench +3.9 is under two standard errors. The evidence, judged.

The idea in one sentence: store past trajectories raw and let a curator write each new task its own compact briefing from them once the task is known, so nothing is thrown away before anyone knows what it is for, and the briefing is graded by that task's success at once; in the paper the untrained version already beats write-time memory in 15 of 17 like-for-like comparisons, while most of the headline +16 points comes from RL-training the curator.

The figure: the paper's test stream, replayed

The 140 real ALFWorld test goals under the paper's own protocol (§3, Appendix A), run by this page's replay engine: which trajectory each task retrieves, and when, is exact; whether a task succeeds is a coin at JitMem's ALFWorld rate with the Qwen3-8B executor, 77.4%. One random ordering (seed 7).

  1. Tasks arrive in batches; the bank starts empty. The goals run in 14 batches of 10, the columns from left to right, coloured by task type. Batch 1 gets no memory at all; its 8 successes are stored raw, the tiles that rise.
  2. Each task retrieves three raw trajectories. Batches 2 to 4 play: every task pulls the top 3 stored trajectories by BM25 over the goal text (the streams of dots, blue when the task type matches, grey when it does not), and the bank holds 28 after batch 4.
  3. Write time: one trajectory distilled at once. Task 32, "heat some egg and put it in countertop", is stored after batch 4. A write-time memory distils it now into one fixed artifact (the grey slab) and drops the raw trace, before any later task is known.
  4. That storage decision waits 18 tasks. Batch 5 plays. The first task to retrieve it is task 50, "put a cool egg in microwave" (the past task of the paper's Figure 3), 18 tasks later: only now could a write-time curator learn anything about its distillation.
  5. Four later tasks of three types, one artifact. Over the rest of the stream it is retrieved by 4 tasks (cool, heat twice, place), 18, 59, 87 and 94 tasks after it was stored. Under write time each gets the same slab, and whatever reward comes back is shared among them.
  6. Read time: a payload per task, graded at once. JitMem keeps the trace raw. For each of the four the curator writes its own payload with that task in view (the blocks in each task's colour), and that task's success grades it immediately: the delay is zero.
  7. Across the stream, many decisions are never graded. In this ordering 92 trajectories are stored before the last batch; 19 of them (21%), capped in dark glass, are never retrieved, and the first use comes 20.2 tasks after storage on average. Over 200 orderings: 19.5 tasks, and 24% never used.
  8. Where the headline gain comes from. The paper's Qwen3-8B cells, no memory to trained JitMem: on ALFWorld 47.9, then +12.6 from the untrained read-time curator and +16.9 from RL training (57% of the gain); on WebShop SR 9.8, +1.9 and +21.1 (92%). The glass sheet is RL-trained SkillOS, 61.2 and 16.5 (Table 1, Table 9).

You need: GRPO's group-relative advantage, which trains the curator (RL for LLMs); agent memory designs in general (Context engineering). New terms: write-time curation (distil a finished trajectory into a fixed artifact when it is stored); read-time curation (keep it raw, distil when a task retrieves it); curator (the model that turns retrieved trajectories plus the task into a payload); payload (the briefing prepended to the executor's prompt); executor (the frozen model that does the task); quality gate (the executor judging its own trajectory before it is stored); -base, -gpt, -gemini (the curator untrained, or a prompted frontier model).

Problem

§1 Introduction

An agent solving tasks one after another should learn from its own past. Agentic memory does that, and almost every system curates it at write time: when a task ends, its trajectory is distilled into a fixed artifact (a verbal reflection as in Reflexion, an insight, a workflow, an executable skill, a reasoning strategy as in ReasoningBank) that later tasks retrieve by similarity (§1, §2; memory designs in general: Context engineering).

Curating then, the paper argues, has two costs that come from one root: the decision is made without knowing what it will be used for (§1).

  1. Information loss is premature and irreversible. Whatever the distillation discarded is unavailable to every later task that needed it.
  2. One fixed artifact must serve many different future queries. The paper's example: the same household trajectory may teach one task a state change (heating or cooling an object) and another a placement strategy. A trajectory holds many possible lessons, and which one matters depends on a task nobody has seen yet.

Learning a write-time curator adds credit assignment: a storage decision is only graded when some later task retrieves the artifact, so the reward is delayed and badly attributed. SkillOS, the closest prior work, trains a skill curator with RL and has to group related tasks into streams to manufacture that signal (§1, §2).

One past trajectory, two later tasks.

Idea

§1, Figure 1

Keep the raw trajectories and curate at read time, just in time, once the task to be solved is known (§1).

The bank becomes a passive store of complete trajectories. When a task arrives, a retriever picks past trajectories and a memory curator reads them together with the new task and writes a compact, task-specific payload, so one stored trajectory can yield a different payload for every task that retrieves it: memory reconstructed, not replayed (§1).

It also changes learning: the payload is consumed by the task it was written for, so that task's success grades it at once, with zero delay and no task grouping (§1, §3). The animation runs the paper's own example (Figure 3) through both designs (switch with the buttons above it); the trajectory's steps and the write-time artifact are illustrative, the artifact following the paper's ReasoningBank-style distillation prompt (Appendix A).

  1. A past task is solved. The agent solves put a cool egg in microwave, the past task in the paper's Figure 3. Its trajectory, drawn as seven actions (illustrative), mixes three kinds of know-how: finding the object (blue), changing its state (teal), placing it (gold).
  2. Store it raw. JitMem stores the complete trajectory. Nothing is decided about what it is for, and nothing is discarded. The only gate: the executor, acting as judge, must think the task succeeded.
  3. Task A arrives: put a hot potato in fridge. The retriever returns the egg trajectory among its top 3, as in the paper's figure.
  4. The curator writes payload A. Reading task A and the raw trace together, the curator foregrounds the state change: Heat the potato: Use a microwave or stove to make it hot. Move to the fridge: Go to the fridge, open it, and place the hot potato inside to cool it down. (payload text from Figure 3).
  5. Task B arrives: put a newspaper in sofa. The same egg trajectory is retrieved again, for a task with no state change at all.
  6. The curator writes payload B. From the same trace it now foregrounds placement: Move to the sofa: Navigate to the sofa and use the "move" action to place the newspaper on it. Verify placement: Confirm the newspaper is on the sofa. If not, repeat the process. (Figure 3).
  7. The reward arrives at once. Each payload is used once, by the task it was written for, so that task's success grades it immediately: the gap between the curator's action and its reward is zero. That is what lets GRPO train the curator from task success alone.

Note that JitMem never hands raw trajectories to the executor: it still distils, only later and with the task in view (Connections).

Method

§3, Appendix A

Tasks x1, x2, ..., xT arrive one at a time. Solving xt produces a trajectory ξt of interleaved observations and actions and a reward rt in [0, 1]. JitMem has four parts: a memory bank of raw trajectories, a retriever, a curator πφ, and a frozen executor πL. Only the curator is trainable, and the goal is the expected sum of task rewards (§3). Each task runs four steps:

StepWhat happensDetails
1. Retrievetop-k raw trajectories for xtBM25 over task descriptions only, not trajectory content, so retrieval cost does not grow with trajectory length; chosen for consistency with the baselines, untrained, k = 3 (§3, Appendix A)
2. Curatept = πφ(xt, retrieved)a prompt with the task followed by the k trajectories; the output is a concise briefing: which past experiences are relevant, which strategies worked, and specific guidance for this task (per-benchmark prompts in Appendix A)
3. Execute(ξt, rt) = πL(xt, pt)the payload is prepended to the frozen executor's prompt; the executor never sees the raw trajectories
4. Updateappend ξt if the quality gate accepts itno labels exist at deployment, so the executor model judges its own trajectory and only judged successes are stored, keeping memories positive examples; the payload is never stored

Training the curator. GRPO with G = 8 payloads per training task: the frozen executor attempts the task with each payload, the benchmark's own reward scores it (success on ALFWorld, the 0 to 100 score on WebShop), and each payload's advantage is its reward minus the group mean, without dividing by the spread, as in Dr. GRPO (the algorithm itself: RL for LLMs). What is new is what the reward grades: only the payload written for that same task, so the curator learns directly from task success and credit assignment is one step, where a write-time decision at task s is graded only when some task t > s retrieves it (§3).

The loss, the training recipe and the fixed training bank
L = −(1/G) Σi Âi · log πφ(p(i) | xt, retrieved),   Âi = r(i) − meanj r(j)

(§3). Recipe: Qwen3-8B curator, thinking off; 100 steps, learning rate 1 × 10−6, 32 tasks per batch, KL loss 1 × 10−3, payloads up to 8,192 tokens (ALFWorld) or 4,096 (WebShop); Qwen3-8B executor in non-thinking mode for speed (§4, Table 7).

A fixed training bank. So that the reward reflects payload quality, not which trajectories happen to be stored, training retrieves from a frozen bank of the base executor's successes on the training set (by ground-truth label). At test time the bank fills with curator-assisted trajectories instead, a mild shift that the staged-refresh ablation measures (§3).

Evaluation. The test bank starts empty and grows as tasks are solved. Tasks run in batches that share one bank state (10 per batch; 5 on tau2-bench), and the bank updates after each batch. The verifier scores success; the bank's gate sees only the LLM judge, so no label leaks into memory. Results: mean and standard deviation over 3 random orderings (4 on tau2-bench) (§3, Appendix A).

Under exactly this protocol on the real ALFWorld test set (140 tasks, batches of 10, BM25 top 3 over task descriptions, empty start), how long does a stored trajectory wait before any later task first retrieves it?

Results

§4, §4.1, Tables 1 to 4

Setup. ALFWorld (household tasks, 140 test tasks), WebShop (shopping, 500 instructions; success rate and a 0 to 100 score) and tau2-bench (customer service with tools: airline, retail, telecom); frozen executors Qwen3-8B, Gemini-2.5-Pro and GPT-5.4. Baselines: no memory and three write-time memories, ReasoningBank, MemP and RL-trained SkillOS. "-base" is the same model as curator untrained; "-gpt" and "-gemini" a prompted frontier curator (§4). Success rate (SR) is in percentage points.

Headline. With the RL-trained curator and Qwen3-8B as executor, JitMem reaches 77.4 SR on ALFWorld against 61.2 for RL-trained SkillOS (+16.2) and 32.8 SR on WebShop against 16.5 (+16.3; +20.5 on the score). Moved untouched to stronger executors, the margins shrink to +6.0 and +9.2 with Gemini-2.5-Pro and +8.8 and +10.9 with GPT-5.4 (Table 1). And the training is simpler than SkillOS's: task reward only, no judge-model reward, no grouped streams (§4.1).

tau2-bench has no training split, so only untrained variants run there (GPT-5.4 executing): JitMem-gpt reaches 75.6 micro-averaged SR against 71.7 for ReasoningBank-gpt (+3.9; +3.0 macro), almost all from Telecom (72.6 against 61.6, +11.0). On Airline and Retail no memory method beats no memory beyond the variance, as the paper says: read-time curation helps most where tasks need procedure, not facts (Table 2, §4.1).

The headline: JitMem against every baseline, per executor and metric

Mean over 3 task orderings, whiskers ±1 standard deviation (Table 1). Hollow bars are numbers that match SkillOS's own published Tables 1 and 2 to the decimal, standard deviation included (SkillOS), so they were taken from that paper, not rerun; the tables tab marks every cell.

Untrained against untrained. To separate timing from curator capacity, the paper compares untrained read-time and write-time memories with the same curator model: Qwen3-8B on ALFWorld, 60.5 against 55.7 and 53.1; Gemini-2.5-Pro on WebShop, 61.0 against 40.2 and 41.0; GPT-5.4 on tau2-bench, 75.6 against 71.7 and 66.4. A weaker curator can even win: on ALFWorld with GPT-5.4 executing, a Qwen3-8B curator (79.3) beats ReasoningBank and SkillOS curated by GPT-5.4 (77.9, 70.0). Hence the claim that an untrained curator "is already competitive with or surpasses" the baselines and that read-time curation "itself is a major source of the gain" (abstract, §4.1).

The headline WebShop cell is Qwen3-8B as executor. There, does the untrained read-time curator (JitMem-base, Qwen3-8B curating) beat the untrained write-time memories built on the same model?
The ablations include the RL-trained curator with retrieval switched off: it gets no past trajectories at all and can only write hints from what it learned in training. On WebShop with the Qwen3-8B executor, where does it land?

So the claim holds untrained against untrained (15 of 17 cells), but not for the headline numbers: with the Qwen3-8B executor most of the +16.2 and nearly all of the +16.3 come from RL training. With stronger executors the untrained curator supplies about half or more of the gain over no memory. The abstract's closing words, "training the curator further compounds the improvement", are fair; the database row's first Takeaway ("the gain is the timing rather than the model") overstated it for the cells it quoted, and was scoped on 26 October 2026 (the card's one line).

Transfer. Trained with Qwen3-8B executing and moved to GPT-5.4, the curator scores 86.7 on ALFWorld, 1.4 points short of one trained with GPT-5.4 (88.1), and beats JitMem-base with both stronger executors (+6.2 and +7.4 on ALFWorld, +6.1 SR on WebShop) (Table 3). But an untrained Gemini-2.5-Pro curator scores 61.0 SR on WebShop, above the trained curator's 50.5 with the same executor: curator strength matters a lot there (Table 1).

Shorter context, fewer steps. On ALFWorld with GPT-5.4, JitMem-base adds 1.9K input tokens a task over no memory (9.0K) where ReasoningBank adds 10.7K and SkillOS-base 13.4K, and takes 18.5% to 21.9% fewer steps; training trims input by 10.1%, output by 13.0% and steps by 12.1% more. Trained JitMem uses 50.3% to 56.3% fewer input tokens and 28.4% to 31.4% fewer steps than the write-time methods (Table 4, §1). The curator's own call is not counted.

Ablations and examples

§4.2, §4.3, Figures 2 to 4, Tables 5, 8, 9

Each ablation removes one design choice from the untrained JitMem-base or the trained JitMem, with all three executors (Figure 2, Table 9).

  • Task conditioning matters, more after training. Without the task in its input the curator is a query-independent summariser: up to 3.1 points lost on ALFWorld and 4.6 on WebShop untrained, 11.4 and 10.4 trained. RL learns to use the task (§4.2).
  • Store only successes. Storing everything with judged labels, as ReasoningBank and SkillOS do, costs 1.5 to 2.9 points on ALFWorld and 2.3 to 3.4 on WebShop.
  • Raw storage matters most on WebShop. Distilling ReasoningBank-style before storing costs 1.7 to 2.9 points on ALFWorld and 6.8 to 8.2 on WebShop (to 4.9 SR with Qwen3-8B, below no memory). Same curator, same task conditioning, only the write-time loss added: the cleanest test of the thesis.
  • RL learned to use the memory. Without retrieval, trained JitMem loses up to 14.8 points on ALFWorld and 15.2 on WebShop, falling to or below JitMem-base; with Qwen3-8B executing it stays above it (62.6 against 60.5; 17.6 against 11.7), the hint-writing effect of the question above.
Small effects, and the paper's two worked examples

Small effects: rebuilding the training bank with curator-assisted trajectories and training 50 more steps adds 2.8 SR (Qwen3-8B), 0.9 (GPT-5.4) or nothing (Gemini); seeding the test bank with 100 training trajectories changes SR by at most 1.3; k = 5 instead of 3 by under 2 (Table 5, Table 8).

Examples. Figure 3 is the example animated in Idea. "Put a hot potato in fridge" is a real ALFWorld test goal; in the replay BM25 often finds it a fridge trajectory, but it cannot match "hot" to "heat", so which lessons arrive depends on shared words.

Figure 4: for "examine the bowl with the desklamp" the untrained payload ends "Examine the bowl to complete the task", missing that the lamp must be used; the trained one adds "Move to the desklamp" and "Examine the bowl with the desklamp", procedure the prompt never asked for. One hand-picked example; the trained payload still opens with placement steps that do not apply.

Removing one design choice: how many points each costs

Drop = parent minus ablation, from Table 9; dots: Qwen3-8B, Gemini-2.5-Pro, GPT-5.4 executors. 3 orderings each; standard deviations of the rows run up to 4.7 points.

Why it matters

beyond the paper

The design consequence: Keep trajectories raw, pay the storage, and spend the compute at read time, which is the opposite of what a compaction-first harness does. The cleanest evidence is the distil-before-storing ablation: WebShop drops 6.8 to 8.2 points (Table 9).

The cost is one extra LLM call per task, storage for whole trajectories and a retriever that must scale; the authors list these, plus a hand-designed payload format, as limitations (§5). The gain for learning: a curator graded on the task it just served is a one-step RL problem that any verifiable-reward setup can train, and being separate from the executor it can be trained cheaply and reused with an expensive one (Table 3). Concurrent MemHarness also curates at read time, but in the executor itself, which ties the memory to that model (§2).

Connections

  • Proactive Memory Agent decides when to remind an agent of something it already holds, and SoL-Pi compacts what it carries forward. Both operate on an artifact whose content was fixed earlier, and this says the artifact should not be fixed earlier. (JitMem cites Proactive Memory Agent as arXiv 2607.08716, in-session memory, §2.)
  • JIT-Agent makes the same just-in-time move one level up: it synthesises the agent's harness per task at inference time instead of fixing it beforehand.
  • Demystifying Agent Skills found skills distilled from identical trajectories beat raw workflow memory given to the agent. No contradiction: JitMem's executor gets a distillation too, only made late, for the task. Repo-To-Skill is write-time distillation at library scale.
  • Trained Persistent Memory and Latent Context Language Models compress memory or context before any query is known, the choice this paper argues against for cross-task memory; Agora keeps an append-only raw record instead.
  • Underneath it is RAG's pattern (store raw, retrieve at query time, condition the reader on the query) with a trained curator between retriever and reader; the curator is trained with GRPO from DeepSeekMath, and the executors act in the reason-then-act loop of ReAct, whose original results were on ALFWorld and WebShop.

How much of this to believe

§4, Appendix A, Tables 1, 6, 9

What holds up. The direction is consistent: untrained read-time beats untrained write-time memory with the same curator model in 15 of 17 comparisons across three executors and three benchmarks. The headline gaps are 5.2 and 15.4 standard errors of the difference (tables tab). The ablations tell one coherent story. The appendix gives every prompt, the full GRPO configuration, hardware, run times and how the baseline was reproduced (Appendix A), and the authors state their limits (no gain on Airline and Retail, BM25, an extra call, a hand-designed payload; §5), which counts in their favour. 62 of 63 derived numbers recompute.

The weaknesses, concretely:

  1. Most baselines are copied, not rerun. 36 of the 60 baseline cells in Table 1 (the whole Qwen3-8B block, most of the Gemini block) match SkillOS's published tables to the decimal, standard deviations included; the paper only implies it, through Table 6. Its own no-memory reproduction gave 42.1 SR on ALFWorld against the 47.9 listed, and 8.6 on WebShop only after adding search guidance to the executor prompt. That makes the no-memory comparison conservative, as the authors argue, but the memory baselines never ran in JitMem's harness. Only the GPT-5.4 block is all their own runs.
  2. The headline attributes the gain to the wrong cause. In the two headline cells, RL training supplies 57% (ALFWorld) and 92% (WebShop SR) of JitMem's gain over no memory, and the trained curator with no retrieval at all already beats every baseline there (the question above). So the claim that read-time curation itself is "a major source of the gain" is true of the untrained comparisons, not of the +16.2 and +16.3.
  3. Not like for like. Table 4 omits the curator's call (up to 8,192 output tokens); the GPT-5.4 block has no trained write-time baseline, so its +8.8 and +10.9 set a trained curator against untrained ones.
  4. Three orderings of one fixed test set. The spread covers ordering and sampling only; on tau2-bench the +3.9 is 1.7 standard errors (4 orderings). One ALFWorld task is 0.71 points.
Three smaller points: the validation split, a printing slip, nothing released
  1. Validation split and tested checkpoint not stated. Decoded from Figure 5, every ALFWorld validation score is a multiple of 1/140, the size of the test set (ALFWorld's other split has 134 tasks, which does not fit). With the final checkpoint tested, nothing was selected on it; with the best one, the test numbers are optimistic. WebShop validation (100 tasks) peaks at step 75 and ends lower. One training run per curator.
  2. Small slip: SkillOS-gpt's tau2 micro average is printed 66.4; its domains give 66.3.
  3. Nothing to check against. No code, trained curator or trajectories are released (checked 3 October 2026).

Verdict: believe the direction, not the headline's attribution. Curating at read time with the task in view beats distilling at write time in almost every like-for-like comparison, and storing raw trajectories clearly helps on WebShop. But the +16.2 and +16.3 are mostly the RL-trained curator (which already wins without any memory), measured against baselines copied from another paper's harness, and the tau2-bench gain is within noise.

What it takes to use this

Nothing is released, but the untrained version can be rebuilt from the paper alone (every prompt is printed, retrieval is BM25 with k = 3, the gate is the executor judging itself), and it is the part that transfers: one extra curator call per task buys a much shorter executor prompt. Training the curator needs a training split with a verifiable reward and about 168 (ALFWorld) or 216 (WebShop) H200 GPU-hours per run; it pays most for a small executor on procedural tasks.

The details: code, cost per task, training budget, what transferred, when it pays
  • Code and licence: none released (checked 3 October 2026). The untrained version can be built from the paper: every prompt is printed (Appendix A), retrieval is BM25 over task descriptions with k = 3, and the gate is the executor judging its own transcript.
  • Per task: one curator call and storage for every successful trajectory; in exchange the executor's prompt grows by about 1.9K tokens instead of 10.7K to 13.4K, with fewer steps (Table 4).
  • Training the curator: needs a training split with a verifiable reward (tau2-bench had none, so it was never trained there). 100 GRPO steps of 32 tasks times 8 payloads is 25,600 executor episodes; one run took about 21 hours on ALFWorld and 27 on WebShop on 8 H200 GPUs, about 168 and 216 GPU-hours (Appendix A).
  • What worked: a curator trained against Qwen3-8B transferred to Gemini-2.5-Pro and GPT-5.4; with strong executors an untrained strong curator gets much of the gain for free (Gemini curating: 61.0 SR on WebShop, above the trained curator's 50.5).
  • When it pays: most for a small executor you can train against and for procedural tasks (Telecom +11.0); nothing on Airline and Retail. Banks here hold at most a few hundred trajectories; BM25 over task descriptions at thousands is untested.
Since the paper (dated: checked 26 October 2026)

arXiv still lists only v1 (23 September 2026), under arXiv's non-exclusive licence, with no code, curator weights or trajectories linked; a web search on 26 October found no official repository, only secondary summaries (arXiv 2609.27334). Recheck before adopting: a code release would let the copied baselines and the validation split be checked.