Skip to content

Multi-turn conversation with an agent node for Amazon Bedrock Flows

0

Hello everyone, I read about the new feature here: https://aws.amazon.com/blogs/machine-learning/introducing-multi-turn-conversation-with-an-agent-node-for-amazon-bedrock-flows-preview/ which gives us the opportunity to create a multi turn conversation in flows with agent nodes. I have created the following: flow with multi turn agent Initially, I have a prompt to classify the user's question. If Condition A is met, I want to handover the conversation to an Agent Node, which will engage in a dialogue to gather all the necessary information. If Condition B is met, the flow should direct the user to a prompt that provides assistance. Similarly, if Condition C is met, another specific prompt should be triggered. Finally, if none of the conditions are met, the flow should redirect the conversation to a fallback prompt, which restarts the dialogue by asking a simple question. Issue: Agent Interruption by Condition Node When Condition A is met, the Agent Node starts the conversation and asks relevant questions. However, I have noticed that when the user responds, their new message is sent back to the classifier prompt, which then re-evaluates the conditions. This can cause an issue where the user's response triggers a different condition (B, C, or fallback), interrupting the Agent Node's ongoing dialogue. As a result, the agent stops responding, and the conversation does not progress as expected. Questions Does the user's next response pass through the classifier prompt and condition node again? Is this flow structure efficient for a call center AI, or should I create a more customized approach? I know this is a new feature. however I would like to know about it and if I can use it. Thanks in advance.

asked 2 years ago878 views

1 Answer
0

You're correct that this is a new feature for Amazon Bedrock Flows, and your understanding of the multi-turn conversation capability with agent nodes is accurate. However, the issue you're experiencing with the agent conversation being interrupted is due to the flow structure you've created.

In your current flow, each user response is indeed being sent back through the classifier prompt and condition node. This is why you're seeing the agent's conversation potentially interrupted when a user response triggers a different condition.

For a call center AI or similar application where you want to maintain a continuous conversation with an agent, this flow structure is not ideal. Instead, you should consider a more customized approach that allows the agent node to maintain control of the conversation once it's initiated.

Here's a suggested approach to improve your flow:

  1. Keep your initial classifier prompt and condition node.

  2. When Condition A is met (triggering the agent conversation), create a separate branch of the flow dedicated to the agent interaction.

  3. In this agent branch, use a loop or recursive structure that allows the agent to continue the conversation without going back through the classifier each time.

  4. Implement a mechanism within the agent conversation to determine when the interaction is complete. This could be based on the agent gathering all necessary information or the user indicating they're done.

  5. Only after the agent conversation is complete should the flow return to the main branch or end.

For Conditions B and C, you can keep your current structure of directing to specific prompts.

This approach will allow the agent to maintain an uninterrupted multi-turn conversation when needed, while still providing the flexibility to handle other types of inquiries with different prompts.

Remember, as this is a preview feature, its capabilities and best practices may evolve. It's a good idea to keep an eye on AWS documentation and updates for any changes or improvements to the multi-turn conversation feature in Amazon Bedrock Flows.
Sources
Introducing multi-turn conversation with an agent node for Amazon Bedrock Flows (preview) | AWS Machine Learning Blog
Converse with an Amazon Bedrock flow - Amazon Bedrock
Node types in flow - Amazon Bedrock

answered 2 years ago

EXPERT

reviewed 2 years ago

  • In a multi turn conversation how do I know that the agent will continue the conversation or he will terminate it? Can I adjust that in order to complete the conversation when I desire?

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.