- Newest
- Most votes
- Most comments
Hi,
Did you think about using only the retrieve verb of Bedrock KB and then build the prompt ( with the needed memory / content ) that you want ?
My article will show you how to separate both while being very close to what RetrieveAndGenerate does: https://repost.aws/articles/AR-LV1HoR_S0m-qy89wXwHmw/the-leverage-of-llm-system-prompt-by-knowledge-bases-for-bedrock-in-rag-workflows
Then, you would be using the message API of the LLM to craft the prompt exactly based on previous interactions in same discussion: see https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-anthropic-claude-messages.html
Best,
Didier
You say SessionId didn't work for you but I just want to get it on the board that it usually does work as advertised. I was misled by the answers here into thinking RetrieveAndGenerate didn't have a way to do this. From the docs:
sessionId The unique identifier of the session. When you first make a RetrieveAndGenerate request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the sessionId yourself.
Relevant content
- Accepted Answerasked 3 days ago
- asked 6 months ago
- asked 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated a year ago