Recursive Language Model
A durable RLM built from Tardigrade components.
What is an RLM?
An RLM puts long context inside a code environment. The model inspects and partitions that context, calls models over smaller pieces, and combines their work into one answer.
context as data
context[0..n]code environment
inspect(context)partition(context)recursive model callsresultfinal answer
Build it with Tardigrade
Code mode provides the environment. Packages expose files, fetch, workspace storage, and child agents. Budgets and compaction keep the recursive work bounded.
README.md / Compose an agentView on GitHub
ts
import {
actor, agentMethods, agentsPackage, budget,
budgetAuthority, caller, codeMode, compaction,
fetchPackage, filesPackage, infer,
outputValidateOnce, system, workspacePackage
} from "tardie"
const instructions = system(
"Investigate with code and delegate independent work."
)
const rlm = actor({
name: "researcher",
methods: agentMethods,
components: [
infer([
instructions,
budget([
codeMode([
filesPackage(),
fetchPackage(),
agentsPackage(),
workspacePackage()
])
], { authority: caller() }),
compaction(),
outputValidateOnce
]),
budgetAuthority()
]
})
How it is assembled
codeModeLets the model act by writing JavaScript.
agentsPackageLets that code spawn durable child agents.
workspacePackageStores large values outside the model context.
budget + compactionBounds delegated work and the context sent to the model.
Start from the quickstart
Initialize a project with the RLM template to get this assembly directly.
tdg init researcher --template rlm