models
Connecting Amazon Bedrock AgentCore to Cross-Account Knowledge Bases
This article explains how Amazon Bedrock AgentCore agents in one AWS account can generate answers from a knowledge base stored in another account, without copying data. It covers architecture, security, request flow, and two orchestration models: a code-based Strands agent and a declarative harness.
AS1 NewsSource: aws.amazon.com
Organizations deploying AI agents with Amazon Bedrock often need to access structured data stored in separate AWS accounts. This setup maintains clear workload boundaries but introduces integration challenges. Amazon Bedrock Knowledge Bases support cross-account operations through resource policies, but do not natively support RetrieveAndGenerate actions across accounts. To address this, Amazon has introduced methods allowing agents in one account to generate answers from knowledge bases in another, leveraging IAM roles and AWS Security Token Service (STS).
The solution involves two variants: a code-based Strands agent running within the AgentCore runtime, and a declarative harness that manages the agent loop. Both variants assume a dedicated cross-account IAM role with least privilege, which allows the agent to call RetrieveAndGenerate on the knowledge base in the data account.
The request flow begins with a user submitting a question via a UI or API. The agent then invokes the appropriate tool—either directly in the code-based variant or through an AWS Lambda in the harness variant—assuming the cross-account role via STS. The knowledge base translates the question into a structured query against Amazon Redshift Serverless, returning a generated answer and citations.
Choosing between the variants depends on the level of customization needed. The code-based agent offers more control for complex orchestration, while the declarative harness simplifies management for straightforward use cases. Both implementations require setting up cross-account roles, configuring the knowledge base, and deploying the agent components.
This approach enables enterprises to maintain strict data governance while leveraging Amazon Bedrock's generative AI capabilities across multiple AWS accounts. It supports scenarios where data privacy and workload separation are critical, providing a scalable and secure method for cross-account AI knowledge retrieval.
Enables cross-account knowledge base querying for AI agents, supporting enterprise data governance and scalable AI deployment.