Skip to content

Bedrock, Knowledge Base API - exclude JSON citations array

0

Hello,

For Bedrock, Knowledge Base, /retrieveAndGenerate API, is there an input configuration that should specify that the response should not contain the citations JSON array ?

Thank you,

asked a year ago232 views

1 Answer
0
Accepted Answer

There isn't a direct configuration option in the Amazon Bedrock RetrieveAndGenerate API to specifically exclude the citations JSON array from the response. The inclusion of citations in the response is actually a feature designed to provide attribution for information sourced from the knowledge base.

The challenge with citations is actually the opposite of what you're asking - many users struggle with getting citations to appear consistently in responses. Citations may sometimes appear and sometimes not, depending on how the model processes the information.

If you're looking to control the format of the response more precisely, you have a few options:

  1. You could separate the retrieve and generate steps by using the Retrieve API first to get relevant chunks, then passing these to a foundation model via a separate call where you have more control over the response format.

  2. You could use the Converse API with a toolConfig that defines a specific JSON schema for the response, which would give you more control over the structure of the output.

  3. You could implement post-processing in your application to filter out the citations array from the response if it's present.

However, there isn't a simple parameter or flag in the RetrieveAndGenerate API that allows you to specify "don't include citations" in the response.
Sources
Problems with limited answer references in the Bedrock knowledge base | AWS re:Post
aws bedrock-runtime converse or invoke to get response in a given JSON schema format | AWS re:Post
How to have a bedrock agent reliably include knowledge base citations in the final response of InvokeAgent for Agents for Amazon Bedrock Runtime? | AWS re:Post

answered a year ago

AWS
EXPERT

reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.