Foundation models in changing environments can encounter unfamiliar domain knowledge that their original training did not cover. However, new domains rarely provide large amounts of expert-created training data or reliable supervisory signals for further training. We introduce Recursa, a foundation model system that adapts to new domains by learning from its own experience without human experts or a stronger teacher model. Recursa uses a knowledge repository to store what it learns: domain-specific skills and instructions on when to apply them, along with memories of past task experiences and reflections on what to improve. Recursa bootstraps the repository from domain materials and then refines it through recursive self-improvement. It uses parallel learners to execute tasks and synthesize local improvements, then validates and merges the improvements into the knowledge repository. On Harvey LAB's Firm Knowledge benchmark, Recursa raises the all-pass rate on held-out test tasks from 30.0% to 55.0% with DeepSeek-V4.1-Flash and from 35.0% to 46.0% with Qwen3.8-Flash.
Figures & tables
Phase
Primary signals
Objective
Bootstrapping
Domain materials and self-practice tasks generated from them
Close the knowledge gap: summarize and map the materials and practice applying them, with parallel agents covering the materials.
Recursive self-improvement
Training tasks, execution traces, and available feedback
Close the behavior gap: refine the knowledge repository from task experience by decomposing learning across child learners, attempting tasks in parallel, and validating results.
Table 1: Recursa’s learning phases.
Figure 1: Recursa’s harness. The model writes Python code, the REPL executes it, and its output returns to the context. The context is appended to the event log, which the REPL queries. Recursa learns the knowledge repository (orange) in this paper; the harness and the foundation models stay fixed.
Figure 2: Recursa’s harness. (a) The agent composes tools in persistent REPL cells; intermediate results such as docs stay in Python, and only the verified excerpt returns to the model. (b) Past interactions live in an append-only event log; the agent retrieves them in code, and only selected evidence enters the active context.
Figure 3: Recursive self-improvement in Recursa. Left: a learner splits its training tasks D into subsets and issues a learning task (Di,K) to a child learner on each; children return revised components and learning traces (Ki,Ti) , which the parent merges and reflects on before issuing new learning tasks. Right: each leaf learner refines the components in a loop with parallel solvers.
Agent setup
Criteria pass
All-pass
Reference base agent (no study)
58.2%
21.6%
Reference agent after study (high study effort)
70.1%
31.0%
Our harness (persistent REPL), original rubrics
78.9%
35.2%
Our harness (persistent REPL), revised rubrics
79.1%
37.2%
Table 2: Task performance with Qwen3.8-27B across agent setups. The reference rows report the base agent without study and the highest-accuracy study configuration from the published evaluation ( Engram, 2026 ) . Our setup uses a persistent REPL and is scored by Qwen3.8-Max with the original and the revised rubrics (Section 6.1 ).
Figure 4: Effect of bootstrapping with DeepSeek-V4.1-Flash on all 250 tasks, scored with the revised rubrics. Teal bars show the baseline; orange-brown bars show the bootstrapped components (14 skills), after building the navigation structure from the raw corpus and practicing on self-generated tasks. Input tokens are totals accumulated across all turns of a task, averaged over tasks (M: million tokens).
Train (150)
Test (100)
Components
All-pass
Criteria
All-pass
Criteria
DeepSeek-V4.1-Flash
No learning
32.0
79.8
30.0
80.0
Bootstrap
34.7
80.6
33.0
78.9
Learning, single learner
34.7
75.3
43.0
78.8
Learning, multi-learner
48.7
86.3
55.0
84.1
Table 3: Results on Harvey LAB with the revised rubrics (all-pass rate and mean criteria pass rate, %). No learning : the harness without learned components. Bootstrap : the components from bootstrapping. Learning : the components from self-improvement, starting from the bootstrapped components. The single learner reports K(4) with DeepSeek-V4.1-Flash and K(5) with Qwen3.8-Flash. Multi-learner learning reports K(2) with DeepSeek-V4.1-Flash, from merged per-subset components and one further round, and K(1) with Qwen3.8-Flash, from merging per-subset components learned on all 150 training tasks.
Figure 5: Q157, a test task, with Qwen3.8-Flash: reading covenants by substance leads to a more recent qualifying agreement. Rows compare search behavior, verification, and the selected transaction and signing date. Traces are paraphrased.
Figure 6: Q078, a test task, with DeepSeek-V4.1-Flash: engagement records define the candidate scope before settlements are checked. The returned set changes from eight matters to the seven qualifying matters. Traces are paraphrased.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
All 250 tasks
Training (150 tasks)
Test (100 tasks)
Components
Original
Revised
Original
Revised
Original
Revised
DeepSeek-V4.1-Flash, multi-learner
No learning
30.0 / 79.7
31.2 / 79.9
30.0 / 79.6
32.0 / 79.8
30.0 / 79.9
30.0 / 80.0
Bootstrap
32.8 / 79.4
34.0 / 80.0
34.0 / 80.0
34.7 / 80.6
31.0 / 78.5
33.0 / 78.9
K(1) (merged)
48.8 / 83.7
50.0 / 84.2
50.7 / 84.9
51.3 / 85.2
46.0 / 81.9
48.0 / 82.8
K(2)
48.8 / 84.9
51.2 / 85.4
45.3 / 85.6
48.7 / 86.3
54.0 / 83.9
55.0 / 84.1
Appendix
Table 4: Bootstrapping, multi-learner self-improvement, and the single-learner baseline with DeepSeek-V4.1-Flash and Qwen3.8-Flash, scored with the original and revised rubrics (all-pass rate / mean criteria pass rate, %). The single learner starts from the same bootstrapped components as the multi-learner runs. Multi-learner learning merges the per-subset components into K(1) and runs four further rounds (Section 6.4 ).
Criterion
Original and revised criterion
Reason
Q005/C-006 Omits
The verified $1.42B acquisition 1032-00004 qualifies but was missing from the allowed set.
Q011/C-014 Files
The task asks for a document showing the add-backs; the executed credit agreement lists the same final add-backs but was rejected.
Q011/C-015 Files
The task asks for a document showing the add-backs; the executed credit agreement lists the same final add-backs but was rejected.
Q016/C-010 Admits
The task excludes real-estate-secured financings; the Fairwater bridge is secured by first mortgages on 14 properties.
Q016/C-013 Admits
Removing Fairwater leaves 11 financings and changes 2025 from 1/2 to 0/1.
Q016/C-014 Admits
The allowed population admitted Fairwater, which the task excludes.
Appendix
Table 5: The 46 revised criteria in 30 Firm Knowledge tasks: the original criterion, the revised criterion used for grading, and the reason for the revision. Below each criterion ID, the label gives the kind of error the revision corrects: Contradicts , the criterion contradicts the task statement; Files , evidence is restricted to named files; Omits , the answer set omits qualifying items; Admits , the answer set admits excluded items; Placeholder , an unexpanded placeholder.