Recursive Language Models move repository context into a programmable execution environment where the model writes code to inspect and select evidence.
2
The model can recursively ask another model focused questions through `llm_query`, then use the answers to continue its investigation.
3
RLM Code is an open-source, independent harness that demonstrates this pattern with local and cloud models, sandboxed execution, and inspectable traces.
Summary
Shashi explains how Recursive Language Models can help coding agents work with large repositories. As repository context grows, agents can lose architecture and perform worse. RLM changes the setup by loading the repository into a programmable REPL, where the model writes code to inspect files, dependencies, tests, and configuration, then passes bounded observations into its main context. When it needs specialist help, it can call another model through `llm_query` and continue the loop. The talk demonstrates RLM Code, an independent open-source harness from Superagentic AI. The demo uses a Docker sandbox and Gemini, showing generated REPL code, evidence, recursive calls, final answers, token information, and JSONL traces. Shashi also describes possible uses such as repository onboarding and root-cause analysis, and argues that similar ideas appear in several coding-agent and managed-agent systems.
Large repositories make coding-agent context harder to manage
Shashi starts with the problem of applying coding agents to large repositories. Agents may work well on smaller repositories, but performance degrades as the context grows. Existing approaches include searching with filesystem tools such as grep, using semantic or local search to curate context, compressing long context into summaries, and storing information in memory systems. These approaches try to control what reaches the model, but the talk proposes moving that context work into a programmable environment.
RLM externalizes context management into a programmable environment
The core RLM idea is to treat the full repository as data that the model can operate on outside its main context window. The model writes code in a dedicated REPL to inspect the repository, slice it, and compute relevant chunks. Those bounded observations are then fed into the main context. Shashi describes this as a context-management technique that can also work as a memory layer for coding agents.
Repository investigation follows the work of a lead engineer
Shashi compares RLM with how a lead engineer approaches an unfamiliar monorepo. The engineer first inspects structure, dependencies, and notes about the project instead of reading every line. They may write scripts to search the repository, then ask another engineer when something remains unclear. In RLM, the programmable REPL holds the investigative code and notes, while `llm_query` asks another model or environment for a focused answer. The loop ends with a synthesized result.
Recursive calls let the model delegate focused questions
The recursive part begins when the model asks another specialist through `llm_query`. The request can contain one question or several questions. The main loop uses the repository as its context, writes REPL code to obtain relevant evidence, and calls another language model when more information is needed. It keeps receiving values and investigating until it can return a final result.
Codebases require structural reasoning beyond text retrieval
Shashi chooses codebases because they contain more than a large body of text. A repository has directories, tests, imports, dependencies, images, and configuration files. An agent must reason about how these pieces relate. RLM gives the model a way to inspect that structured data programmatically instead of placing the entire repository directly into the context window.
RLM Code is a reference harness rather than a new RLM variant
RLM Code is presented as an open-source research playground from Superagentic AI. Shashi distinguishes the RLM pattern from individual implementations, including the authors' repositories and the implementation in DSPy. RLM Code follows the paper's recursive calls and REPL execution, while allowing users to run local or cloud models, connect an observability framework, and use the pattern with another agent framework.
The demo exposes the full investigation trajectory
In the CLI demo, a repository is loaded into a Docker sandbox. The model writes REPL code, builds evidence, calls `llm_query`, and produces a final answer. The interface shows the steps, tool calls, token usage, sessions, and traces. A second experimental coding-agent interface connects to Gemini, accepts a budget and recursion depth, and displays the completed trajectory in a research-lab view.
RLM can support repository onboarding and root-cause analysis
Shashi suggests using the pattern when engineers need to understand unfamiliar repositories or investigate a root cause. A custom harness can capture planning, code generation, observations, subcalls, budget, and final output. He also points to reported similarities in coding-agent harnesses, managed agents, dynamic workflows, and software-factory systems, while saying that some of those uses are uncertain.