Toolspublished

AWS’s Bedrock Chat Blueprint Carries Tenant Filters Across Every Retrieval Hop

The reference design hands document processing and answer generation to Bedrock, but its security outcome still depends on application code deriving retrieval boundaries from verified identities.

By 3 min read
AWS’s Bedrock Chat Blueprint Carries Tenant Filters Across Every Retrieval Hop
AWS’s Bedrock Chat Blueprint Carries Tenant Filters Across Every Retrieval Hop

Listen to this story

The audio brief

About 1:37
0:001:37
Read transcript
AWS has published a Bedrock blueprint for multi-tenant document chat that carries a user-specific retrieval filter through every search an agent performs. That matters because one question can trigger several sub-queries—and each hop is another chance to cross a customer boundary. The design starts with identity. The application validates an Amazon Cognito JSON Web Token on the server, derives the caller’s identity, and writes it into each document as user_id metadata. During chat, the server creates an explicit equality filter from that verified identity, rather than trusting an identifier supplied by the browser. AWS says that filter persists through AgenticRetrieveStream’s multi-hop retrieval. The sample also removes any returned chunks whose user_id does not match. That enables one shared knowledge base for many tenants, avoiding the quotas, baseline cost, and provisioning delays of many separate indexes. AWS still presents separate knowledge bases as an option for a small number of large tenants with stricter isolation requirements. Crucially, the boundary is application-enforced: Bedrock handles ingestion, indexing, ranking, retrieval, and generation, but the application owns authentication and access logic. The operational catch is timing. Uploads up to six megabytes go inline; larger text files, up to 50 megabytes, are staged in S3 and queued through SQS. Text can become searchable at TEXT_INDEXED, while PDF images and tables wait for INDEXED. AWS observed seconds for plain text and up to roughly 90 seconds for full PDF indexing—but those are not commitments. The key constraint is whether an application treats “uploaded” as “ready,” or tracks the gap explicitly.

Story brief

3 key points

AWS’s sample architecture turns tenant isolation into an application-enforced control for Bedrock Managed Knowledge Bases: verified Cognito identity becomes document metadata and an explicit retrieval filter that persists through AgenticRetrieveStream sub-queries. The pattern favors one shared knowledge base for many tenants, but leaves authentication, filtering, and product behavior outside Bedrock. It also exposes...

  1. 01

    Separate knowledge bases remain an option for a small number of large tenants needing stricter separation; shared indexing avoids quotas, cost, and provisioning delays.

  2. 02

    Uploads up to 6 MB go inline; larger text files up to 50 MB are staged in S3 and queued through SQS.

  3. 03

    Text becomes searchable at TEXT_INDEXED; PDF images and tables wait for INDEXED.

A document-chat agent can turn one question into several searches, creating several chances to cross a user boundary. AWS has published a Bedrock Managed Knowledge Base reference architecture that applies a per-user filter to each retrieval hop while the managed service handles document processing and response generation.

The boundary starts before a file reaches the knowledge base. The application validates an Amazon Cognito JSON Web Token, derives the caller’s identity on the server, and attaches it as user_id metadata to the document. For chat, the server builds an explicit equality filter from that same verified token, rather than accepting an identifier from the browser.

AgenticRetrieveStream can break a complex request into sub-queries and run multi-hop retrieval before generating a cited response. AWS says the explicit filter travels across those hops. A filter inferred from a question’s wording may improve relevance, but AWS says it is not access control; the sample also discards returned chunks whose user_id does not match the caller.

One shared index, two isolation options

AWS outlines two ways to isolate tenants: separate knowledge bases, or one shared knowledge base with every query scoped to the caller. Its guidance favors the shared model for many end users because it avoids per-account knowledge-base quotas, the baseline cost of many small indexes, and sign-up provisioning delays. Separate bases can still fit a small number of large tenants with strict separation needs.

Uploads have a readiness gap

The design uses a custom connector and IngestKnowledgeBaseDocuments for direct uploads instead of scheduled S3 synchronization. Files up to 6 MB are sent inline; larger text files, up to 50 MB, are staged in S3 and ingested by reference. SQS separates uploads from ingestion, while DynamoDB records indexing status for the application.

Ingestion is asynchronous: documents move from STARTING through PENDING and IN_PROGRESS before reaching TEXT_INDEXED or INDEXED. Text is searchable at TEXT_INDEXED; multimodal elements, including PDF images and tables, become queryable at INDEXED. The reference app polls the status and can present received, processing, and ready states rather than treating acceptance as searchability.

AWS observed two-to-three-second queryability for small plain-text files on an idle knowledge base. Small PDFs reached text-queryable status in five to 30 seconds and full indexing in about 90 seconds, but AWS says those figures are not service commitments and vary with document and system conditions.

Architecture diagram of authenticated document ingestion and filtered chat retrieval in a multi-tenant Bedrock knowledge base application.
AWS’s design links authenticated uploads, asynchronous indexing, status tracking, and filtered agentic retrieval around a shared knowledge base. Source: aws.amazon.com.

The result is a deployable pattern, not a finished chat product. Bedrock manages ingestion, storage, embedding, indexing, ranking, retrieval, and generation; the application still owns authentication, user isolation, and product logic. AWS provides an accompanying sample repository for deployment in a customer’s own account.

Sources

  1. aws.amazon.comBuild multi-tenant agentic chat applications on enterprise data with Amazon Bedrock Managed Knowledge Base | Amazon Web Services