1. Template Techniques
  2. Customer Verification by OTP

Template Techniques

Customer Verification by OTP

Explains how to verify a customer by generating and validating a one-time password within an agent workflow.

This is a common technique to implement on any templates requiring specific customer interactions.
The technique involves collecting an identifier from a customer (either customer identification, email address or mobile) then calling an action that runs an apicall task to initiate sending of an OTP.
The last part of the technique involves another action to verify the OTP once provided by the customer.

Detailed Structure

  • A default stub would typically start in a state such as "customer-verification-pending" with the AI Agent having a prompt that explains what customer identifier to ask for
  • There would be an AI enabled action called generate_customer_otp that has a field for the customer identifier
  • The field should be correctly named so as not to enable accidental customer identification fields to clash, so for example it should be called customer_email_to_verify instead of customer_email
  • The generate_customer_otp action would then have a apicall task to call a system API with the provided customer identifier
  • Once the customer receives the OTP and relays it to the AI agent, the agent would be able to run a second action available in the state
  • An action named something like verify_customer_otp would take a field like otp_to_verify and pass it into another apicall task
  • The action would have a to_state transition with a condition, the condition would be based off of the response from the apicall
  • If the apicall response was successful the state would transition into a state called something like "customer-support-in-progress"
  • If the apicall response was unsuccessful (i.e. OTP incorrect) the state would stay in the "customer-verification-pending" state and allow the agent to retry with the customer.