Edges

To move on from a Turn, the Block Agent will need to exit on an Edge. Edges evaluate where the conversation should go next- when certain conditions are met, the agent follows an Edge to the next Turn.

Each Turn is comprised of zero to many Edges.

Note: If a Turn has zero Edges, we can consider this Turn to be the terminus of the conversation.

 

Types of Edges

Block Agents support two types of Edges:

  • Edge

    • The standard type, recommended for most use cases.

    • This type of Edge evaluates Conditions and, when matched, transitions to the appropriate next Turn.

    • "type": "edge"

  • Loop

    • Use this type to re-prompt or retry when none of the Conditions are met.

    • This type of Edge keeps the conversation in the current turn while providing reprompt guidance.

    • "type": "loop"

Note: A Turn can only have one Edge with the “loop” type. This ensures that fallback behavior is clearly defined and does not cause multiple conflicting re-prompt scenarios.

 

NLU Edges

Your standard Edge can include Natural Language Understanding (NLU) configuration in the Condition. An NLU Edge uses natural language rather than structured data matching to evaluate the Edge. NLU is particularly useful for semantic intent detection. For example, our Edge configuration could include the NLU Condition “Once the user affirms this is the correct appointment." for evaluated by the LLM, which understands semantic equivalents like "yes", "that's right", "correct", or "yep, that's the one."

 

Edge Conditions

Every Edge will have one or more Conditions associated with it that tell the model whether or not it has been satisfied, and a Condition to either move to another Turn or a Block.

Block Agents move through each Edge in the order they are written and evaluate the Edge’s Conditions. As soon as an Edge’s Conditions are satisfied, the agent will follow that Edge, without evaluating any further Edges. This gives you, the builder, some control over situations where multiple Edge’s Conditions might be satisfied at once.

To handle problematic conversational event (e.g., asking an unrelated question, not giving a response, etc.), we recommend including a single looping Edge (i.e., “type”: “loop”) in most of your Turns as the final Edge.

 

Edge Operators

You can also include an Operator value in your Edge. Block Agents support two types of Edge Operators:

  • And

    • The default operation followed if you don't include an Operator value.

    • All elements of the “expected_value” object must be true in order for the Edge to be considered true.

    • "operator": "and"

  • Or

    • If any of the “expected_value” elements are true, then the Edge is considered true.

    • "operator": "or"

 

Edge Properties

Property

Description

edge_id

Identifier for the edge.

name

Descriptive label for the Edge.

type

Either edge (standard) or loop (fallback)

condition

The criteria for taking this Edge.

transition_prompt

Hint to help the LLM understand when to use this edge.

connect_to

The target turd_id. Use null for a terminating Edge.

messages

Predefined responses when this edge is taken.

reprompt

Instructions for retry behavior (used with a loop Edge).

kpis

Analytics data to publish when the Edge is traversed.

 

Sample Edge

A standard Edge might look like this:

- edge_id: '2'
   name: schedule_appointment_start
   type: edge
   condition:
	source: tools
	expected_value:
		schedule_appointment: true
	transition_prompt: Use this when the user wants to schedule an appointment or exam, including cleanings, consultations, and other procedures.
   connect_to:
	turn_id: '000010'  
   kpis:
	- kpi_name: Interaction:Intent
	  value:
		default: Schedule
		source: static
	  kpi_type: string

 

 

Next up, learn more about Block Agent Conditions.