Skip to content

How to keep context from a voice call to WhatsApp, and back

Your customer hangs up and messages you on WhatsApp. What the agent needs to know, how context crosses vendors and how to measure the channel handoff.

Niadra team

Channels7 min read

To keep context when a conversation moves from your voice agent to your WhatsApp agent, the call has to go into a shared memory while it happens, outside the voice vendor. When the call ends, what was handled and every promise become facts with a channel and a time. When the customer writes, the system recognizes them as the person who called, and the WhatsApp agent receives those facts before it replies, in chat format. The reverse path uses the same memory, with a short, speakable context for the voice agent.

What gets lost when the customer leaves the call for WhatsApp?

At 2:07 pm, Marina called, and the voice agent from vendor B rebooked the technician visit as a priority for tomorrow, between 8 am and noon. It also agreed that the technician's arrival notice would go out on WhatsApp, 30 minutes ahead. At 6:30 pm, she writes on WhatsApp, where the agent from vendor A answers: "What time is the technician coming tomorrow?" Without a shared memory, three things get lost:

  • The identifier. The voice channel knows the number that called. WhatsApp knows the number of whoever is writing, or a business-scoped ID (identity across channels).
  • The transcript. It stays on the voice vendor's platform, out of vendor A's reach.
  • The promise. The WhatsApp agent knows nothing about the rebooked visit and may offer a different time.

Telephony has a standard for passing a small piece of data along with a call, SIP's User-to-User header (RFC 7433). That data travels inside the call and never reaches a WhatsApp conversation.

What needs to happen when the call ends?

The handoff starts before Marina hangs up. After every reply, the voice agent records what she said and its own answer in a memory outside vendor B. When the call ends, specialized models process the whole conversation. The 2:07 pm call yields items like these:

  • Outcome: visit rebooked as a priority for tomorrow, Sep 23, between 8 am and noon.
  • Promise: arrival notice on WhatsApp, 30 minutes ahead.
  • Promise: a US$ 40 credit on the next bill, for today's missed visit.

Every item keeps the channel, the time and the conversation it came from. None goes in without something said on the call to back it up.

Two failures show up at this stage. Phone audio is narrowband, and the transcript can get a time wrong. The WhatsApp agent cites "the 2:07 pm call," which lets the customer correct anything that came out wrong. The call may also fail to reach the memory in full. To catch that, compare the calls your voice vendor handled each day with the voice conversations in the memory.

How do you know the person on WhatsApp is the one who called?

At 6:30 pm, the message arrives with Marina's number, already linked to her profile. On WhatsApp, that depends on a platform rule. If a user has turned on a username, the webhook leaves out their phone number, unless that business phone number has exchanged messages or calls with them in the last 30 days, or they are in the business's contact book (Meta's documentation). Marina wrote at 2:02 pm, so her number comes through. The 2:07 pm call went over the phone network and does not count.

Recognizing is not confirming. The conversation starts at level 1: the source is linked to the customer, but nothing has proven who is typing. The company's policy releases the visit time and holds back the bill and the credit. If Marina asks about the credit, the agent sends a code over WhatsApp. Once she confirms it, the agent requests the context again, now with the credit. If the message arrives with an ID and no phone number, the context starts empty until evidence links that ID to her profile.

What does the WhatsApp agent receive, and in what format?

The context is tailored to the channel. In chat, it carries dates, time windows and the source of every line:

Context line Source
Marina Souza. Call her "Marina".
Visit rebooked: tomorrow, Sep 23, between 8 am and noon. Phone 2:07 pm
Arrival notice on WhatsApp, 30 minutes ahead. Phone 2:07 pm
2 items held back until identity is confirmed.
"What time is the technician coming tomorrow?" WhatsApp 6:30 pm

The agent answers without a single question: "Good evening, Marina. Your visit is set for tomorrow, between 8 am and noon, as agreed on the 2:07 pm call. You'll get the arrival notice right here, 30 minutes ahead."

On the reverse path, the same memory becomes a voice context: short, no tables, in sentences the agent says out loud, and cheaper per message (token costs). If Marina calls tomorrow morning, the voice agent gets: "Visit today, between eight and noon. The arrival notice goes out on WhatsApp."

# 2:07 pm, voice agent from vendor B: every reply goes into the memory
niadra.track(conversation=call_id, channel="voice", turns=[question, reply])

# 6:30 pm, WhatsApp agent from vendor A: the context in chat format
ctx = niadra.context(phone=sender_phone, channel="whatsapp")

# the customer asks for the reference number read out on the call: the agent searches the history
hits = niadra.search("reference number from today's call", customer=ctx.customer)

# after replying: the WhatsApp conversation goes into the memory too
niadra.track(conversation=thread_id, channel="whatsapp", turns=[question, reply])

The reference number from the call stayed out of the context, in the history, and search finds it when she asks.

How much time can pass between the call and the message?

Each gap calls for something different:

  • Seconds. Marina hangs up and writes right away. The last lines of the call already show up in the context, in the "just now" layer, with channel and time, while the models finish processing the conversation.
  • Hours. That is the 6:30 pm case. The visit and the notice already appear as open items.
  • Days. The context shows the latest state of each open item, and the call stays in the history.

On WhatsApp, the person's last message or call opens a 24-hour customer service window. Once the window closes, the business needs a pre-approved template message to reach out (Meta's documentation). A call over the phone network does not open this window. Tomorrow morning's notice can go out as a free-form message, because Marina wrote at 6:30 pm. If the visit were three days away, the notice would need an approved template.

How do you test and measure a channel handoff?

Before going live, run this test:

  1. Call the voice agent from a test number and close a case with a promise.
  2. Hang up and write on WhatsApp from the same number, right away and hours later.
  3. Check that the WhatsApp agent cites the call and promise without asking for a name or reason.
  4. Repeat from a WhatsApp account with a username that has never messaged the business: nothing from the call shows up before confirmation.
  5. Run the reverse path: write first, then call.

In production, measure per customer, across channels: the 6:30 pm message is a first contact on WhatsApp and a repeat contact for the call. In SQM Group's call center benchmark, 29% of customers have to call back about the same issue, and checking on an unresolved issue is a common cause. Three metrics matter:

  • Repeat contact: did the customer come back for the same reason, on any channel?
  • Repeated question: did the agent ask for something the context already had?
  • Time to resolution: from first contact to outcome.

How Niadra handles it

Niadra is the shared memory for a company's AI agents, across every channel and vendor. Each agent gets three calls, and no vendor needs an integration with another.

  • track() sends every reply to the memory without delaying the agent. When the conversation ends, specialized models extract what was handled, the outcome, the open items and the promises.
  • context() recognizes the customer by phone, email, tax ID or app login, with a confidence level. In under 100 ms, it delivers the context in the channel's format, with the source of every fact.
  • search() opens the entire history, with any LLM, through the SDK, the HTTP API or as an MCP tool.

Sensitive data waits for confirmation and is masked before it reaches any model. Niadra is fully managed, and your team connects the SDK, in Python and TypeScript (Products).

Frequently asked questions

Do I need to integrate my voice vendor with my WhatsApp vendor?

No. Each agent connects to the same memory with three calls, and no vendor reads the other's system. The WhatsApp agent receives the context that came out of the call.

Does a phone call open the WhatsApp 24-hour window?

No. According to Meta's documentation, the window opens when the person sends a message or calls through WhatsApp itself. Outside the window, the business needs a pre-approved template message to write first.

How do I know the handoff from voice to WhatsApp works?

Measure per customer, across channels: repeat contacts for the same reason, repeated questions and time to resolution. Before going live, call from a test number, hang up and write on WhatsApp from the same number. The agent has to answer without asking about anything the call already settled.

The next agent can already show up knowing.

Tell us what you are building. The people who reply are the people who write the code.