Skip to content

About

Let callers type hard-to-say values mid-call: an Agentforce Voice agent texts a one-field form link

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Typeback

Voice agents struggle with values that are hard to say or to transcribe, such as email addresses, name spellings and booking codes. Typeback lets the caller type them instead. Mid-call, the agent texts the caller a link to a one-field form. The caller types the value on their phone and says "done". The agent picks it up on that turn and carries on with the same call. The agent's language model never sees the full value, only a masked hint such as "starting with c, at example dot com".

Status: proof of concept. The whole loop passes on a live phone call from a mobile. The link isn't texted yet: the org couldn't send SMS, so for now it reaches the phone by hand. Not released and not supported.

Build it

Follow docs/implementation-guide.md. It has every step in the order that works, each one tagged by whether a person or an AI agent can do it, and the fix for every problem we hit. docs/build-log.md is the day-by-day story.

You need:

  • A Salesforce org with Agentforce, Agentforce Voice (with a way to get a phone number), a free Einstein Agent User license and Digital Experiences
  • Salesforce CLI 2.152 or later, Node.js and jq
  • A mobile phone for the test calls

In short, after logging the CLI in to your org as typeback and copying .env.local.example to .env.local:

scripts/recon.sh           # read-only look at the org
scripts/setup.sh core      # deploy the object, Apex and permission sets; run the tests
scripts/setup.sh site      # create and publish the guest site; put the printed SITE_URL in .env.local
scripts/configure.sh Log   # write the settings
scripts/setup.sh agent     # set up the agent user; validate, publish and activate the agent
scripts/preview-loop.sh    # run the whole loop in a CLI preview

Between these come manual steps in Setup: activating the site, placing the form, and getting and routing a phone number. The guide covers each one.

What's here

Path What it is
docs/implementation-guide.md How to rebuild Typeback in your own org, step by step.
docs/build-log.md What happened, day by day.
force-app-agent/.../TypebackDemoVoice/ The demo voice agent, in Agent Script: a resort concierge that texts the caller a link instead of asking them to spell their email. This is the default package directory because sf agent publish authoring-bundle only looks for bundles there.
force-app/.../objects/ Typeback_Request__c, one row per link, and Typeback_Settings__c, a hierarchy custom setting.
force-app/.../classes/ The two agent actions (TypebackRequestAction, TypebackCheckAction), the guest form's controller (TypebackFormController), helpers (TypebackService, TypebackSms, TypebackCallerLookup) and their tests.
force-app/.../lwc/typebackForm/ The one-field form that the caller opens from the link.
force-app/.../permissionsets/ Typeback_Agent for the agent user (no access to the typed value), Typeback_Guest for the site guest user and Typeback_Admin for you.
force-app/.../Typeback_Egress_Check A remote site setting, used only by the optional Twilio egress check.
scripts/setup.sh Org setup in steps: core, site, agent, egress. Each step is safe to re-run.
scripts/setup-agent-user.js Creates or reuses the agent's Einstein Agent User and writes it into the .agent file.
scripts/configure.sh Writes the Typeback settings (sender, link lifetime, site URL). No secrets. Only the Log sender exists so far.
scripts/recon.sh A read-only look at the org. Copies its agents and routing flows into org-reference/, which is gitignored.
scripts/report.sh Recent Typeback requests and calls. Never reads the typed value.
scripts/new-link.sh Makes one form link with the Log sender and prints it, so you can test the form on a phone. Nothing is texted.
scripts/preview-loop.sh Runs the whole loop in a CLI preview of the agent and checks each reply. Nothing is texted.
scripts/link.sh During a live call, prints the link the agent just made (Log sender only), so you can open it on your phone by hand.
scripts/twilio-smoke.sh Sends one test SMS through Twilio from your own terminal. Not needed for the rest.
scripts/apex/egress-check.apex Checks that the org can reach the Twilio API.

Results

From one live call, timed from the call record's start, with the link opened on the phone by hand:

Agent accepts the call 5 s
Link made, after the greeting and the ask 21 s
Form sent 59 s
Agent reads back the masked hint 62 s, 3 s after the form was sent
Call ends 84 s

A baseline with the email spelled out hasn't been timed yet, so there's no comparison so far. "Not done yet" in the guide lists what else is untested.

Secrets

  • .env.local holds IDs and phone numbers, never secrets. It's gitignored.
  • An SMS provider's secret never goes in the repo. For Twilio it's typed only at the hidden prompt in scripts/twilio-smoke.sh or, once a Twilio sender exists, into an external credential in Setup.
  • scripts/setup-agent-user.js writes your org's agent username into TypebackDemoVoice.agent. Before you commit, put the placeholder back:
    node scripts/setup-agent-user.js --username __AGENT_USER_PLACEHOLDER__

License

Apache License 2.0. scripts/setup-agent-user.js is adapted from agent-script-recipes, also under Apache 2.0.

About

Let callers type hard-to-say values mid-call: an Agentforce Voice agent texts a one-field form link

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages