AWS published a Python CDK sample that routes an agent across managed Bedrock knowledge bases and includes monitoring and answer evaluation.
AWS published a Python AWS Cloud Development Kit (CDK) sample on October 26, 2026, for building an agent that retrieves information across multiple Amazon Bedrock Knowledge Bases. The example routes questions to one of two separate knowledge bases, lets the agent retrieve again when needed, and returns answers with citations.
The architecture uses Amazon Bedrock AgentCore Runtime to host the agent and AgentCore Gateway to expose each knowledge base as a retrieval tool. The knowledge bases are the managed type, which handles ingestion, storage, indexing, and retrieval; AWS says agentic retrieval and the Gateway connector in this design are not supported for customer-managed knowledge bases. The sample’s financial corpus is synthetic, while its weather corpus uses a public Congressional Research Service report on tornadoes.
The CDK application provisions four dependent stacks: knowledge bases, the Gateway, the agent runtime, and monitoring dashboards. AWS says CDK derives their deployment order from the stack references, so the example can be deployed with `cdk deploy --all`. Building the agent container with CodeBuild takes roughly eight to ten minutes, according to the post; prerequisites include an AWS account, the CDK CLI, and Python 3.13 or later.
Monitoring is a central part of the sample. Two CloudWatch dashboards cover seven telemetry layers, including knowledge-base activity, Gateway calls, agent traces, token usage, and evaluation scores. The app provisions both on-demand evaluation and continuous sampling of live sessions. AWS advises configuring the sampling rate to suit monitoring needs, budget, and organizational policies.
The example is aimed at teams that need retrieval across distinct information sources and want visibility into how an agent selects tools and produces answers. AWS notes that a simpler, single-shot retrieval design may be cheaper and sufficient when one corpus contains the answer; the multi-source approach adds an agent loop and associated operational complexity.
