rlm-orchestrator

Implements recursive language model orchestration with async subagent spawning and host-enforced depth limits.

Updated Aug 17, 2026
One-click install
npx skills add https://github.com/lakshya4568/DeepContext --skill rlm-orchestrator-lakshya4568
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rlm-orchestrator
Source: https://github.com/lakshya4568/DeepContext/tree/main/.agents/skills/rlm-orchestrator
Command: npx skills add https://github.com/lakshya4568/DeepContext --skill rlm-orchestrator-lakshya4568

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Standard top-k retrieval fails when a task requires reading or aggregating over more material than fits in any model's context window, such as searching an entire repository or performing full literature-review aggregation. This Skill implements the Recursive Language Model (RLM) pattern, where the corpus lives as an external variable in a sandboxed kernel and the model programmatically decomposes and recursively delegates over it. ## Core Features & Use Cases - Host/Kernel Authority Boundary: Separates the process running model-generated Python from the host that owns database access, memory writes, and provider API keys, with tiered sandboxing from subprocess to gVisor. - Async Subagent Spawning: rlm_spawn() returns an admission handle immediately without blocking, and child results arrive later via agent_message.send(), preserving parallelism and crash isolation. - Host-Enforced Depth and Budgets: Recursion depth defaults to 1 and is enforced on the host side so a compromised kernel cannot raise its own budget. - Use Case: A legal-discovery-style task asks whether any file in a large repository performs a specific action. The router detects the corpus exceeds the model's context budget, spawns child agents over corpus partitions, and aggregates their messages into a structured answer. ## Quick Start Ask the agent to determine whether any file in this repository performs a specific action by recursively delegating over the full corpus using the RLM orchestrator.

Frequently Asked Questions about rlm-orchestrator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement recursive language model subagent spawning in Python?

Implement rlm_spawn as an async function that returns an admission handle immediately with child_id, name, session_dir, and model, never blocking on the child's answer. Launch the child as an independent asyncio task and collect results later through agent_message.send() calls into the parent's inbox.

When should I use RLM instead of RAG retrieval?

Use RLM only when the corpus exceeds the model's effective context budget, the task requires global aggregation, or hybrid retrieval has already failed twice. Verified ablations show the RLM scaffold hurts some tasks and always increases latency, so it is not a default upgrade over standard RAG.

How do I limit recursion depth in a recursive agent system?

Enforce max_recursion_depth on the host side of the host/kernel boundary, checking it on every rlm_spawn call before admitting a child. The default depth is 1, and kernel-side enforcement alone is insufficient because a compromised kernel must not be able to raise its own budget.

Does the RLM sandbox provide security isolation for generated code?

The kernel process runs model-generated Python with worker OS permissions and is a control environment, not a security sandbox. For untrusted documents use container isolation with dropped capabilities, and for production untrusted input use gVisor, nsjail, or a hosted sandbox like E2B.

Why does my RLM implementation hang waiting for subagent results?

Hanging occurs when rlm_spawn is implemented as a blocking call that awaits the child's answer directly. The verified design is fire-and-forget: spawn returns immediately and results arrive asynchronously via agent messages, so a stuck child cannot hang the parent.