Connecting nodes and defining conversational paths
Edges connect nodes, defining the possible paths a conversation can take through your Agent Graph. They determine the flow logic and create structured conversational experiences.
A powerful feature of edges is the ability to add conditions, allowing for dynamic conversation paths based on context:
Natural Language Conditions: Write conditions in plain English that the agent will interpret.
Context Awareness: Conditions are evaluated based on the current conversation state, including user inputs and any variables.
Multiple Paths: When a node has multiple outgoing edges, the agent evaluates the condition associated with each edge after executing the source node’s logic.
Path Selection: The agent will follow the outgoing edge whose condition evaluates to true.
By combining nodes and conditional edges, you can build sophisticated conversation flows that adapt to user inputs and context. Consider these patterns:
Decision Trees: Use conditional edges to create branching paths based on user choices
Information Collection: Route through different nodes to gather specific information
Error Handling: Create paths for handling misunderstandings or invalid inputs
Context Switching: Allow users to change topics with edges that detect new intents