Agent engineering

Recursive Language Models for messy business investigations

Instead of stuffing every requirement note, Flow, Apex class, and audit trail into one prompt, an RLM treats those artifacts as an environment it can inspect and recurse over.

Consultant investigation

Imagine tracing an unexpected Opportunity stage change

You have requirements, Flows, Apex, validation rules, history, and incident notes. The trick is not to stuff all of it into one prompt.

Think like a consultant investigating a messy stage-change issue: inspect one artifact, recurse into the most relevant slice, store the finding, and only then synthesize.

Business notes

Partner-led approvals changed the expected stage path

Requirements say enterprise partner deals should only advance after an approval outcome and a compliance check.

Flow

Flow updates Opportunity stage after approval status changes

A record-triggered Flow listens for approval updates and writes to Opportunity stage under specific partner conditions.

Apex

Apex trigger adds a second stage mutation path

A trigger handler recalculates stage when partner metadata and account tier satisfy an older rule set.

Validation

Validation rules encode assumptions from the old process

A validation rule still expects an intermediate stage before final advancement for enterprise accounts.

Field history

Audit trail shows stage flips after approval completion

Field history reveals a rapid sequence of writes from automation and custom logic after approval events.

Incident notes

A prior hotfix changed one path but not the other

Earlier incident notes mention a patch for partner approvals, but only inside one automation branch.

Why this matters

Long context is not one problem

Some tasks need one fact. Others require dense access across the whole prompt. The hardest tasks need relationships across many pieces.

Direct prompting

Stuff everything in one context window

You ask the model to hold requirements, automation, notes, and audit history all at once, even if only one slice matters at the current step.

Summarize early to stay under token pressure

The context gets shorter, but fragile details can disappear before the model knows what evidence will matter later.

Retry with better phrasing when answers drift

Iteration happens at the whole-prompt level instead of inside a focused subproblem.

Recursive language model

Inspect the environment selectively

The root model chooses which artifact to open next instead of dragging the whole case into one pass.

Recurse into the promising slice

Each sub-call works on a tighter, clearer local context such as one branch of automation or one run of field history.

Store findings for later synthesis

Intermediate conclusions persist as explicit state, so the model can compose an answer without re-reading the full environment.

Needle-in-a-haystack is not the same as diagnosis
Retrieving one buried fact can still work in a long prompt. Diagnosing a business process failure means tracing how many facts interact, often across time and tooling.
Compression can erase the clue you need later
When you ask a model to summarize everything up front, it may discard the exact assumption, exception, or timestamp that later determines the answer.

Takeaway

Input length and reasoning difficulty are different axes.

Core idea

Treat the prompt like an environment, not a container

An RLM does not force every artifact into the root context. It inspects the environment, decides what deserves deeper attention, and stores only the findings it needs to keep.

Prompt as environment

Artifacts stay outside the root context
Root model writes code and chooses where to recurse
Intermediate findings are stored symbolically
Final answers emerge after the stored findings are reconciled, not after one giant pass over every artifact.
Recursive calls create focused local contexts
Each sub-call gets a narrower slice such as the Flow branch, the trigger condition, or the audit sequence. That reduces clutter while preserving fidelity inside the relevant region.
Symbolic state keeps the thread of the investigation
Instead of re-summarizing the whole case after every step, the system stores explicit findings that later steps can reference and combine.

Takeaway

The root model orchestrates investigation. It does not personally read every line before reasoning starts.

What changes

Recursive orchestration beats a single heroic prompt

Direct prompting, retrieval, and compaction all help in parts of the workflow, but they do not create the same inspect-store-synthesize loop.

Retrieval finds documents, not complete causal chains
A retriever can surface the right Flow or note, but the system still needs to reconcile competing logic across multiple artifacts to answer the actual question.
Shallow tool use often stops before synthesis
If each tool call returns isolated snippets with no durable intermediate state, the model still ends up recomputing context or missing cross-artifact dependencies.

Takeaway

The win is not just more context. It is better control over where reasoning happens and what gets remembered.

Reality check

RLMs trade raw efficiency for structured investigation

Recursive exploration introduces overhead, extra calls, and occasionally messy trajectories. The payoff appears when the task truly needs deliberate decomposition.

Tail costs can grow quickly
A poor branching strategy can make the system inspect too much. Good recursive control still matters, especially when environments are large and noisy.
The interface still needs to help humans trust the answer
For consultant workflows, showing the path of evidence and stored findings matters almost as much as the final diagnosis itself.

Takeaway

This is not a universal replacement for direct prompting. It is a stronger pattern for tasks with layered evidence and dependent reasoning.

Results pattern

Benchmarks matter most when reasoning gets relational

The paper's results are easiest to remember as a progression: single-fact retrieval is not the hardest case, but multi-hop and pairwise reasoning make direct prompting degrade much faster.

S-NIAH

Finding one buried fact stays relatively manageable.

OOLONG

Aggregating meaning across many entries punishes direct prompting sooner.

OOLONG-Pairs

Pairwise reasoning is where recursive orchestration matters most.

Takeaway

RLMs are most interesting when the task needs controlled decomposition plus synthesis.

Cheat sheet

What to remember when you see RLMs again

Best for layered evidence

RLMs shine when the answer depends on interactions across multiple artifacts, not just locating one hidden fact.

Think investigation, not ingestion

The key shift is from fitting everything into one prompt to navigating an environment with deliberate recursive steps.

Working memory matters

Symbolic findings let the model accumulate understanding without repeatedly compacting the whole case.

Use direct prompts when the task is simple

If the work is short, local, or mostly retrieval, recursive orchestration can cost more than it helps.