-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
invoke_agent API on bedrock-agent-runtime inconsistently returns retrievedReferences #4197
Comments
Thanks for reaching out. The invoke_agent command involves a call to the underlying Bedrock InvokeAgent API. This issue is currently being tracked here in our cross-SDK repository: aws/aws-sdk#746, where I saw you also commented. I can confirm that the Bedrock team is actively working on this issue and we should have more updates to share in the near future. Please refer to that issue for updates going forward. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
We are experiencing the same issue with the .NET SDK as well as directly using the Bedrock Console. Don't think it is a boto3 issue. We've reached to AWS and they have escalated this to their internal team. Looks like an issue on the Bedrock side. |
Facing the same issue with our setup. boto3 = 1.34 |
I'm also facing this same issue with the .Net SDK. I'm not sure if this helps, but when I'm requesting structured data (basically I tell it to return a list of ids as XML if it locates them in my knowledgebase), it never returns the source from the knowledgebase. If I don't, it typically does return the source. I'm wondering if the instruction of structured data, or the return of structured data is interfering with references being returned. |
Same issue here with boto3 1.35 The source was working fine when I was using default orchestration/KB response generation prompts. "attribution" was being returned by invoke_agent API. |
I am still facing this issue where for 1st response I got the citation but for another response I did not get any citation field. boto3==1.35.52 Is the issue fixed? |
Describe the bug
I have an Agent and a Knowledge Base set up in AWS Bedrock.
I'm trying to provide a citation link to the document in S3 that was used as part of RAG for a particular user query. The first response in the session has
retrievedReferences
that I can use to create this link. Any subsequent responses generated using RAG either have an empty array forretrievedReferences
or don't even have anattribution
field.Expected Behavior
When RAG is used by the agent and it's pulling information from the Knowledge Base. The
attribution
field should be in the response and theretrievedReferences
field should include the appropriate references rather than being an empty array.Current Behavior
The first time the Agent uses the Knowledge Base, it returns the citations to the S3 files correctly:
agent_response_with_retrieved_references.json
Subsequent responses from the Agent with the same session id are missing
attribution
field or have empty arrays forretrievedReferences
:agent_response_missing_retrieved_references.json
agent_response_missing_attribution.json
Reproduction Steps
Call the
invoke_agent
API with multiple questions that will hit the Knowledge Base in the same session.Possible Solution
No response
Additional Information/Context
It seems to always provide the
retrievedReferences
correctly for the first prompt that causes the Agent to use the Knowledge Base. After that it will sometimes return valid references inretrievedReferences
, sometimes empty arrays, and sometimes not even anattribution
field in the response, even though the trace forinvoke_agent
call shows that the Agent is performing RAG and using the Knowledge Base.In my Agent's Advanced prompts configuration, I have the Pre-processing template and Post-processing template turned off
SDK version used
boto3==1.34.61
Environment details (OS name and version, etc.)
AmazonLinux2
The text was updated successfully, but these errors were encountered: