Agentic Retrieval with Managed Amazon Bedrock Knowledge Base
This article outlines the use of agentic retrieval with a managed Amazon Bedrock Knowledge Base, highlighting its enterprise capabilities and workflow integration with AgentCore.
Overview of Agentic Retrieval with Managed Knowledge Base
This section provides an overview of agentic retrieval with a Managed Amazon Bedrock Knowledge Base. According to AWS Machine Learning, this post focuses on building enterprise agentic retrieval using the AWS Cloud Development Kit (AWS CDK) on a Managed Amazon Bedrock Knowledge Base. AWS Machine Learning explains that Amazon Bedrock now offers a managed knowledge base (Type: MANAGED), which handles ingestion, storage, indexing, and retrieval internally. Furthermore, AWS Machine Learning clarifies that agentic retrieval is available exclusively on the Managed Knowledge Base. These features enable developers to leverage a fully managed service for knowledge base operations while integrating agentic retrieval capabilities into their applications.
Comparison Between Managed and DIY Knowledge Bases
When comparing managed and DIY knowledge bases, Amazon Bedrock's managed option offers distinct advantages for enterprise agentic retrieval. According to Amazon Bedrock, the managed knowledge base (Type: MANAGED) automatically handles ingestion, storage, indexing, and retrieval, including embedding and reranking with service-managed models by default. This eliminates the need for provisioning, scaling, or patching a vector database. In contrast, DIY knowledge bases require customers to configure and maintain these components. A key difference is the support for agentic retrieval (AgenticRetrieveStream), which is available only on the managed knowledge base. Additionally, the AgentCore Gateway integration is supported on the managed version but not on DIY setups. As noted in Amazon Bedrock's documentation, managed knowledge bases automatically parse, chunk, embed, and index PDFs during ingestion, reducing operational overhead for users.
Workflow of Agentic Retrieval and Integration with AgentCore
The workflow of agentic retrieval begins when a user’s question is received by the AgentCore Runtime. The question is then routed through the AgentCore Gateway to one of two AgenticRetrieveStream tools, each associated with a managed knowledge base—financial and weather—ingested from Amazon S3 (AWS Machine Learning). The selected tool call is brokered by the AgentCore Gateway over MCP, authorized by the agent’s IAM task role and signed with SigV4, which invokes the corresponding knowledge base’s AgenticRetrieveStream API on the Managed Knowledge Base (AWS Machine Learning). Within the knowledge base, AgenticRetrieveStream decomposes the question into sub-queries, retrieves iteratively from the data store managed by Amazon Bedrock (ingested from Amazon S3 corpora), and synthesizes a grounded, cited answer that streams back through the Gateway (AWS Machine Learning).
Deployment Process Using AWS CDK
Deployment of the solution using AWS CDK involves cloning the sample repository and executing a series of commands in the terminal. After cloning the repository and navigating to the project directory, a virtual environment is created and activated. Dependencies are installed using pip install -r requirements.txt. The cdk bootstrap command is executed once per account and region, followed by cdk deploy --all to deploy the entire solution. According to AWS Machine Learning, the managed ingestion process successfully indexes one document per knowledge base with zero failures. However, AWS Machine Learning notes that the managed knowledge base, agentic retrieval, and related services are not available in all AWS Regions.
Sources and reporting notes
Based on published source material. No independent hands-on testing is claimed.