← All examples
GroundedAnswer
examples/GroundedAnswer.intent
GroundedAnswer.intent
1mission GroundedAnswer2use product3use delivery45title "Answer a support question, grounded in retrieved documents, or escalate"6for SupportSeeker78goal9 Answer only what the retrieved documents support, and escalate the rest to a human.1011# The heart of an AI feature stated as intent: the model assists, but grounding, authorization,12# and escalation are DETERMINISTIC guardrails , not left to a prompt.13guarantee every answer is grounded in at least one retrieved document14 because an ungrounded answer is a confident guess, and confident guesses erode trust15 verify grounding test on retrievedCount1617guarantee a low-confidence question is escalated, never answered by guess18 because a wrong answer costs more than a slower one19 verify escalation-on-low-confidence test2021never present generated text as a cited fact when retrieval did not support it22 verify citation-grounding test23never return a document the requester is not authorized to see24 verify authorization test2526outcome SelfServeDeflection27 "more questions are answered well without a human, without lowering answer quality"2829metric deflection_rate30 baseline 41%31 target 65%32 window 30 days after release3334# What the system does with a drafted answer. The AI drafts; this decides.35# intent run GroundedAnswer.intent36# --inputs '{"retrievedCount":3,"confidence":88,"authorized":true}'37decision AnswerAction38 inputs39 retrievedCount40 confidence41 authorized42 rule noRetrieval43 when retrievedCount == 044 return Refuse45 rule unauthorized46 when authorized == false47 return Refuse48 rule lowConfidence49 when confidence < 7050 return Escalate51 default52 return Answer5354# The life of a question. Walk it: intent simulate GroundedAnswer.intent55# --events retrieve,draft,ground,answer56lifecycle AnswerFlow57 state Received58 state Retrieved59 state Drafted60 state Grounded61 state Answered62 state Escalated63 transition retrieve64 from Received65 to Retrieved66 transition draft67 from Retrieved68 to Drafted69 transition ground70 from Drafted71 to Grounded72 transition answer73 from Grounded74 to Answered75 transition escalate76 from Drafted77 to Escalated78 terminal Answered, Escalated7980# The commitment + the delivery result: intent outcomes GroundedAnswer.intent81outcome_contract AnswerDeflection82 outcome SelfServeDeflection83 metric deflection_rate84 baseline 41%85 target 65%86 window 30 days after release87 owner SupportLead8889result Q3Deflection90 measures SelfServeDeflection91 metric deflection_rate92 value 67%93 baseline 41%9495# The spec proves itself: intent test GroundedAnswer.intent96test AnswerAction97 case grounded and confident is answered98 given retrievedCount 3, confidence 88, authorized true99 expect Answer100 case no retrieval refuses101 given retrievedCount 0, confidence 90, authorized true102 expect Refuse103 case unauthorized refuses104 given retrievedCount 3, confidence 90, authorized false105 expect Refuse106 case low confidence escalates107 given retrievedCount 3, confidence 55, authorized true108 expect Escalate109110test AnswerFlow111 scenario grounded answer112 events retrieve, draft, ground, answer113 expect Answered114 valid115 scenario escalated from draft116 events retrieve, draft, escalate117 expect Escalated118 valid119 scenario cannot answer before grounding120 events retrieve, draft, answer121 invalidDraft syntax. This file is illustrative and does not run yet.
More examples
AlertRoutingApiGatewayBillingServiceCalculateRiskScoreCertificationAttemptCertificationCheckoutCertificationEligibilityCertificationStudyPlanCreateInvoiceCreateStudyPlanCustomerDataRequestDuplicateInvoicePreventionIngestClickstreamInvoiceCreatedNetworkEgressPolicyPlaceOrderResearchAgentRunResetPasswordStorefrontStyleSubscriptionUpgradeTenantIsolationUploadStudyMaterial