Most of my engineering time now goes into an AI receptionist, a product that answers a small business's phone. I co-founded AI-Receptionist.com with Alex, and the two of us build and run it: a Java back end, a Vue front end and a lot of telephony. People mostly ask how it works, so this is the path of one call.
The call reaches the server
A business either gets a phone number from us or forwards its existing number to one. When someone calls, the carrier hands the call to our telephony provider, which opens a media stream: a WebSocket that carries the caller's audio to our server in small chunks and carries audio back.
Before the first word is spoken, the server builds the session for this account. It loads the greeting, the owner's written instructions, the knowledge base, the contacts who can receive transfers and texts, the calendar connection and the plan limits. The caller becomes a temporary contact too, which is what later lets the AI text them.
A speech-to-speech model holds the conversation
The audio goes to a realtime speech-to-speech model over a second WebSocket. It listens, decides when the caller has finished, and answers in a voice the owner picked. There is no separate speech-to-text and text-to-speech step on our server, and that is most of why the conversation does not lag.
Latency is the constraint behind every design decision. A pause of more than a second or two sounds like a dropped call, so anything the model needs during the call has to come back fast.
Tools do the actual work
The model on its own can only talk. Everything else is a tool call that our server executes and returns:
- look something up in the owner's knowledge base
- check free times and book an appointment in Google Calendar
- transfer the call to the owner or a staff member, either directly or as a warm transfer where the owner gets a text first and decides
- text the caller a confirmation, an address or a link while they are still on the line
- take a message
- switch to another language when the caller does
- read a photo the caller texts in, such as a leaking pipe
- end the call
Each tool is limited by the plan and by the account's settings. The SMS tool, for example, can only text numbers on a whitelist built at call start, which holds the owner's contacts and the caller.
After the caller hangs up
When the call ends, the transcript and a summary go to the dashboard and the owner's notifications. Then a second agent runs: the post-call agent. It reads the transcript and follows the owner's post-call instructions, such as texting the owner about a new lead, adding a row to a Google Sheet or posting a summary in Slack through Zapier.
The post-call agent deliberately does not get the caller as a contact. It can text the owner and staff, but never the caller, because it sees more of the account's data and runs actions in other apps, and a mistake there should never reach a customer. Connected apps such as Zapier are available only to the post-call agent and the dashboard assistant, never during the live call.
What still goes wrong
Most bad calls are not model failures. They are missing facts and conflicting instructions: the knowledge base has no answer for the question, or one instruction says "never quote prices" and another lists them. The receptionist now records those as issues on the account, and an assistant in the dashboard reads the calls and proposes the fix.
The model is the part people ask about, and it is the part we wrote the least of. The work is in the session setup, the tools and their limits, and in what happens after the call. If you are comparing products rather than building one, we wrote up ten AI answering services side by side, ours included.
No comments:
Post a Comment