Skip to content

AWS Bedrock Agent not returning citations on invokeAgent

1

Hey, we have setup AWS Bedrock with knowledge base (with S3 Bucket as an source), and created an Bedrock Agent, connected with the knowledge base.

We are invoking the agent using PHP SDK (invokeAgent method), which successfully returns the agent's response.

But the citations returned are not consistent. Sometimes, the citation references (documents from S3 bucket) are returned in the response, but sometimes, they are not (the citations array is empty), even though the information in the response was clearly taken from the document in the knowledge base.

Is it possible to enforce the agent to always return the citation references when information was taken from the knowledge base? Or is there any other way to achieve this? We want to make the informations returned by Bedrock checkable, that's why the citation references are important for us.

Thank you in advance!

  • Hello have you found a solution of this please. And please can you explain citations array a bit more with examples like is it in the trace?

asked 2 years ago1.2K views
1 Answer
0

Hi,

I don't know about the enforcement, but at leat, you can trace between the retrieve and generate phases to see what the RAG proposes to use for the generation.

For all details, see https://repost.aws/articles/AR-LV1HoR_S0m-qy89wXwHmw/the-leverage-of-llm-system-prompt-by-knowledge-bases-for-bedrock-in-rag-workflows

Best,

Didier

EXPERT
answered 2 years ago
  • Thanks for the answer Didier, we tried to parse the citation references from the debug traces, but the problem is, that in the traces, there can be references which are not cited in the final response, so this workaround does not work well.

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.