Skip to content

How to modify or disable the fall back message of the bedrock agent.

0

When I have configured my knowledge base to my bedrock agent, I want it to answer only based on the knowledge base. If the information is not present in the knowledge base then it should give a default answer instead of answering from it's own knowledge

asked a year ago445 views

2 Answers
6

How about this:

  1. Use Advanced Prompt Templates Customize the agent’s behavior by editing the orchestration prompt: • Instruct the agent to only respond using knowledge base content • Add a fallback message like: "If no relevant information is found in the knowledge base, respond with: 'I'm sorry, I don't have information on that topic.'" You can do this via the Advanced Prompts feature.

  2. Disable Default Model Knowledge To prevent the agent from using its own model knowledge: • Ensure the agent is in Focus Mode • Use only one knowledge base • Avoid enabling user input outside the KB context • Do not include action groups unless necessary This setup ensures the agent relies solely on the KB and not its general model knowledge.

  3. Customize Fallback Behavior in Orchestration Strategy You can define fallback behavior in the orchestration strategy: • Set a condition: If KB returns no results → trigger fallback response • This can be done by modifying the orchestration flow or using session state attributes to track KB hits

https://docs.aws.amazon.com/bedrock/latest/userguide/agents-customize.html

EXPERT

answered a year ago

0

Hello,

Thank you for your query regarding the customization of your Bedrock agent's response behavior. I understand you want to ensure the agent only responds based on your configured knowledge base and provides a controlled fallback message when information isn't found. Please correct me if I have misunderstood any aspect of your requirement.

Here are the detailed steps to help you achieve this:

  1. Use Advanced Prompt Templates

    • You can precisely customize your agent's behavior by editing the orchestration prompt
    • This allows you to:
      • Instruct the agent to strictly respond using knowledge base content only
      • Define a specific fallback message (e.g., "I apologize, but I don't have information about that topic in my knowledge base.")
    • These modifications can be implemented through the Advanced Prompts feature in your agent configuration
  2. Disable Default Model Knowledge For ensuring the agent strictly adheres to your knowledge base:

    • Enable Focus Mode on your agent
    • Configure with a single knowledge base
    • Avoid enabling user input outside the knowledge base context
    • Keep action groups minimal unless specifically required
  3. Customize Fallback Behavior Within the orchestration strategy, you can:

    • Set specific conditions for fallback responses
    • Configure the system to trigger your custom fallback message when no knowledge base results are found
    • Implement this through orchestration flow modifications or by utilizing session state attributes

These solutions should give you full control over your agent's responses while maintaining a professional interaction with your users.

Is there anything specific about any of these approaches you'd like me to elaborate on?

Have an AWSome day!

References [1] https://docs.aws.amazon.com/bedrock/latest/userguide/agents-customize.html

AWS

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.