跳至內容

Using SessionId with Bedrock knowledgebase

0

Hi All,

To carry on with the context of the conversation, I am using the sessionID returned in the response of first retrieve_and_generate call and sending the further questions alongwith this sessionID. But whenever I ask to 'further elaborate on the previous answer', it always responds to the first question I have asked instead of responding to the current question which I had asked. Eg, Q1 - Who is a CS? A1 - CS stands for company secretary Q2 - How to become a CS? A2 - To become a CS, we have to do abc things. Q3 - Can you further elaborate on the previous answer A3 - CS stands for company secretary who are appointed by institute of company secretary of India.

In Q3, it has responded to Q1 instead of elaborating on Q2. What am I doing wrong?

已提問 2 年前檢視次數 2328 次

1 個回答
2

Hi,

I'd suggest to start by tracing your activity with Bedrock KB in the way it is described in my article: https://repost.aws/articles/AR-LV1HoR_S0m-qy89wXwHmw/the-leverage-of-llm-system-prompt-by-knowledge-bases-for-bedrock-in-rag-workflows

This way you will if the Message API for invocation contains the history of previous prompts in the discussion or not: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-anthropic-claude-messages.html (I supposed that you use Anthropic's Claude messages)

Best,

Didier

專家

已回答 2 年前

專家

已審閱 2 年前

  • Ok, what I have understood looking at invocation logs is that - If you ask "Please elaborate on above answer", the system will look into the chat history and pickup a question randomly from the past questions IF it is doesn't have any more information to elaborate on the previous answer. This is a very very weird behaviour where in, it should have responded that there is nothing more to elaborate.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。