- Newest
- Most votes
- Most comments
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:
-
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.
-
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.
-
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
Relevant content
asked 3 years ago
asked a year ago
