Home / Blog / Build agentic retrieval on a Managed Amazon Bedrock…
Tech News

Build agentic retrieval on a Managed Amazon Bedrock Knowledge Base with CDK

Amazon Bedrock's Managed Knowledge Base adds AgenticRetrieveStream, and one Python CDK app deploys two knowledge bases, a Gateway, and seven telemetry layers.

By Dillip Chowdary β€’ Oct 27, 2026 β€’ Source: AWS Machine Learning Blog

Build agentic retrieval on a Managed Amazon Bedrock Knowledge Base with CDK

Amazon launched a Managed Amazon Bedrock Knowledge Base, Type MANAGED, so retrieval is no longer a single embed-and-fetch call. The AWS Machine Learning Blog's report deploys that design as one AWS Cloud Development Kit application in Python: an agent routes across two knowledge bases, retrieves through the Amazon Bedrock AgentCore Gateway, and returns a grounded, cited answer. AgenticRetrieveStream reranks internally. One command deploys the stacks. Two Amazon CloudWatch dashboards cover seven telemetry layers, with on-demand and continuous evaluation in the same application.

This piece is for teams whose Retrieval Augmented Generation answers span two corpora, and for engineers choosing between a managed store and Amazon OpenSearch Serverless. It carries the August 2024 CDK sample forward. The Amazon Simple Storage Service path stays familiar, the vector store is gone, and roughly half of the application records what the agent did. New readers can use the design on its own.

Build agentic retrieval on a Managed Amazon: what actually changed

In August 2024, "Build an end-to-end RAG solution using Knowledge Bases for Amazon Bedrock and the AWS CDK" deployed single-shot RAG as hand-sequenced CDK stacks: an Amazon S3 corpus, an Amazon OpenSearch Serverless collection and index, a knowledge base, and a data source. Classic RAG does one retrieval and one generation. A question that spans two corpora gets half of what the model needs, which is worse than returning nothing, because the answer comes back fluent and incomplete. A single index also cannot choose the source or take a second look.

Three things changed. Type MANAGED owns ingestion, storage, indexing, and retrieval, so the OpenSearch Serverless collection is no longer created, scaled, or paid for with OpenSearch Compute Units. Amazon Bedrock AgentCore adds a Gateway that exposes each knowledge base as a Model Context Protocol tool, a Runtime for the reasoning agent, and AgenticRetrieveStream, which returns a synthesized, cited answer. Agentic retrieval runs only on the Managed Knowledge Base. One deployment also provisions two CloudWatch dashboards across seven telemetry layers, plus on-demand and continuous evaluation.

Build agentic retrieval on a Managed Amazon: how it works

Build agentic retrieval on a Managed Amazon Bedrock Knowledge Base with CDK
Illustration Β· Pexels

The agent decides whether to retrieve, which knowledge base to consult, and whether to go back before it answers. AgenticRetrieveStream is a first-class feature: it plans across turns, runs retrieval, and returns citations, rather than an orchestration layer over raw vector search. Semantic routing picks the knowledge base, and retrieval can repeat before the grounded answer. The Gateway exposes each of two knowledge bases as a tool. The bases search and cite, the loop repeats as the question requires, and every step lands in Amazon CloudWatch.

Amazon Bedrock manages embedding and reranking with service-managed models by default, at no extra cost, and the data store auto-scales. There is no vector database to provision, scale, or patch, and no OCU capacity. On a customer-managed knowledge base the team chooses the vector store, often Amazon OpenSearch Serverless, and configures embedding and reranking. AgenticRetrieveStream and AgentCore Gateway integration are supported only on Type MANAGED. Customer-managed remains right for an existing OpenSearch Serverless collection or for data-residency, tuning, or compliance. Managed infrastructure is none.

Advertisement

Tech Pulse Daily

Get tomorrow's pulse first

Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.

Build agentic retrieval on a Managed Amazon: why it matters now

A single-shot pipeline can be read as a function. An agent that retrieves in a loop takes a different path on every question, and by default neither the path nor the answer quality is visible. Production needs latency, call volume, and token usage, and a continuous read on retrieval and answer quality. Two CloudWatch dashboards span seven telemetry layers, with on-demand and continuous evaluation from the same CDK application. Citations trace answers to source passages. Faithfulness and correctness scores catch drift, and those layers support responsible use.

Four densely cross-referenced stacks are why CDK fits. The Gateway needs both knowledge base ids. The agent needs the Gateway URL and ARN. The dashboards need the knowledge base ids, the Gateway ARN, and the agent runtime id. Those seven values cross stack boundaries, each a metric dimension or a connector target. The exports and the ordering script drift when a name changes. Passing a CDK construct derives the export and the dependency edge. The 2024 sample had three stacks and a mostly linear chain.

Build agentic retrieval on a Managed Amazon: who is affected

Teams whose answers span two corpora meet this failure. One retrieval returns half of what the model needs, and the reply is fluent and incomplete. The index cannot choose a knowledge base or look again after the first result. Semantic routing across two knowledge bases is the agent's loop. Hand-sequenced 2024 stacks, an S3 corpus, an OpenSearch Serverless index, and a data source, become a Python CDK application with the vector store gone. One retrieval and one generation still suit a large class of questions.

The AgentCore Gateway connector and AgenticRetrieveStream exist only on Type MANAGED, so teams that want the Gateway and the Runtime use the managed knowledge base. Teams that operate their own vector store, reuse an OpenSearch Serverless collection, or must meet data-residency, tuning, or compliance rules stay customer-managed and provision, scale, and maintain the store. Managed infrastructure is none. Do-it-yourself infrastructure is the vector database and more. The S3-to-knowledge-base path stays familiar, and roughly half the application records what the agent did.

Build agentic retrieval on a Managed Amazon: what to watch

Seven telemetry layers sit on two CloudWatch dashboards: latency, call volume, token usage, and retrieval and answer quality. On-demand and continuous evaluation come from the same CDK application. Faithfulness and correctness scores flag drift from source passages, and citations keep responses auditable. Figure 1 shows the agent deciding whether to retrieve and which knowledge base to consult, the Gateway exposing each base as a tool, the managed bases searching and citing, and the loop repeating for as long as the question needs.

Seven values cross four stacks: both knowledge base ids into the Gateway, the Gateway URL and ARN into the agent, and the knowledge base ids, Gateway ARN, and agent runtime id into the dashboards. Raw exports drift on a rename. CDK derives the dependency by passing the construct, and one command deploys the Python application. AgenticRetrieveStream runs only on the Managed Knowledge Base. A customer-managed OpenSearch Serverless collection for residency or tuning loses Gateway integration. OpenSearch Compute Units stay out because Amazon Bedrock owns storage and indexing.

Developer Action Items

  • ☐ Verify the claim on the official Amazon / AWS / Python page (or AWS Machine Learning Blog), not from this recap alone.
  • ☐ Name the surface that moved β€” API, policy, model, hardware, or commercial terms β€” before you Slack the thread.
  • ☐ Assign one owner a day to read the primary material and decide: this-sprint, this-quarter, or noise.
  • ☐ Do not change production on day-one coverage. Watch the vendor changelog and one independent write-up first.

Build agentic retrieval on a Managed Amazon FAQ

What did Amazon change in a Managed Bedrock Knowledge Base?

Amazon launched a Managed Knowledge Base, Type MANAGED, so retrieval is no longer a single embed-and-fetch call. AgenticRetrieveStream plans across turns, retrieves with tools, reranks internally, and returns a synthesized, cited answer. That API runs only on the managed knowledge base.

How does one question move through the CDK application?

The agent decides whether to retrieve and which of two knowledge bases to consult. The Amazon Bedrock AgentCore Gateway exposes each knowledge base as a Model Context Protocol tool, the managed bases search and cite, and the loop repeats for as long as the question needs. Every step lands in Amazon CloudWatch.

What did the August 2024 CDK sample include that this design leaves out?

The August 2024 post, "Build an end-to-end RAG solution using Knowledge Bases for Amazon Bedrock and the AWS CDK," provisioned an Amazon S3 corpus, an Amazon OpenSearch Serverless collection and index, a knowledge base, and a data source, with stack order sequenced by hand. The managed knowledge base now owns ingestion, storage, indexing, and retrieval, so that collection is not created or paid for with OpenSearch Compute Units.

What telemetry and evaluation ship with the application?

The same CDK application provisions two Amazon CloudWatch dashboards spanning seven telemetry layers, plus on-demand and continuous evaluation. The signals include latency, call volume, and token usage. Faithfulness and correctness scores flag answers drifting from source passages, and citations keep responses auditable.

Why does this deployment use four CDK stacks?

The Gateway needs both knowledge base ids, the agent needs the Gateway URL and ARN, and the dashboards need the knowledge base ids, the Gateway ARN, and the agent runtime id. Those seven values cross the four stacks. Passing a CDK construct derives each export and dependency edge. The 2024 sample used three stacks in a mostly linear chain.

Sources

Dillip Chowdary

Author

Dillip Chowdary

Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.

Related on Tech Bytes

Advertisement

5-min tech signal

Weekday briefing for engineers who skip the noise.

No spam Β· Unsubscribe anytime

Advertisement

✈️ CareerPilot

Your AI job-search copilot

Match your resume against live Ashby, Greenhouse & Lever openings β€” fit scores, job-specific resume optimization and email alerts.

Find matching jobs β†’

Free Tools

Browse all tools β†’