avbiswas/fast-rlm

A feature rich implementation of Recursive Language Models, with ACP integration, REPL tool support, structured IO, advanced visualization, logging tools.

What it solves

fast-rlm provides a minimal implementation of Recursive Language Models (RLMs), allowing LLMs to handle arbitrarily long prompts that exceed their context window. It solves the problem of context overflow by enabling an agent to programmatically explore, decompose, and transform data through an external REPL rather than attempting to fit all information into a single prompt.

How it works

The system uses a REPL (powered by Deno and Pyodide) where the LLM can write and execute code to manipulate its input. Instead of loading all data into the prompt, the agent interacts with the data via code. It can recursively invoke sub-agents to handle smaller subtasks, where the responses are returned as variables or symbols within the parent agent's REPL environment, preventing the parent's context from becoming cluttered.

Who it’s for

Developers and AI researchers who need to process massive datasets or complex tasks that require programmatic decomposition and recursive agentic workflows without manual chunking or complex RAG pipelines.

Highlights

  • Arbitrarily Long Context: Agents can search, filter, and chunk massive files (e.g., millions of tokens) programmatically.
  • Recursive Delegation: Ability to spawn sub-agents to complete subtasks with isolated contexts.
  • Structured I/O: Supports Pydantic models, JSON Schema, and Python primitives for both input and output validation.
  • Resumable Sessions: State is auto-saved after every step, allowing follow-up queries to reuse previous work and variables.
  • MCP Integration: Connects to Model Context Protocol servers to expose external tools and resources inside the REPL.
  • Flexible Backends: Supports OpenAI-compatible APIs, Vertex AI, native Anthropic API, and local CLI coding agents.

Related

  • Project
  • Project
  • Project
  • Project
  • Project