Recursive Language Models (RLM) offer a way to process documents far exceeding LLM context window limits. Using Amazon Bedrock AgentCore Code Interpreter as persistent working memory and the Strands Agents SDK for orchestration, a root LLM writes Python code to iteratively explore documents and delegates semantic analysis of specific chunks to sub-LLM calls. The full document never enters the root model's context window. Evaluated on LongBench v2 Financial QA and Code Repository QA benchmarks, RLM achieves 100% success rate (vs. 30–93% for baseline approaches) and substantially higher accuracy — Claude Opus 4.6 with RLM hits 80% on Financial QA vs. 66.7% for long-context baseline, and Claude Sonnet 4.5 hits 76% on Code QA vs. 46% for long-context. Key tradeoffs include higher latency and cost from multiple model invocations.

13m read timeFrom aws.amazon.com
Post cover image
Table of contents
Why context windows aren’t enoughRLMs: Treating context as an environmentArchitectureImplementationPrerequisitesEvaluationScaling to code repository understanding: LongBench v2 CodeQAHow the model works through a problemConsiderationsCleaning upConclusionReferencesAbout the authors
74 Impressions