2025/Voice AI advisor · B2B SaaS
AI4U: a real-time voice AI advisor with RAG and tool calling
A voice-first digital advisor that explains a B2B AI platform, guides visitors through the site and hands qualified leads to a human.
What our team built
Built the real-time voice pipeline, interruption handling, tool calling for in-page navigation, and a governed RAG layer over ~820 approved answers.
AI4U
Voice AI advisor · B2B SaaS
The brief
AI4U is a B2B platform for sovereign AI agents. Its voice-first advisor talks to website visitors, explains what the platform does, guides them to the right page, qualifies the lead and hands over to a person when it should. The hard parts were latency, interruptions and answering only from approved material.
A spoken conversation with an AI advisor depends on several real-time services working in sequence. The visitor's speech has to be recognised, a language model has to answer, the answer has to be turned into speech, and the avatar has to stay in sync with the audio. Delay at any step is noticeable in conversation, and visitors interrupt.
The advisor also speaks for the company to prospective customers, so it had to answer from approved material only. Our engineers built this at a previous employer.
Stack
- React 19
- LiveKit
- Deepgram
- Cartesia
- HeyGen
- pgvector
- AWS
What we built
- 01Low-latency speech recognition, streaming answers and text-to-speech
- 02Synchronised avatar playback and interruption (barge-in) handling
- 03Tool / function calling to navigate the site for the visitor
- 04RAG over ~820 curated Q&A entries, with output guardrails
- 05Invite-gated demo sessions, HttpOnly cookies and usage limits
- 06AWS deployment pipeline: CodePipeline, CodeDeploy, Amplify, Lambda, EC2
Scope note: Architecture and implemented workflows as delivered. No measured latency or conversion results are claimed.
Related service: AI agents & voice assistants
How the team approached it
A streaming voice pipeline
LiveKit carries the audio over WebRTC. Deepgram Flux transcribes the visitor's speech, the transcript goes to a language model through OpenRouter, and the model's answer streams back.
The answer is passed to Cartesia one sentence at a time, so the advisor can start speaking the first sentence while the rest is still being generated.
Avatar sync and interruptions
HeyGen LiveAvatar playback is synchronised with the speech audio. When a visitor talks over the advisor, barge-in handling cancels the speech in progress so the advisor can listen to the new question.
Answers from approved material
Answers are grounded in a governed knowledge base of approximately 820 approved question and answer entries, stored in PostgreSQL with pgvector embeddings. Retrieval finds the relevant entries for each question before the model answers.
Prompts are managed on the server, and output guardrails check responses before they reach the visitor.
Navigation, demo access and deployment
Tool calling lets the model trigger in-page navigation, so the advisor can take a visitor to the page it is talking about.
Demo sessions are invite-gated and use HttpOnly cookies and usage limits. The application is deployed on AWS through CodeCommit, CodePipeline and CodeDeploy, with Amplify, Lambda, and EC2 running under PM2.
Stack choices
- React 19 and TanStack Start
- Build the web application that hosts the advisor and the pages it navigates.
- LiveKit
- Carries real-time audio between the visitor's browser and the voice pipeline over WebRTC.
- Deepgram Flux
- Provides the speech recognition at the start of the pipeline.
- OpenRouter
- Streams responses from the language model and supports the tool calls used for navigation.
- Cartesia
- Turns each sentence of the answer into speech as it arrives.
- HeyGen LiveAvatar
- Plays the avatar in sync with the spoken answer.
- PostgreSQL and pgvector
- Store the approved knowledge base and its embeddings for retrieval.
- AWS
- CodeCommit, CodePipeline and CodeDeploy run the release pipeline, with Amplify, Lambda and EC2 hosting the parts of the application.