The company is building a chatbot using an LLM on Amazon Bedrock, and the chatbot needs to use content from previous customer messages to resolve requests. Adding previous messages to the model prompt (also known as providing conversation history) enables the LLM to maintain context across interactions, allowing it to respond coherently based on the ongoing conversation.
Exact Extract from AWS AI Documents:
From the AWS Bedrock User Guide:
"To enable a large language model (LLM) to maintain context in a conversation, you can include previous messages in the model prompt. This approach, often referred to as providing conversation history, allows the LLM to generate responses that are contextually relevant toprior interactions."
(Source: AWS Bedrock User Guide, Building Conversational Applications)
Detailed Explanation:
Option A: Turn on model invocation logging to collect messages.Model invocation logging records interactions for auditing or debugging but does not provide the LLM with access to previous messages during inference to maintain conversation context.
Option B: Add messages to the model prompt.This is the correct answer. Including previous messages in the prompt gives the LLM the conversation history it needs to respond appropriately, a common practice for chatbots on Amazon Bedrock.
Option C: Use Amazon Personalize to save conversation history.Amazon Personalize is for building recommendation systems, not for managing conversation history in a chatbot. This option is irrelevant.
Option D: Use Provisioned Throughput for the LLM.Provisioned Throughput in Amazon Bedrock ensures consistent performance for model inference but does not address the need to use previous messages in the conversation.
[References:, AWS Bedrock User Guide: Building Conversational Applications (https://docs.aws.amazon.com/bedrock/latest/userguide/conversational-apps.html), AWS AI Practitioner Learning Path: Module on Generative AI and Chatbots, Amazon Bedrock Developer Guide: Managing Conversation Context (https://aws.amazon.com/bedrock/), , , ]