AI Cloud Architect

Break the context window barrier with Amazon Bedrock AgentCore

AWSHow-to by Yuan Tian, Anila Joshi, Anran Wang, Evandro Franco, Haochen Xie, Jared Kramer and Isaac PriviteraAWS Artificial Intelligence Blog

In this post, you will learn how to implement Recursive Language Models (RLM) using Amazon Bedrock AgentCore Code Interpreter and the Strands Agents SDK. By the end, you will know how to process documents of varying lengths, with no upper bound on context size, use Bedrock AgentCore Code Interpreter as persistent working memory for iterative document analysis, and orchestrate sub-large language model (sub-LLM) calls from within a sandboxed Python environment to analyze specific document…

Read the original (opens the source's page in a new tab)

AI: Summary

What it is

Bedrock AgentCore Code Interpreter can hold a full document as Python state, letting a root LLM write code that calls sub-LLMs on chunks, so document size is not limited by the context window.

Who it is for

Teams using Bedrock and Strands Agents that need to analyze documents or code repositories larger than a model's context window.

Key points

  • AWS reports 100% success rate for RLM versus 46.7% for Base on 15 financial QA questions (LongBench v2).
  • On 50 code repository questions, AWS reports RLM accuracy of 64-76% versus 20-46% for Base and Long Context.
  • Individual RLM runs take about 10 seconds to several minutes, per AWS, so it suits batch work more than real-time use.
  • Code Interpreter must run in PUBLIC network mode so the sandbox can call Amazon Bedrock.

The same at other vendors

Timeline

  1. This postBreak the context window barrier with Amazon Bedrock AgentCore
  2. Customer storyAbnormal AI: Amazon Bedrock AgentCore for agentic email security at scale · AWS · Customer story

Go deeper