Decide when a support agent may answer alone

Agent buildEasy10 minSalesforce and ServiceNow style

Your task

Your support team wants an agent that answers common tickets straight from the product docs before a person sees them. It may only send a reply it can ground in the docs, and some topics always go to a person.

Write route_support_ticket(ticket_text, retrieval_confidence, has_citation): the rule your agent follows for each ticket.

  • ticket_text (str): the customer's message.
  • retrieval_confidence (float, 0 to 1): how well the retrieved doc passages match the question.
  • has_citation (bool): the draft reply cites a doc passage.

It returns one of the values in the rules below. Apply them in order. The first one that matches decides:

  1. The ticket, lowercased, contains refund, security or legal anywhere, even inside a longer word: "escalate_sensitive".
  2. No citation: "escalate_no_citation".
  3. retrieval_confidence below 0.8: "escalate_low_confidence".
  4. Otherwise: "auto_reply".

Examples

route_support_ticket(ticket_text: str, retrieval_confidence: float, has_citation: bool) -> str
Example 1
Inputroute_support_ticket("How do I export a CSV report?", 0.93, True)
Output"auto_reply"
Example 2
Inputroute_support_ticket("I need a refund for last month", 0.95, True)
Output"escalate_sensitive"
Example 3
Inputroute_support_ticket("Where is the settings page?", 0.42, True)
Output"escalate_low_confidence"