Customize answers per tenant in Amazon Bedrock Managed Knowledge Base

In one sentence

AWS demonstrates how to use retrieval instructions and metadata filters in Amazon Bedrock Managed Knowledge Base to customize answer styles and policies per tenant from shared documents.

Key points

  • Retrieval instructions use four fields—persona, answerFormat, retrievalGuidance, and answerPolicy—to control answer tone, structure, search interpretation, and policy.
  • Managed and versioned as Amazon Bedrock resources, instructions allow applications to pin and switch versions independently.
  • Instructions only govern how answers are generated and do not isolate data, requiring metadata filters or separate knowledge bases for access control.
  • The post demonstrates this pattern using a fictitious company, AnyCompany Smart Home, serving six regional and internal team tenants from shared documents.

In depth

An AI-written overview of the original article, not the article itself.

The article introduces retrieval instructions in Amazon Bedrock Managed Knowledge Base, enabling teams to customize answers per tenant on shared documents. Previously, developers had to maintain prompts across every application; now, instructions are managed, versioned resources written once and referenced per request.

Instruction Fields and Lifecycle

According to the post, an instruction has four fields: persona for identity and language, answerFormat for structure and citations, retrievalGuidance for search interpretation, and answerPolicy for response rules. While retrievalGuidance always applies, the other three only take effect when response generation is enabled.

Instructions belong to an AWS account and Region rather than a knowledge base. They go through creation, asynchronous review, activation, immutable versioning, request application, and trace reporting, allowing applications to pin versions and upgrade when ready.

Data Isolation and Access Control

The article notes that retrieval instructions do not provide data isolation, and answer policies are best effort. To restrict which documents a tenant can access, backends must build metadata filters from the authenticated tenant or use separate knowledge bases.

For each request, the backend sends the instruction version, metadata filter, and a short tenant line. A single agentic retrieval request can query up to five knowledge bases, with the instruction applying across all of them.

Combined Tenants and Quotas

Each request can reference only one instruction. For users belonging to both a region and a team, the post recommends using the team instruction plus a region tenant line to keep instructions at N plus M rather than N times M. The default quota is 50 instructions per account per Region.

Read originalOpens aws.amazon.com

This summary was generated by AI from the original article and may contain errors; the original is authoritative. Copyright belongs to the original author.

Recent stories from this source