I'm working on a chatbot using Amazon Bedrock that responds to queries about our products based on our documentation. I'm using the Java SDK and the RetrieveAndGenerate functionality. I'm curious if there's a way to fetch conversation history using the session ID. I've looked through the documentation but couldn't find anything. Has anyone else tackled this issue?
3 Answers
Hey! I was wondering about how accurate your chatbot is. Are you doing anything specific to check its accuracy for individual conversations?
1. When you add data, make sure to include the metadata as the session ID and use that in your retrieval filters.
2. You might want to treat each session as a single chunk in your chunking strategy.
3. I suggest steering clear of the Bedrock agent; it doesn't offer much and operates mainly in a basic mode.
You might want to create an agent and connect it to your knowledge base. Then switch your API call from RetrieveAndGenerate to InvokeInlineAgent. This way, you can work with the sessionId parameter directly. Don’t forget to enable memory in the Agent Builder, too!
Thanks for the tip! I’m a bit hesitant to use Bedrock’s agent since it doesn’t support the Claude Sonnet 4 model I want to use, but I’ll consider it for the earlier models.