Infinite context comes with a very finite invoice
The standard response to an agent losing information is to give it more context. It then loses information inside a more expensive context. Fortunately, the invoice has an excellent memory.
A more interesting alternative keeps the corpus outside the prompt and lets the system inspect, select, and decompose it during execution. The architectural problem becomes obtaining enough evidence with bounded resources.
Recursive Language Models explore external context through programs and recursive model calls. Recursive Agent Harnesses, published in June 2026, extends the recursive unit to an agent with tools and execution. These are research proposals, not guarantees about your workload.
Below I develop a design for evaluating that approach. The contracts and limits are an architecture proposal, not a completed benchmark or a customer system.
A case where decomposition makes sense
Consider auditing permission changes in a large repository. The answer requires connecting migrations, HTTP routes, policies, and tests. Searching for authorize can locate relevant code, but the conclusion depends on relationships across files and versions.
The coordinator receives a repository manifest at a fixed commit. It first generates candidates through lexical search and symbol analysis. It then assigns bounded questions: which routes reach an operation, where tenant isolation is enforced, which tests exercise that restriction.
Each child receives a corpus subset and read access. It returns findings with references. The coordinator resolves contradictions and decides whether to widen the search. Shell or network access is granted for a concrete need, with isolation and limits enforced independently of model output.
Preserving relationships is the difficult part. Splitting a repository into ten directories can separate a policy from the place that enforces it. Before parallelizing, identify the dependencies crossing each partition.
The return contract matters more than the agent's name
A child that reports “everything looks correct” leaves little to audit. I would return a structured evidence packet. This TypeScript schema is illustrative:
type EvidencePacket = {
taskId: string;
status: "complete" | "partial" | "blocked";
corpusRevision: string;
claims: Array<{
statement: string;
evidence: Array<{
documentId: string;
contentHash: string;
startLine: number;
endLine: number;
}>;
counterevidence: string[];
}>;
unresolved: string[];
usage: {
inputTokens: number;
outputTokens: number;
toolCalls: number;
};
};
The consumer checks that each document exists in the specified revision, that ranges are valid, and that hashes match. This establishes reference integrity. Whether the passage supports the conclusion needs a separate check, deterministic where possible and semantic where necessary.
A hash does not certify an interpretation. Neither do three agents repeating the same mistake.
When a partial response becomes memory, it retains partial and its unresolved questions. Compaction must preserve the conditions limiting a finding's validity. If the summary drops an exception, the system has manufactured certainty.
The call tree needs global accounting
If each node can create b children up to depth d, a complete tree has at most:
N = 1 + b + b^2 + ... + b^d
With b = 4 and d = 4, that is 341 nodes including the root. This is illustrative arithmetic, not a performance measurement. Four children per agent still permits considerable accumulated enthusiasm.
I would use a central ledger that reserves capacity before admitting work:
| Resource | Proposed control | Failure it prevents |
|---|---|---|
| Tokens | Conservative input and maximum output reservation | Launching calls beyond the balance |
| Tools | Per-task and per-provider allowance | Query amplification |
| Concurrency | Global semaphore | Saturating processes or APIs |
| Depth | Inherited, decreasing limit | Circular delegation |
| Time | Shared deadline | Children outliving the task |
| Output | Maximum packet size | Refilling the parent's context |
Reservation must be atomic: two children cannot spend the same balance. Grandchildren consume resources transferred by their parent. Being born does not entitle them to a new wallet.
Input and output tokens may have different prices. A monetary ceiling needs reservations based on the selected model's rates, billable tools, and an explicit margin. Completion reconciles actual consumption. Canceling a call does not necessarily cancel costs already incurred.
Recursion, batches, and retrieval serve different workloads
| Strategy | When I would consider it | Cost to watch |
|---|---|---|
| One call with selected context | Evidence fits and the question is local | Irrelevant information included |
| Retrieval and synthesis | Queries can locate the evidence | Relevant documents missed |
| Batches with reduction | Partitions can be processed independently | Relationships lost between batches |
| Recursive delegation | Subquestions emerge during analysis | Coordination, duplication, and depth |
Recursive Language Models Meet Uncertainty reports configurations where recursion does not improve results and investigates program selection as a relevant factor. The label “recursive” is not a causal explanation of quality.
My criterion is to allow a branch when a specific question requires additional evidence. The coordinator records what it expects to learn and when it will stop searching. “Investigate further” is an excellent way to spend a budget without defining a stopping condition.
Memory can also carry hostile instructions
A tool description, repository comment, or child's note may contain instructions unrelated to the task. The evidence packet retains its provenance and trust level through delegation and summarization.
The runtime controls allowed paths, network access, credentials, and tools. Read-only children cannot become executors because a document asks them to. Persistent memory stores references and observations, separated by tenant and revision; it must avoid promoting external content into operational policy.
Invalidation matters too. A conclusion about commit A does not describe commit B just because the cache has a recent timestamp. Reuse is justified when relevant dependencies remain unchanged and the method for establishing that is documented.
The comparison I would run before adoption
I would prepare tasks requiring local evidence, relationships across files, and progressive discovery. Development cases and held-out cases would remain separate. The four strategies would use the same corpus, model, and total budget, including child calls.
Measurements would include final correctness, evidence coverage, invalid references, unresolved contradictions, total cost, and end-to-end latency. I would repeat runs and publish failures by task type. Disabling recursion provides an ablation of its actual contribution.
Adoption requires a threshold specified before examining the results: what improvement justifies the cost, and which failures are unacceptable. An enormous execution tree can be a fairly alarming profiling result.
Recursion belongs in the architecture when it improves a measurable task and preserves its evidence under a real budget. Until then, it is a hypothesis with permission to spend.
Related background: agent architecture and evaluating retrieval in RAG.