AWS outlines three ways to cut costs in Bedrock agent JSON workloads

AWS has outlined three strategies for reducing token consumption, latency and memory overhead in Amazon Bedrock AgentCore agents that process large JSON payloads. In benchmark runs using a representative 23 MB payload, the company says the combined approach cut token consumption by up to 71% and average latency by up to 80%.
- AWS used three composable strategies for large JSON workloads in Amazon Bedrock AgentCore.
- The Flightscape agent uses more than 40 tools and JSON inputs measured in megabytes.
- AWS reports up to 71% lower token consumption in benchmark runs.
- AWS reports up to 80% lower average latency on a representative 23 MB payload.
- Heavy artifacts are stored in Amazon S3 while AgentCore memory keeps references.
Large JSON payloads can inflate agent costs
AWS says enterprises building production agents with dozens of tools and large structured inputs face rising token usage and slower responses. When an agent processes large JSON data, each additional tool invocation can inject the full payload into the large language model context window.
That pressure can compound across multi-turn conversations, increasing costs and degrading response quality. AWS describes context-window management as important for reliability and responsiveness in agentic systems that operate at scale.
Flightscape agent handled more than 20 MB of JSON
The strategies were used to build a production agent for Flightscape, an airline operations platform that helps airlines plan and manage crews, flights and operations. Its Training Schedule Optimization agent verifies crew training schedule assignments against business rules.
The agent works with more than 40 tools and JSON inputs measured in megabytes. It can answer queries about crew assignments, scheduling and resource allocation, but average request latency exceeded 15 seconds across most calls. AWS says every tool call injected its full payload into the model context, increasing token counts and costs. On larger datasets, the context window could fill before the agent completed its reasoning.
The system uses LangGraph, an open source framework by LangChain, and runs on Amazon Bedrock AgentCore. Its inputs include an optimization request JSON, an optimization response JSON and a validation report JSON. An AI agent uses those documents to provide a conversational interface for querying optimization results, understanding validation errors and exploring scheduling assignments.
Heavy artifacts move to Amazon S3
AWS says the three strategies can be combined within a single agent turn. At the beginning of a turn, hydrate_state() restores lightweight session state from Amazon Bedrock AgentCore memory. At the end, dehydrate_state() writes heavy payloads to the S3ArtifactStore and saves references in AgentCore memory.
The first strategy changes how session state is persisted. Large request, response, validation and derived data artifacts are moved to Amazon Simple Storage Service, while AgentCore memory retains stable references and lightweight fields. Tools can hydrate heavy payloads on demand instead of loading all of them on every turn.
When a tool returns an oversized list or dictionary, the agent stores the full result in Amazon S3 and sends the model a compact summary with a handle. The model can request additional detail through get_result_page_tool(). AWS also provides companion code in a GitHub repository and lists an AWS account, an Amazon S3 bucket, AgentCore memory, a LangGraph-based agent and a Python 3.12+ environment among the prerequisites.
For users and organizations building agents around large structured datasets, the approach offers a way to preserve access to detailed artifacts while reducing how much data is repeatedly placed in the conversational context. The reported savings apply to AWS's benchmark runs on the representative 23 MB payload.


