AI receptionist or answering service? Write the hand-off rules first
DEV Community

AI receptionist or answering service? Write the hand-off rules first

When a small business asks us whether to use an AI receptionist or a human answering service, the honest answer is usually "both, with clear rules about who takes which call".

The AI handles hours, prices and bookings. People take the upset caller, the emergency and the call that doesn't fit a script. The part that decides whether that setup works isn't the voice model. It's the hand-off logic.

If the rules are vague, the AI keeps trying to help someone who needs a person, and the business decides "AI doesn't work". This post shows how we write those rules as plain, testable code before wiring them into any voice platform.

The call mix comes first

Before writing a rule, sort 20 to 30 recent calls into four buckets:

  • Routine: opening hours, location, "do you do X", prices that are published.
  • Booking: new appointments, changes, cancellations.
  • Urgent: a burst pipe, a locked-out tenant, a same-day medical question.
  • Sensitive: complaints, billing disputes, anything legal, medical or financial.

The first two buckets are where an AI receptionist earns its keep. The last two should reach a person quickly. Your routing rules are just this sorting, written down.

Rules as data, not prompt text

It's tempting to put "transfer the caller if they're upset" in the system prompt and hope. That's hard to test and easy to break with the next prompt edit.

Instead, keep the decision in a small function that the voice agent calls on every turn (most platforms support a tool or function call for this).

from dataclasses import dataclass, field

URGENT_WORDS = {"emergency", "flood", "leak", "fire", "locked out", "urgent"}
SENSITIVE_WORDS = {"complaint", "refund", "lawyer", "solicitor", "dispute", "chargeback"}

@dataclass
class CallState:
    transcript: list[str] = field(default_factory=list)
    failed_understandings: int = 0
    asked_for_human: bool = False
    after_hours: bool = False

def route(state: CallState) -> str:
    """Return 'ai', 'human_now' or 'callback'."""
    last = state.transcript[-1].lower() if state.transcript else ""
    if state.asked_for_human:
        return "callback" if state.after_hours else "human_now"
    if any(w in last for w in URGENT_WORDS):
        return "human_now" # urgent beats office hours
    if any(w in last for w in SENSITIVE_WORDS):
        return "callback" if state.after_hours else "human_now"
    if state.failed_understandings >= 2:
        return "callback" if state.after_hours else "human_now"
    return "ai"

Keyword lists look crude, and they are. That's the point: a business owner can read them, add "boiler" in winter, and see exactly why a call was transferred. You can layer an LLM classifier on top later, but keep a rule like this as the floor.

Test the rules like any other code

Because the routing is a pure function, you can test it with real (anonymised) lines from your call log:

def test_routing():
    assert route(CallState(["What time do you open on Saturday?"])) == "ai"
    assert route(CallState(["There's a leak coming through the ceiling"])) == "human_now"
    assert route(CallState(["I want to make a complaint"], after_hours=True)) == "callback"
    assert route(CallState(["sorry?"], failed_understandings=2)) == "human_now"
    assert route(CallState([], asked_for_human=True)) == "human_now"

test_routing()
print("routing rules OK")

Every time someone says "the AI should have passed that call on", add the line as a test case and fix the rule. After a few weeks you have a test suite that describes how the business wants its phone answered.

Where the human side plugs in

human_now means a live transfer: to the owner's mobile, the front desk, or a human answering service. callback means the agent takes a structured message (name, number, reason, urgency) and posts it somewhere someone will see it: a shared inbox, a CRM task, a Slack channel.

Two things to test before launch:

  • The transfer actually connects. Call it from a mobile on a weak signal, during business hours and after them.
  • The message reaches a person. A callback queue nobody checks is worse than voicemail.

Tell callers it's an AI

Say so at the start: "You're speaking with the virtual assistant for Smith Plumbing. I can book visits and answer questions, or put you through to the team."

It sets expectations, makes "can I speak to a person?" a normal request, and keeps you on the right side of rules that are tightening in several markets. If the agent will ever make outbound calls in the US, note that the FCC ruled in February 2024 that AI-generated voices in robocalls fall under the TCPA.

When to use which

  • Mostly routine calls, lots of them, after-hours gaps: AI first, people for the exceptions.
  • Mostly sensitive or high-stakes calls: a human answering service, maybe with AI only for overflow.
  • Somewhere in between: people in business hours, AI after hours and at peaks, with rules like the ones above.

The full comparison, including published vendor prices for AI receptionists and human answering services, is in the guide this post is based on. If you need a voice agent that books into your own systems and follows your hand-off rules, that's the kind of AI voice agent development work we do at Dzimark.

FAQ

Can an AI receptionist transfer a call to a human? Yes. Most platforms support a transfer to a phone number or SIP endpoint. The hard part is deciding when, which is what the rules above are for.

Should the routing be done by the LLM itself? You can use an LLM classifier as an extra signal, but keep a simple, readable rule set as the floor so the owner can see and change the behaviour.

What's a sensible trigger for "the AI isn't coping"? Two failed understandings in a row is a common starting point. Tune it from real call reviews.

Originally published on the Dzimark blog.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.