← Back
AWS ML Blog

Connect Amazon Bedrock AgentCore to cross-account knowledge bases

•9 min read•
#agents#llm
Level:Intermediate
For:AI Engineers
✦TL;DR

** Amazon Bedrock AgentCore can now query a Knowledge Base backed by Amazon Redshift Serverless in a different AWS account without copying data, using a cross‑account IAM role and the RetrieveAndGenerate API (executed with Claude Haiku 4.5). The solution offers two orchestration variants—a code‑based Strands agent running in an MCP subprocess and a declarative AgentCore harness that invokes an AWS Lambda tool via AgentCore Gateway. Engineers gain a least‑privilege, multi‑account pattern for RAG‑style agents while keeping data and compute workloads isolated. **KeyTakeaways:** - Cross‑account Knowledge Base access uses the RetrieveAndGenerate action (Claude Haiku 4.5) via a narrowly scoped IAM role. - Variant 1 runs the query tool in a local Model Context Protocol (MCP) subprocess packaged with AgentCore runtime.

⚡ Key Takeaways

  • Cross‑account Knowledge Base access uses the RetrieveAndGenerate action (Claude Haiku 4.5) via a narrowly scoped IAM role.
  • Variant 1 runs the query tool in a local Model Context Protocol (MCP) subprocess packaged with AgentCore runtime.
  • Variant 2 routes the query through an AWS Lambda invoked by AgentCore Gateway (declarative harness).
  • The Knowledge Base resource policy must allow Retrieve and GetDocumentContent but not RetrieveAndGenerate, so the tool must assume the bedrock_kb_access_role via AWS STS.
  • The pattern preserves account boundaries, avoids data duplication, and provides citation‑rich answers from Redshift Serverless.
💡 Why It Matters

** This cross‑account RAG pattern lets production teams enforce strict data governance while still delivering real‑time, LLM‑generated answers, reducing latency and compliance risk compared to data replication. **TechnicalLevel:** Advanced **TargetAudience:** ML Engineers, AI Platform Architects **PracticalSteps:** - Deploy the GitHub sample for Variant 1 or Variant 2, which provisions…

✅ Practical Steps

  1. Deploy the GitHub sample for Variant 1 or Variant 2, which provisions the Strands agent or declarative harness respectively.
  2. Configure an IAM role named bedrock_kb_access_role in the Knowledge‑Base account with Retrieve and GetDocumentContent permissions, and allow the AgentCore account to assume it via AWS STS.
  3. Update the AgentCore tool configuration to call RetrieveAndGenerate with Claude Haiku 4.5, ensuring the assumed role is used for the request.

Want the full story? Read the original article.

Read on AWS ML Blog ↗

More like this

Censored vs. Truncated Regression in Python, Explained

Towards Data Science•#llm

New in AWS Quick: More capable flows, an updated web experience, and agents that work together

AWS ML Blog•#agents

How Google Duplex evolved to also call businesses for you in Gemini

Google Research•#agents

Q&A: Enabling more human-like interactions and understanding in multimodal foundation models

MIT News AI•#llm

EXPLORE AI NEWS

Daily hand-picked stories on LLMs, RAG, agents and production AI — curated for engineers who ship.

BROWSE NEWS

GET THE WEEKLY DIGEST

Join engineers getting the Monday signal-over-noise AI breakdown. No spam, unsubscribe anytime.

LEARN AI ENGINEERING

Curated courses, research papers, repos and tutorials built for engineers leveling up in AI.

START LEARNING