Skip to content

[FEATURE] Bedrock Knowledge Base Retrieve API should return citation-compatible content for Converse API #8017

Description

@rahulrsingh09

[FEATURE] Bedrock Knowledge Base Retrieve API should return citation-compatible content for Converse API

Problem

Bedrock Converse API supports native citations when DocumentBlock objects are present in conversation context. However, the Bedrock Knowledge Base Retrieve API returns plain text chunks — not DocumentBlock objects. This means agents using KB retrieval cannot leverage native citations without significant workarounds.

Current behavior

KB Retrieve API → { text: "chunk of text", score: 0.85, location: { s3Location: { uri: "s3://..." } } }

The response contains:

  • content.text — plain string (the retrieved chunk)
  • location.s3Location.uri — source document URI
  • score — relevance score

Desired behavior

The Retrieve API should offer an option to return results in a format compatible with Bedrock Converse API citations, e.g.:

KB Retrieve API → { documentBlock: { source: { bytes: <...> }, name: "doc.pdf", format: "pdf" }, ... }

Or at minimum, return enough structured metadata (document name, page/section, byte range) that an SDK or agent framework can construct DocumentBlock objects without fetching the full source document from S3.

Workaround today

  1. Call KB Retrieve to get text chunks + S3 URIs
  2. Fetch the full source document from S3 (GetObject)
  3. Construct DocumentBlock with the document bytes
  4. Return from tool → Bedrock Converse generates native citations

This is impractical at scale because:

  • Full document fetch on every query (50+ page PDFs)
  • Loses chunk-level granularity — Bedrock cites the whole doc, not the specific passage
  • Latency and cost increase significantly

Context

Impact

This is the missing link between two flagship Bedrock features — Knowledge Bases and native citations. Today, any agent using KB retrieval must either:

  • Use prompt-based citations (LLM formats [1] DocName — "excerpt", parsed client-side) — works but fragile
  • Fetch full documents from S3 on every query — works but impractical

A first-party solution from the KB Retrieve API would unblock native citations for the entire Bedrock agent ecosystem.

Metadata

Metadata

Assignees

Labels

feature-requestNew feature or enhancement. May require GitHub community feedback.p3This is a minor priority issueservice-apiThis issue is due to a problem in a service API, not the SDK implementation.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions