HCC Docs

What a rep is told

When an AI agent hands a caller to a rep, the desk shows a summary of what happened on the offer, the call and the wrap-up. It works with any flow style, and needs no code on a platform that reports one, such as ElevenLabs. A report usually comes a few seconds after the handoff, so the rep may already have the call. The desk fills in when it does.

A SIP agent has no report, so a summary comes from your code, and yours beats the platform's on any agent:

yield * c.transfer(queue(sales, { aiSummary: data.summary })); // from handoff('human', data), say
await hcc.calls.setAiSummary(callId, 'Wants to renew, asked about pricing.'); // from the answer on

To change or withhold it:

defineCallFlow(
  'support',
  { onAgentSummary: ({ text }) => redact(text) }, // or null, for nothing
  function* (c) {
    yield* c.connect(agent('agt_support'));
    yield* c.transfer(queue(sales, { aiSummary: false })); // reps aren't told anything of the agent
  },
);
  • What you withhold never reaches the rep's browser. onAgentSummary runs before anything goes to the desk.
  • If the hook fails or returns anything but a string, the rep sees nothing and the call goes ahead. It doesn't hold the call up: the rep can have the call while it runs, and its answer fills in.
  • On a campaign with a .screenPop, a summary shows only through onAgentSummary, on the campaign or its flow. That campaign has chosen what reps see, and the summary can repeat what it left out.
  • Between sessions, the one started last wins. false on a target also keeps later reports off the desk; your own text still shows.
  • Too early. setAiSummary on a flow's outbound call that isn't answered yet is refused (409 conflict): there's nothing to keep it on. Try again after the answer, or put aiSummary on the transfer.
  • It's cut to 2 KB, and a warm transfer carries it to the next rep. A rep who handed the call on hears nothing more of it.
  • Events: call.ai_summary.set has source (agent or customer), withheld and, unless withheld, text. A report that arrives before the aiSummary: false step has already been published with its text.
  • In tests: testCall(flow).agentSummary(text) returns what the rep would be told, and call.agent.report(summary, { startedAt }) on a simulated call sends a report as a platform would, before or after the handoff.