November 26, 2026 · 12 min · api · support · engineering
.mdAvatar answers only from company data: RAG through tool calling
Make a live avatar answer only from your data: hosted knowledge bases (Tavus, Anam, D-ID, LiveAvatar) vs your own search as a tool, with code and price rules.
There are two ways to make a live avatar answer only from your data. You can hand your content to the vendor to host (Tavus, Anam and D-ID take uploaded documents; HeyGen LiveAvatar's FULL mode takes a prompt plus links to FAQ pages, as of November 2026), or you can keep your own search index and call it as a tool mid-conversation. Realtime Avatar has no hosted knowledge base, no document upload and no hosted tool runner: your search runs in your page or on your server, you hand the passages to the character for that one reply with an instruction to answer only from them, and your instructions tell her to say so and offer your handoff when nothing comes back. Exact strings such as prices should not depend on the model at all: show them on screen from your database, or speak them through the verbatim path, which on Realtime Avatar ends the call.
- Keep your index and search API on your own infrastructure. Return the top three short passages, and an explicit found: false when nothing matches.
- Put the persona and the grounding rules in the instructions your server sets when it mints the call: answer only from returned passages, never state a number that is not in one, and say plainly when nothing is found.
- Wire retrieval in one of two lanes: a client tool she calls mid-conversation, which has 2.5 seconds to answer, or your server searching before every reply and passing the passages through sendTurn instructions that apply to that one reply.
- Keep exact figures out of the model: show prices on screen from your database, and speak a closing quote through sendClosingTurn, which says your text verbatim and then ends the call.
- Register a transcript webhook, test with questions your corpus cannot answer, and read the tool calls in the payload to confirm she searched and declined.
Vendor facts below were read from each vendor's own docs or product page on 16 November 2026; the links are at the end.
Hosted knowledge base or your own retrieval, vendor by vendor
The real question is where retrieval runs and who controls it. A hosted knowledge base is the fastest start. Your own retrieval keeps one index for every channel, keeps private data behind your own authorization, and lets you change chunking or ranking without re-uploading anything.
- Tavus: a Knowledge Base built on RAG. You upload files or website URLs through its Create Document API or PAL Maker and attach them to a conversation by document_ids or document_tags. Formats are .pdf, .txt, .docx, .doc, .png, .jpg, .pptx, .csv and .xlsx, and a retrieval strategy of speed, balanced or quality (the default) trades speed for relevance (Tavus Knowledge Base docs).
- Tavus with your own model: its LLM layer accepts your own OpenAI-compatible LLM through model, base_url and api_key, so retrieval can live inside your endpoint (Tavus LLM layer docs).
- Tavus tools: an LLM tool is delivered either as an event your frontend handles or as an HTTPS request Tavus makes to a URL you configure, so your own search endpoint can be the retrieval tool (Tavus Tools overview).
- HeyGen LiveAvatar FULL mode: a context holds the prompt, an optional opening text and optional links to FAQ-style pages the avatar can reference; contexts are used in FULL mode only, and FULL can optionally use your own LLM (LiveAvatar Contexts docs and LITE or FULL FAQ).
- HeyGen LiveAvatar LITE mode: you bring your own agent and LiveAvatar runs only the avatar video, so retrieval lives in your agent. LITE costs 1 credit per minute against 2 for FULL, as of November 2026 (LiveAvatar LITE or FULL FAQ).
- D-ID AI agents: connect documents or a website as a knowledge base, choose whether the agent sticks to the provided information or uses a hybrid setting that interprets the facts, connect your own LLM through an OpenAI-compatible endpoint, or add a D-ID avatar to an existing LiveKit or ElevenLabs agent (D-ID AI agents page).
- Anam: documents uploaded to knowledge folders, searched by a knowledge tool attached to the persona. Its webhook tools send an HTTP request to your own API endpoint and its client tools run in your page, so your own search can be a tool there too. Custom LLMs are registered in Anam Lab or through its API and must stream (Anam tools and custom LLM docs).
- Realtime Avatar: no hosted knowledge base, no upload and no hosted executor. Retrieval is your tool, in your page or in your server's loop, and your own OpenAI-compatible model is enabled per workspace on request.
So owning the index does not by itself pick a vendor: Tavus and Anam can call your search endpoint too. The choice is where retrieval runs, who holds the credentials, and what happens to exact numbers. Anam's hosted knowledge base is itself a search tool the model calls, the same shape as the pattern below with the index on their side.
- No search index and no wish to run one: a hosted knowledge base (Tavus, Anam, D-ID or LiveAvatar FULL) is the faster start and the better fit.
- Your own index, called from the vendor's servers: a Tavus LLM tool with API delivery or an Anam webhook tool, pointed at your search endpoint.
- Your own index, with retrieval only in your page or on your own server: Realtime Avatar client tools or its server loop, both below.
- Your RAG already behind a chat endpoint: a custom LLM, which Tavus and Anam document as a setting you configure in their API or dashboard; on Realtime Avatar it is enabled per workspace on request.
- A voice agent you already run: a face-only option such as LiveAvatar LITE, or D-ID's or Anam's LiveKit integration. Realtime Avatar has no renderer-only mode.
The grounding loop on Realtime Avatar
There are two lanes, both on the tool-calling docs page. In the first, she decides when to search, through a client tool your page registers. In the second, your code searches before every reply. Start with the first and move to the second when an answer from outside your corpus is unacceptable.
Lane 1: a search tool she calls mid-conversation
The server half is the call policy: the persona and the grounding rules go in instructions, and clientTools: true grants the tool plane for this call. The page registers the tool after the room connects. Its description is the whole teaching signal, so say exactly when to reach for it.
// Server: the connect route's call policy. The browser cannot change any of it.
const SUPPORT_INSTRUCTIONS = [
"You are the support guide for Acme Billing.",
"Before answering any question about the product, plans, billing or policies,",
"call search_help_center and answer only from the passages it returns.",
"If it returns found: false, say the help center does not cover that and offer",
"to connect the user with the support team. If the search fails, say you cannot",
"check right now.",
"Never say a price, fee, date or number that is not written in a passage.",
].join(" ");
session: async () => ({ instructions: SUPPORT_INSTRUCTIONS, clientTools: true }),
// Page: after room.connect(). The key is the name she calls.
import { attachAvatarTools, type AvatarTool } from "realtime-avatar/tools";
type Passage = { id: string; title: string; url: string; text: string };
const search_help_center: AvatarTool<{ query: string }> = {
description:
"Search the Acme help center. Call this before answering any question about " +
"the product, plans, billing or policies. Pass the user's question as query.",
parameters: {
type: "object",
properties: { query: { type: "string" } },
required: ["query"],
},
execute: async ({ query }, { signal }) => {
// Your own search API in front of your own index: vector, keyword or hybrid.
const res = await fetch("/api/help-search?k=3&q=" + encodeURIComponent(query), { signal });
if (!res.ok) throw new Error("help search failed: " + res.status);
const passages: Passage[] = await res.json();
showSources(passages); // your UI: article titles and links beside the video
if (passages.length === 0) return { found: false };
return { found: true, passages: passages.map(({ title, text }) => ({ title, text })) };
},
};
const { rejected } = await attachAvatarTools(room, { search_help_center });
if (rejected.length > 0) console.warn("Tools she does not have:", rejected);
Four details carry the weight. The tool returns found: false instead of an empty list, which gives the instruction something unambiguous to act on. It asks for three short passages, not whole articles, which keeps the search quick and the result short, and quick matters: a client tool has 2.5 seconds, a fixed floor rather than a setting, so your search API must answer well inside it. It passes the AbortSignal to fetch, so a search abandoned at the deadline stops; the platform then tells her the call failed, and the instructions cover that case. And it shows the sources on screen, the same pattern the museum guide post below builds around collection records.
Read the rejected list: a tool that failed to register looks exactly like a model ignoring your rule. And because a client tool runs in the user's browser, it should call only an API that page may call anyway, such as a public help center or an endpoint that checks the user's own session. Index credentials stay in that server route, never in the page; lane 2 is for when the search must run before every reply.
Lane 2: your server searches before every reply
Instructions make the model likely to search, not certain to. When a reply that skipped retrieval is unacceptable, take the decision away from her: mint the call with listen: false, which in an avatar-mode call turns the platform's speech recognition off, so your client supplies every turn's text through sendTurn, from a text box or your own recognizer. Voice-only calls always run the platform's recognizer, so this lane is for video calls.
// Server: the connect route turns the platform's speech recognition off for this video call.
session: async () => ({ instructions: SUPPORT_INSTRUCTIONS, listen: false }),
// Server: POST /api/turn. Retrieval runs next to your index and credentials.
export async function POST(req: Request): Promise<Response> {
const { text } = (await req.json()) as { text: string };
const passages = await searchIndex(text, { limit: 3 }); // your vector or keyword search
const steer =
passages.length === 0
? "The help center has nothing on this. Say so in one sentence and offer the support team. Do not guess."
: [
"Answer using ONLY these facts:",
JSON.stringify(passages.map((p) => p.text)),
"One or two spoken sentences. Do not read the JSON aloud.",
].join("\n");
return Response.json({ steer });
}
// Client: the call was minted with listen: false, so each turn's text comes from your UI.
const { steer } = await fetch("/api/turn", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ text }),
}).then((r) => r.json());
await session.sendTurn(text, { instructions: steer });
Per-turn instructions apply to that one reply and then evaporate. They never change the session prompt, so passages retrieved for one question do not stay in her instructions for every later turn; the next question gets its own search and its own facts. The cost of lane 2 is that you own the input.
Either way, register a transcript webhook at mint. After the call, Realtime Avatar POSTs the two-sided transcript and the tool calls the model acted on (name, arguments, result or error, and duration), signed with HMAC-SHA256. In lane 2 your server already sees every lookup, so log it next to the turn. The record makes each grounded answer auditable and shows which questions your corpus does not cover yet.
Prices and other exact numbers
The made-up price has one reliable fix: the model never produces the number. Realtime Avatar's docs say that for a deterministic string such as a confirmation number, a price or a required disclosure, you should not route it through the model but use the verbatim path. That path is sendClosingTurn, which speaks your text exactly as written, uninterruptibly, and then ends the session. It fits the last line of a call, such as the quote total, not a price mid-conversation.
// The closing line, from your database, spoken verbatim. The call ends after it.
const quote = await db.quotes.get(quoteId);
session.sendClosingTurn(
`Your quote is ${quote.totalText}, reference ${quote.reference}. ` +
"It is in your inbox now. Thanks for calling.",
);
Mid-call, put the figure on screen from the same database row and tell her in the instructions not to state prices but to point to the screen. If she must say one, pass the exact string in that turn's instructions with a rule to repeat it as written, knowing it still goes through the model. Anything known before the call, such as the customer's plan, can go in the context your server supplies when it starts the call. If your workspace has an external model endpoint enabled (below), the platform streams every reply from your endpoint, so your code can write the figure into the reply itself instead of asking a model to copy it.
Refusing outside the corpus
Grounding is half retrieval and half what she does when retrieval comes back empty, so write that branch first: one sentence saying the help center does not cover it, and one offer of your handoff if you have one. A vague answer invites rephrasing until the model guesses.
- Return an explicit empty result (found: false) and say in the instructions what to do with it.
- Scope the index to the audience: anything the tool can return, she can say.
- Offer a handoff only when your system can deliver one, such as a ticket your backend created; the handoff guide below covers the honest states.
- Test with questions your corpus cannot answer, such as a competitor's pricing, and read the transcript webhook payload to confirm she declined.
Instruction-level grounding narrows what the model says; it is not a filter on every word. That is why exact figures stay out of the model and every lookup is logged.
Bringing your own model
If your RAG pipeline already sits behind a chat endpoint, Realtime Avatar can stream every reply from it. Your server mints the session with llm backend external, the https URL of an OpenAI-compatible /chat/completions endpoint you host and a per-call token, and the platform keeps handling listening, turn-taking, interruption and video. External endpoints are enabled per workspace on request, for the hosts you name; otherwise a mint gets 403 external_llm_not_enabled or 403 external_llm_host_not_allowed.
One setting matters for grounding. By default, if your endpoint fails before the first token of a reply, the platform's model speaks that reply so the call never goes silent. Set fail_closed: true (failClosed in the SDK) so that reply fails instead of being answered by a model that never saw your passages.
Here the hosted vendors are ahead: Anam lets you register a custom LLM yourself, Tavus takes base_url and api_key on its LLM layer, and D-ID and LiveAvatar FULL document connecting your own LLM. Anam's client tools also wait 10 seconds for a result by default, adjustable up to 600 seconds, where a Realtime Avatar tool has a fixed 2.5 seconds, so a slow search fits there more easily. Realtime Avatar also has no renderer-only mode: it cannot be the face of a LiveKit Agents, Pipecat or OpenAI Realtime agent you already run. Keep that agent and use LiveAvatar LITE, a D-ID avatar on your LiveKit or ElevenLabs agent, or Anam as the face layer of a LiveKit agent.
Moving an existing persona and FAQ off another vendor
- The persona prompt (a LiveAvatar context prompt, a Tavus PAL system prompt, a D-ID agent prompt) becomes the instructions your server sets at mint, grounding rules included.
- Uploaded documents and FAQ links become your own index, re-chunked with the article title and URL on every passage so your page can show its source.
- Per-user values, such as LiveAvatar's dynamic variables, become the context your server supplies when it starts each call.
- Lookups become client tools or server-loop steps, and a custom LLM can stay the same OpenAI-compatible endpoint once your workspace has external endpoints enabled.
What a grounded support avatar costs
Your search API and index run on your own infrastructure, so their cost sits outside these figures. The call is metered by the second. As of November 2026, Realtime Avatar's pricing lists Starter at $9 a month with 120 realtime minutes included, then $0.095 a minute, and Developer at $24 a month with 600 minutes included, then $0.085 a minute. The free Sandbox includes 8 realtime minutes once, no card.
Worked example: a help center avatar taking 400 calls a month at an average of 3 minutes uses 1,200 minutes. On Developer that is $24 plus 600 extra minutes at $0.085, or $75.00 a month. On Starter it is $9 plus 1,080 extra minutes at $0.095, or $111.60. Starter is the cheaper plan up to about 278 minutes a month, and Developer above that.
FAQ
What tools let you build a real-time conversational AI avatar connected to your own LLM or knowledge base?
Hosted knowledge: Tavus, Anam and D-ID take uploaded documents, and HeyGen LiveAvatar FULL takes a context with FAQ links. Your own LLM: those four, and Realtime Avatar per workspace on request. Your own search index called mid-conversation: Tavus tools with API delivery, Anam webhook or client tools, or Realtime Avatar client tools and its server loop, where retrieval never runs on the platform. A voice agent you already run: a face-only option such as LiveAvatar LITE.
My sales avatar keeps quoting prices it made up. How do I force it to only say prices from my database?
Stop asking the model to produce the number. Show the price on screen from your database, tell her not to state prices, and speak the final quote through sendClosingTurn, which says your text exactly and then ends the call.
Can my support avatar answer only from our help center articles and refuse everything else?
Yes, as a design you build: a search tool over your articles, instructions to answer only from its passages, a found: false branch with a one-sentence refusal and a handoff offer, and lane 2 when skipping retrieval is not acceptable.
Tavus has a hosted knowledge base, but I already run my own vector database. Can a realtime avatar query my own RAG through a function call while it's talking?
Yes. On Realtime Avatar a client tool in your page calls your search API and returns passages within 2.5 seconds, or your server searches and passes the passages through sendTurn. On Tavus you can attach an LLM tool whose API delivery calls your search endpoint, or point its LLM layer at your own OpenAI-compatible endpoint that does the retrieval.
Can a live avatar call my own search API mid-conversation instead of using HeyGen's knowledge base?
On Realtime Avatar, yes: that is the search_help_center tool above. On LiveAvatar, FULL mode grounds answers in a context's prompt and FAQ links, while LITE mode hands the conversation to your own agent, which can call any search API.
Can HeyGen LiveAvatar use my own LLM with retrieval, or only its built-in knowledge base?
Both, per its docs as of November 2026: FULL mode takes a context and can optionally use your own LLM, and LITE mode runs only the avatar video while you bring the agent. Realtime Avatar matches the first with its per-workspace external endpoint and has no equivalent of LITE.
Does Tavus support a knowledge base and human handoff for a customer support video agent?
It documents a full knowledge base. For handoff, its tools can send an HTTPS request to a URL you configure, so a handoff is a tool that opens a ticket or alerts a person in your own support system. Build it the same way on Realtime Avatar, with a client tool or your server loop, and let her offer it only when that system can deliver.
How do I make a property tour avatar answer from MLS data without inventing square footage or price?
Load the listing record from your MLS feed when your server starts the call, put its facts in the call's context, and instruct her to state numbers only as written there. Show price and square footage on screen from the same record, and have her offer the listing agent for anything the record lacks.
- Tool calling docs: client tools, the loop, verbatim path, own model
- Calls: what your server decides at mint
- Building a customer support avatar
- A support avatar that knows when to hand off
- A museum avatar guide that shows its sources
- All-in cost per minute and per hour
- Tavus Knowledge Base docs (read 16 November 2026)
- Tavus LLM layer and custom LLMs (read 16 November 2026)
- Tavus tool calling and delivery (read 16 November 2026)
- HeyGen LiveAvatar Contexts (read 16 November 2026)
- HeyGen LiveAvatar: LITE or FULL mode (read 16 November 2026)
- D-ID AI agents (read 16 November 2026)
- Anam tools: knowledge, webhook and client (read 16 November 2026)
- Anam custom LLMs (read 16 November 2026)
Compare and cost guides
- Realtime Avatar pricing
- Avatar API cost calculator
- Realtime Avatar vs Tavus, HeyGen LiveAvatar, Anam and Simli
- Realtime AI avatar APIs compared
- Realtime avatar API pricing, worked out
- HeyGen and LiveAvatar API pricing explained
- Choosing a HeyGen alternative for realtime avatars
- Tavus pricing per minute
- A Tavus alternative for live AI characters
- Meta Muse Realtime Avatar vs Realtime Avatar
- A realtime AI avatar in React Native or Expo
- Live avatars in 2026: a field guide to the research