用CDK构建Bedrock智能体检索
AWS Machine Learning Blog介绍如何使用AWS Cloud Development Kit,在托管的Amazon Bedrock知识库上构建智能体检索。方案涵盖多知识库路由、运行于Amazon Bedrock AgentCore的推理智能体、MCP工具、带引用的检索、七层可观测性及评估,并通过CDK部署四个相互依赖的云栈。AWS称,推理智能体可决定是否检索、选择知识库,并在回答前再次检索。
该教程给出了智能体RAG的可执行实现模式,覆盖托管摄取、多轮检索、可观测性、评估及CDK基础设施部署。
This post builds enterprise agentic retrieval on a Managed Amazon Bedrock Knowledge Base with the AWS Cloud Development Kit (AWS CDK). To see why that’s worth building, it helps to start with where ordinary Retrieval Augmented Generation (RAG) breaks down. Most RAG systems start the same way: they embed the question, fetch the nearest chunks from one index, hand them to a model, and return the answer. One retrieval, one generation. For a large class of questions that’s the right design, and there’s no reason to build anything more complicated.
It fails in a recognizable way. Ask a question whose answer spans two corpora, and a single retrieval returns half of what the model needs, which is worse than returning nothing, because the answer comes back fluent and incomplete. Ask a question where the right source depends on the question, and a single index has no mechanism to choose. Ask a question that needs a second look at the corpus after seeing the first result, and there is nowhere for that second look to happen.
Enterprise agentic retrieval answers all three by putting a reasoning agent in the loop. The agent decides whether to retrieve, which knowledge base to consult, and whether to go back for more before it composes an answer. This is the direction Amazon Bedrock Knowledge Bases have evolved. With the launch of the Managed Knowledge Base, retrieval is no longer a single embed-and-fetch call. It has become an agentic capability: multi-turn planning, tool-driven retrieval, and grounded, cited answers. The AgenticRetrieveStream API offers this as a first-class service feature rather than something you assemble yourself. That works, and it also introduces a genuinely harder operational problem. A single-shot pipeline is a function you can reason about by reading it. An agent that reasons and retrieves in a loop takes a different path on every question. By default you can see neither the path it took nor whether the answer it produced was any good. Observability stops being a nice-to-have and becomes the only way to know the system works.
#Amazon Web Services#Amazon Bedrock#Managed Amazon Bedrock Knowledge Base#Amazon Bedrock AgentCore#AgenticRetrieveStream#Model Context Protocol#AWS Cloud Development Kit#Amazon CloudFormation#Amazon S3