RLM Playground
Understanding Recursive Language Models requires more than observing their final answers. This project makes the execution process visible. A user submits a long text document and a question; a hand-rolled TypeScript runtime lets an OpenAI model inspect bounded sections, search for relevant evidence, recursively investigate smaller subproblems, and combine child results into a final answer. Every model decision, environment operation, recursive call, intermediate result, and termination condition is recorded in a structured event stream. An interactive execution tree and chronological timeline let users step through the run, inspect individual calls, and understand how recursion depth, context selection, and execution budgets affect the result.
The constraint
Recursive Language Models introduce a different way to work with large inputs, but their execution can be difficult to understand when hidden behind a conventional chat interface. Without visibility into inspected context, nested model calls, intermediate results, and stopping conditions, it is hard to understand what the model actually did, debug failed runs, or evaluate whether recursion improved the answer enough to justify its cost. This project turns the execution process into an observable, step-by-step learning environment.
How it was built
- –Built a standalone TypeScript RLM runtime, independent of the Next.js frontend and without LangChain or LangGraph
- –Integrated the OpenAI API with structured model decisions for document inspection, search, recursive delegation, and final-answer generation
- –Created a controlled text environment that exposes bounded document excerpts instead of automatically injecting the entire input into every model call
- –Implemented a recursive execution stack that tracks parent-child relationships, passes child results back to parent calls, and supports configurable depth, call, step, and inspection budgets
- –Designed a structured execution-event schema capturing model decisions, environment operations, recursive calls, intermediate outputs, failures, and termination reasons
- –Built an interactive execution tree and chronological timeline with manual step-through controls and event inspection
- –Added execution metrics for model calls, recursion depth, inspected characters, latency, token usage, and estimated cost
- –Designed experiments comparing recursive execution with single-call baselines across document sizes, recursion depths, answer quality, latency, and token cost
Stack
The repository is private. Email sidhantsinghrathoreprsnl@gmail.com with your GitHub username and I'll add you.