Engineering · Research agents
How our research agent remembers an investigation and its evidence
How we structure memory so an agent can follow a branching investigation, recover its next check and return to the original evidence.
Checkpoints, source tracking and retrieval ship in the research agent. Recursive summary compression is proposed, not built. This article describes mechanisms and tests, not a measured gain in research quality.
An experiment can survive in a repository while the reason for the next experiment disappears between chats. We want an agent to recover that reason, then check it against the original research.
The next chat needs the reason, not just the result
Consider our synthetic curriculum-learning study. A 25-million-parameter model saves 11.1% of training tokens with square-root pacing. At 100 million parameters, the recorded saving is 3.2%: below the 5% the study set as its bar to pass, and within run-to-run variation (the spread between repeat runs that differ only in their random seed). “The curriculum works at scale” would be the wrong reminder to carry into a new chat.
A useful reminder is narrower: “The scale check did not reach the 5% bar. Check whether a simple data mixture explains the small-model gain before adding a more complicated scoring method.” The experiment records hold the measurements. The reminder holds the question, the rejected interpretation and the next check. These numbers come from our synthetic demo, not a scientific result or a memory benchmark.
How the memory is structured
The experiment tree records the research: which question led to a trial, which result prompted a new branch, and why another branch stopped. Research Crafter uses the Agent-native Research Artifact format to retain these experiments, claims and exploration records in a repository. This shared record is where a collaborator checks the work.
A private memory dependency graph answers another question: what did this reminder use? A note may depend on two experiment revisions, a document passage and an earlier note. This graph need not follow the research tree. A future hierarchy of increasingly broad summaries would solve a third problem: compressing long investigations. It is planned, and is not the graph we implemented.
Research records and private memory
A simplified structure using our synthetic study. Lines in the experiment tree show exploration ancestry. Arrows from private checkpoints point to the inputs they depend on.
Original sources
Shared experiment tree
E03 · Pacing sweep
E04 · Reverse-order control
E05 · Scale check
Saved source versions
Experiment revisions, document versions and delivered passage ranges.
Originating chat
Original question and answer.
Uses
Private memory
One member · one project
Checkpoint A
- Summary
- Scale check missed the 5% bar.
- Working hypothesis
- Data mixture may explain the gain.
- Next check
- Compare the mixture at both scales.
Links to recorded inputs
Depends on checkpoint A
Checkpoint B
Continue the data-mixture branch.
A changed source asks for review. Forgetting A also removes the dependent note B; the original research records remain.
Save a checkpoint, then recover the investigation
A checkpoint can preserve the current hypothesis, the branch being explored and the next useful check. It belongs to one member in one project. It is working context, not a shared claim or an experimental observation. A fresh chat can receive up to two relevant headings selected from twenty recent checkpoints; explicit recall opens notes and their source links in pages.
The current selection uses text overlap, continuation requests and named notes. It does not add an embedding search or a hidden model call. We retain up to 200 checkpoints per member per project. These limits make the first version small and inspectable, but they can miss older or differently worded investigations. The agent must inspect the note and original measurements before using them to support a conclusion.
Follow one reminder across a new chat
Illustrative interaction using our synthetic demo study. These controls change only this example; they do not read your projects or call an agent.
Original research
25M scale · 11.1% saving
100M scale · 3.2%, within run-to-run variation
Research records retained
Private checkpoints
Scale check missed the 5% bar. Check the data-mixture explanation next.
Later note: continue the mixture branch.
Next chat
Reminder available
Recall the next check. Reopen the experiment records before claiming a gain at scale.
What actually happens when context gets too large?
There are three different resources: the durable research record, the private checkpoint store, and the text sent in one model request. Keeping a record does not mean sending it on every turn. Our current system reduces the last resource by selecting text, clipping oversized sections, and retaining only recent whole conversation turns. It does not automatically rewrite a long chat into a hierarchy of summaries.
The initial pack has separate character allowances. This prevents a long selected experiment from consuming the space assigned to retrieved passages. Empty sections are omitted. The fixed system prompt, question, delimiters, tool schemas and later tool exchanges are additional text. These are character allocations, not a guarantee that every provider request fits a particular token window.
| Resource | Allowance and overflow behavior |
|---|---|
| Project card / selected item | 3,000 / 9,000 characters; oversized text gets an explicit cut marker. |
| Query-selected research passages | 12,000 characters; ranked chunks that do not fit are skipped. |
| Earlier conversation turns | 24,000 characters; walk backward from the newest question/answer pair and stop at the first pair that will not fit. |
| Private memory navigation | Up to 2 headings from 20 recent candidates; a separate 2,000-character allocation, not full notes. |
| Explicit connected branch read | 20,000 JSON-encoded characters total; up to 3,000 encoded content characters per source, sharing space with unread sources. |
| One checkpoint draft | 6,000 UTF-8 encoded bytes total; summary ≤2,000 characters, up to 4 hypotheses of ≤400 characters, next check ≤800 characters. |
| Private store, per member/project | 200 notes and 10,000 distinct source snapshots; a full store refuses another save until notes are forgotten. |
The remaining initial sections cover Now state, claims, questions, vocabulary, visit changes and the member’s threads, each with its own allowance. The history algorithm preserves a contiguous suffix of whole turns: it does not keep half an answer or skip over an oversized recent turn to retrieve an older one. The original discussion still exists, but an omitted turn is not in the model’s current view.
Which earlier turns reach the model
Within a run, tool results are appended rather than recursively compressed. The generic tool encoder cuts its raw JSON at 24,000 characters, reports truncation and retains only structurally visible field prefixes for provenance; the diagnostic wrapper can be larger after escaping. Runs allow 12 model steps and at most 11 tools. The last step, or the step after tool allowance is used, is answer-only. These limits restrain growth; they are not tokenizer-aware admission control or mid-run compaction. If decisive text is still missing, the answer should name the gap. A provider context-window rejection remains an error.
A large record, a bounded first view
Implemented reading path. Each stage narrows what is sent; the originals remain available through authorized reads.
- 1
Retain originals
Versioned research and original discussions.
- 2
Select candidates
Local ranking, explicit links and recent history.
- 3
Bound the first view
Section budgets, headings and visible cuts.
- 4
Read what is missing
Explicit tools, pinned versions and page cursors.
Two retrieval problems, two small algorithms
Private checkpoint navigation is deliberately cheap. The server reads only the newest 20 headings and branch labels in the member’s own project scope. It lowercases the question, keeps words of at least three characters, removes stopwords, and ranks by the tuple below. Named checkpoint IDs win first, then the number of matching words, then the newest ID. A continuation request can show the best two even without overlap; otherwise only named or overlapping candidates survive.
- ← the newest 20 private headings
- sort descending by (explicitly named ID, word overlap, checkpoint ID)
- ← the first 2 of
- if no continuation request then
- drop from every heading with neither a named ID nor overlap
- return headings only; full content requires memory_recall
This is not semantic memory search. A synonym can miss a note; an important old note can sit outside the 20-candidate window; a common domain word can bring in an irrelevant heading. Explicit memory_recall uses before / next_before to page older notes and source_after to page source identities. These are separate cursors: moving through the notebook does not mean all source metadata has been read. An explicitly named old ID does not bypass the automatic recent-candidate window; it needs a direct recall.
Original research uses a different index: BM25, a lexical ranking rule that rewards distinctive matching words while normalizing document length. The index tokenizes structured item text into pieces around 1,800 characters and keeps at most six pieces per item. Titles are counted twice. The scoring rule is:
is the saturating, length-normalized term-frequency factor. Here is the query, a chunk, the count of a query word in that chunk, its tokenized length and the average chunk length. In , is the number of chunks and the number containing . We use and . A named item adds to its score; the first piece then receives a boost. Positive-scoring chunks are admitted greedily under the 12,000-character passage allowance, with at most 14 distinct item IDs and the selected item excluded.
Repeated words help less and less
Lexical ranking helps find a starting point; it does not reconstruct an investigation by itself. The six-piece index can omit a decisive tail. Missing or clipped conclusions require an original item read, and even that read can be cut by the tool budget. A page has an explicit continuation cursor; item reads do not promise arbitrary offset paging. We must disclose any evidence that still cannot be obtained rather than infer it from a title.
Multi-hop means following a question back to its evidence
Suppose a new chat asks: “Why did we stop the pacing branch, and what should we try next?” The reminder can supply the next check, but answering “why” needs the earlier failed control, the larger-scale experiment and their comparison conditions. The table is an illustrative path through our synthetic study. It is not a transcript or a claim that the model always chooses these tools.
| Hop | Read and decision |
|---|---|
| 1 · Find the investigation | A relevant heading points to checkpoint A. memory_recall recovers the unresolved data-mixture hypothesis and its source references. |
| 2 · Follow explicit relationships | branch_context on the recorded branch follows ancestry, prerequisites and typed evidence links to the admitted connected experiments. |
| 3 · Read original outcomes | Use the returned original item-text excerpts. Read omitted decisive conditions/results with get_item at the same research revision; a planned verification is not a measured result. |
| 4 · Check comparability | If a protocol page decides the comparison, list it and docs_read its exact document version; follow next_offset. Check model scale, metric, run-to-run variation and the 5% bar. |
| 5 · Separate result from next step | Report the synthetic 3.2% larger-scale saving as below the 5% bar and within run-to-run variation. Carry the mixture test forward as a proposal, not an observed explanation. |
The branch traversal is breadth-first over typed links such as parent, depends_on, proof and verifies, with visited-node tracking for cycles. It visits at most 16 nodes; adjacency is capped at 32 links per endpoint; its navigation capsule is bounded at 3,500 characters. Parent/prerequisite edges are followed toward ancestors or prerequisites, while evidence links can also be followed in reverse. It does not descend every sibling branch or create an edge because prose mentions an ID.
The explicit branch tool adds original canonical item-text prefixes alongside that navigation map. Its 20,000-character encoded response shares remaining space among unread sources so a long target cannot hide every short control. Each excerpt keeps its own source identity and truncation flag. One tool round trip may therefore cover several logical hops. Disconnected evidence still needs search or another item read; a missing or incomplete graph is reported rather than treated as exhaustive.
These mechanisms improve the conditions for an accurate answer: preserve the failed branch, expose the control, pin the comparison and leave room to synthesize. They do not establish a high accuracy rate. End-to-end success still depends on choosing the right memory, reaching the decisive originals, checking their conditions and interpreting them correctly. A failure at any of those stages can defeat the chain even when every database operation is correct.
A source must reach the model before it can count
An ID in a summary is a pointer, not evidence that the experiment was read. A tool call succeeding on the server is also insufficient: its result may be clipped, omitted or arrive too late to influence the answer. In evaluation, we credit original evidence only when source-bound context or an identical successful typed tool result is actually delivered to a provider request before the answer.
- input: original source identity + selected revision/version
- credit the source only when every step holds, as ordered:
- successful authorized read
- structurally located visible text
- matching delivery within a model request
- evidence available when grading the answer
- a checkpoint or a source ID alone never fills this chain
The ledger uses structured field paths and the exact visible prefixes after JSON escaping and clipping. Putting “E05” inside E03’s body does not grant E05’s authority. An omitted tail cannot establish its outcome, and a result delivered after the answer cannot explain it. Alternative tool paths are allowed: already-delivered originals can satisfy a need without redundant reads.
Research items use an ARA revision. Page documents use a separate document version and canonical content hash. A page edited during a paged read can conflict; the agent should relist and disclose the change, not splice versions into one protocol. A hash detects identity/change, not correctness. Historical research editions remain distinct, including contradictory observations; old page bodies are not retained by the current page store.
Durable memory provenance is a different, conservative boundary. The server inherits consumed sources, displayed private headings, recalled notes and retained history even if the draft omits them. More than 512 direct source dependencies refuses a new checkpoint rather than silently deleting links. Inspection shows 32 source identities per page, while change checks cover all transitive dependencies, including identities not on that page. This can over-link notes, but it keeps a later copy from surviving a forgotten input. It is not a claim that every scientific statement was verified.
Remember what the note actually used
The server records source revisions, document versions and delivered passage ranges alongside the note. It also inherits dependencies from earlier memory and retained chat history. A browser save or a model-written draft cannot simply omit those links. A source identifier or content hash helps find a particular edition; it does not establish that its contents are correct.
If a linked source changes or becomes unavailable, recall marks the note for review. This preserves the distinction between “we used this older setup” and “the result is false.” The agent should reopen the source, check whether conditions still match and explain any remaining uncertainty. The system tracks the change; judging its scientific significance still requires reasoning.
Forgetting a note also forgets the notes built on it
Suppose an early note contains a mistaken interpretation, and a later note builds on it. Removing only the first note leaves the same mistake reachable through the second. We follow recorded dependencies to remove affected private descendants as well. Deleting an originating discussion or source also removes notes that depended on it.
Forgetting private memory preserves the original chats and experiment records. It also blocks old conversation history and delayed saves from recreating the forgotten notes. A fresh chat can start new memory. This is a rule about what future private notes may inherit, not a promise to erase every original record or every idea the model has seen.
A partial run should not become durable advice
During an answer, the agent can stage a checkpoint. Only the last staged checkpoint is eligible to publish after a successful completion. Failed, cancelled, paused or limited runs publish none. Saving rechecks access, available sources and forgetting rules. If saving fails, the completed answer remains available and a visible notice explains that the note was not kept.
This protects the memory store from treating an unfinished investigation as a settled next step. It does not make every successful answer correct. A confidently wrong conclusion can still finish successfully, so evidence checks and the ability to inspect and forget notes remain essential.
Test the recovery, not just the storage
Our tests include investigations across several turns: encounter a failed branch, save its next check, start a fresh chat, recall the relevant note, and return to the original experiments before making a comparison. Other cases change a source, remove access, cancel a run, or forget a note while a later save is still in flight. We check both the answer and the tool calls that made it possible.
These are tests of observable behavior, not proof of sound scientific judgment. A scripted model can calibrate the pipeline; a small live pilot can expose a bad schema or failed continuation. Neither establishes a general accuracy rate. We keep failed and interrupted trials, separate recovery from scientific grounding, and count setup as well as continuation cost.
How we test the chain without giving away the answer
A continuation test must make memory necessary. The first chat receives a randomized private next-probe label and is asked to retain it. The second chat has no earlier turns, no selected item, and no copy of that label in shared research, pages or its question. Both sessions and the randomized task are retained for replay. Recovering a plausible answer is not enough: the exact private choice must have a delivered private source.
A separate check requires the original experiment conditions and observed measurements. Deleting original evidence from the trace fails scientific grounding even if private recall is correct. In forgetting and foreign-member cases, exposure of the forbidden private label fails privacy even when the final answer declines to repeat it. The capture inspects delivered requests transiently and stores an exposure flag, not private provider reasoning.
| Case | What must be observed |
|---|---|
| Fresh continuation | Recover the randomized private choice through delivered memory, then use original measurements. |
| Experiment observation changed | Revisit the current source; the old checkpoint cannot supply a replacement measurement. |
| Protocol page edited | Use the current page version and recognize when required conditions are not measured. |
| Forgotten or foreign note | No forbidden private label in any delivered request, regardless of final wording. |
| Memory disabled | Ordinary research reads still work; a private choice absent from all shared inputs must stay unavailable. |
| Missing, late, clipped or forged evidence | A correct-looking verdict does not pass when the decisive source never reached the model. |
The grader checks run completion, tool permissions, source revisions/versions, required visible phrases, citations, recorded numeric observations and private recovery separately. It accepts equivalent evidence-delivery paths instead of demanding one exact tool sequence. Scripted calibration currently covers 13 synthetic tasks; it checks the harness, not a live model’s success rate. Every grade still requires human scientific review.
A useful next experiment compares the same investigations with and without memory, then with a compression hierarchy: exact-choice recovery, source-grounded verdicts, stale-result reuse, privacy failures, latency, tokens and cost. Plot these against investigation length, branch depth and distance to the relevant old note. Report failed setups and incomplete continuations; count setup/compression work as well as answer calls. That would measure whether compression preserves the constraints that matter, rather than merely producing a shorter prompt.
The next layer: a recoverable summary hierarchy
Proposed design · not implemented
The current 200-note cap is a refusal boundary, not an automatic merge policy. A future layer could place a tree of derived summaries above retained checkpoints. A leaf would be a bounded investigation state; a parent would summarize an explicit range of children and retain pointers to them. Reading the parent would be cheap, while expanding it would recover the competing hypotheses, failed conditions and next checks that a short summary cannot carry.
Eight notes, read at more than one resolution
Proposed cache: one completed eight-note block, separate from the implemented dependency graph. A growing history can have several such blocks. A range covers notes through ; expand it to recover its children.
[0, 8) · broad summary
[0, 4) · first half
[0, 2)
[2, 4)
[4, 8) · second half
[4, 6)
[6, 8)
Expand each pair to its original checkpoints and their source links.
A completed power-of-two block with leaves has depth and internal summaries. For appends, the proposed scheduler would keep a forest of aligned power-of-two blocks, not rebuild a balanced root for the whole history after each note. Thirteen notes, for example, have roots , and . Append a leaf, then repeatedly merge the last two adjacent equal-size blocks, like carrying a digit in a binary counter. Across appends this completes merges, where is the number of ones in ’s binary representation: fewer than merges in total, amortized, with for one append in the worst case. These are counts of completed merges, not constant-time model work or provenance unions. They do not cover maintaining a full-prefix root, finding a relevant branch, or summary accuracy.
- append a leaf block
- while the last two blocks , are adjacent and equal-sized do
- ← Summarize(, )
- ←
- replace , with their parent
- keep the forest; do not rebuild a root for the whole prefix
Merges in the proposed forest
A bounded reading view could keep recent notes verbatim and represent older ranges with coarser summaries. If a view already contains nodes, replacing one parent with two children costs one extra slot; the reader must spend another slot, coarsen elsewhere or page the expansion. Changing that read budget should change the selected view, not rewrite original research. Exact-note lookup and a search over retained originals must remain escape routes when a summary loses the crucial term.
Research adds constraints beyond compressing prose: preserve branch IDs, contradictory versions, experimental conditions, failed controls, unresolved hypotheses and “reopen if” rules. Treat summaries as disposable caches, not new scientific evidence. Validate the child set and forgetting generation before publishing a parent; union child dependencies so deletion invalidates its derivatives. Rebuild only from still-authorized retained children after a failure. Do not reconstruct a forgotten private note from an old conversation just because a cache needs repair.
Our dependency graph already supplies part of this foundation: versioned source identities, inherited links and descendant deletion. It does not supply a merge scheduler, summary-quality checks, hierarchy search or tokenizer-aware context packing. Those pieces need their own design and long-horizon evaluation. The objective is to keep a small useful view while preserving a path back to detail—not to make compression itself the authority.