Decision Points
Decision points are moments in the plan where the agent must evaluate a condition and choose between two or more paths. Defining decision points explicitly makes agent behaviour predictable.
6 min•By Priygop Team•Updated 2026
Common Decision Points
- Success check: did the previous step succeed? If not, retry or escalate.
- Threshold check: is the value above or below a threshold? (e.g., refund amount > $100 → human approval)
- Existence check: does the resource exist? (e.g., does the customer record exist in the CRM?)
- Completeness check: has the agent gathered enough information to proceed?
- Step limit check: has the agent exceeded the maximum number of steps?
- Human approval check: has the human approved the proposed action?
Decision Point Implementation
Decision Point Implementation
# Explicit decision points in a plan
def evaluate_decision_point(dp_id: str, context: dict) -> str:
"""
Evaluate a named decision point and return the next step to take.
Returns the ID of the next step.
"""
if dp_id == "DP_CHECK_ELIGIBILITY":
amount = context.get("order_total", 0)
days_since_purchase = context.get("days_since_purchase", 999)
if days_since_purchase > 30:
return "STEP_REJECT" # Outside return window
elif amount >= 100:
return "STEP_HUMAN_APPROVAL" # Large refund needs review
else:
return "STEP_AUTO_REFUND" # Small refund auto-approved
elif dp_id == "DP_CHECK_SEARCH_RESULTS":
count = context.get("result_count", 0)
if count == 0:
return "STEP_WIDEN_SEARCH" # No results — try a broader query
elif count < 3:
return "STEP_SUPPLEMENTAL_SEARCH" # Few results — get more
else:
return "STEP_ANALYSE_RESULTS" # Enough results — proceed
elif dp_id == "DP_CHECK_STEP_LIMIT":
if context.get("step_count", 0) >= context.get("max_steps", 15):
return "STEP_ESCALATE"
return "CONTINUE"
return "STEP_ESCALATE" # Unknown decision point → escalate
# Test the decision point evaluator
context = {"order_total": 45.00, "days_since_purchase": 10}
next_step = evaluate_decision_point("DP_CHECK_ELIGIBILITY", context)
print(f"Next step: {next_step}") # STEP_AUTO_REFUNDKey Takeaways
- Decision points are moments in the plan where the agent must evaluate a condition and choose between two or more paths.
- Success check: did the previous step succeed? If not, retry or escalate.
- Threshold check: is the value above or below a threshold? (e.g., refund amount > $100 → human approval)
- Existence check: does the resource exist? (e.g., does the customer record exist in the CRM?)