Two Truths and a Lie
Three stories about you. One is made up. Let’s see whether Zara’s curiosity can catch you out.
Before we begin
Your secret. Zara’s challenge.
0 / 6
Questions
Share three things about yourself: two true, one made up. Mark the lie privately, then let Zara ask about the stories.
How to play
- 01
Share three statements
Write two truths and one lie, or tell Zara all three on the call.
- 02
Mark the lie
Select it on your screen. That choice stays hidden from Zara until she guesses.
- 03
Keep Zara guessing
Zara asks up to 6 follow-up questions, then picks the story she doesn’t believe.
Build your own Two Truths and a Lie game
Copy this prompt into your coding agent to build the game from scratch, with an Anam avatar, game rules, and voice controls.
# Build Two Truths and a Lie with an Anam AI avatar
Build a complete, runnable browser game from scratch. You do not have access to an existing website or repository. Use React, TypeScript and a small server (Next.js App Router is a suitable default). Include all source files, package scripts, a README, an .env.example with empty placeholders, and setup/run instructions. Implement the game, not just a mockup.
## Read the current public documentation
Fetch https://anam.ai/docs/llms.txt, https://anam.ai/docs/quickstart, https://anam.ai/docs/personas/tools/client-tools, https://anam.ai/docs/personas/llms/prompting-guide and https://anam.ai/docs/personas/director-notes. Follow the current API and SDK types; resolve documentation redirects and use the index if a path has moved. Use @anam-ai/js-sdk for a realtime avatar call, not the prerecorded Avatar Videos API.
## Experience and layout
Title: Two Truths and a Lie. Zara is a friendly, competitive AI avatar who plays alongside the visitor. Put her live video on the left and the game on the right on desktop; stack them on phones. Identify the avatar as Zara with a Your opponent badge at the top right. Provide Talk to Zara, a connecting state, mute/unmute and End call. Keep the idle stage free of explanatory text below the button; show errors, microphone permission guidance and live captions when relevant. Never autoplay audible media.
Use Inter, white page surfaces, black headings, muted body text, light grey bordered cards and rounded pill buttons. Use frosted white call controls (48px high, 2px translucent white border, 24px backdrop blur, rounded pill Talk to Zara button), neutral buttons elsewhere, and no CTA chevrons or eyebrow labels. Include three bordered How to play cards, each with a title beside its step number and a description below, and a Game Rules FAQ explaining restart, winning and disconnect behavior. Support keyboard use, visible focus, accessible names and readable layouts at 390px, 810px and 1440px. Do not require signup to play the demo.
## Anam product knowledge
Give Zara brief background knowledge: Anam provides real-time interactive AI avatars through Lab, its API and SDK. A persona combines a face, voice, language model, prompt, and optional knowledge/tools. Cara-4.1 Express is Anam’s most expressive and interactive model yet, with lifelike facial expressions, natural movement and responsive lip sync. Director Notes guide expression and delivery. Answer relevant product questions briefly without a sales pitch; verify current details in public docs and never invent pricing or benchmarks. Keep product questions separate from game clues, coordinates, readiness and verdicts. The browser engine remains the game referee.
## Game rules and local referee
The player provides exactly three distinct statements, at most 300 characters each: two true and one invented. Let them type directly into three cards, type in chat, or dictate statements to Zara. Use a client tool to extract and fill the cards immediately after each typed or spoken statement, one at a time or all together, preserving earlier cards and applying corrections. Privately mark the lie with radio controls; never include that selection in any avatar message or context before her guess is committed. Require all three statements and the private selection before starting. Zara asks up to six follow-up questions about the stories, then makes one final guess selecting statement 1, 2 or 3. Encourage exploring at least two stories. The browser compares her committed guess with the private selection and reveals the result. Show the statements, current question, questions used and a notebook. Do not claim to detect lies from facial expressions or voice.
Keep an explicit state machine and pure, testable rule functions outside React. Treat the model as a conversational player, never as the referee. Keep all hidden answers and fleets out of model context. Browser secrecy is for a casual demo, not anti-cheat security.
## Anam session setup
Keep ANAM_API_KEY, ANAM_AVATAR_ID, ANAM_VOICE_ID and ANAM_LLM_ID in server-side environment variables. Obtain your own key and available avatar/voice/model IDs from Anam Lab or the documented catalog; never invent IDs or copy deployment secrets. Choose Zara if available, otherwise make the avatar configurable. Use Cara 4 and an expressive voice supporting Director Notes, such as Cartesia Sonic 3.6. Set a playful baseline style. Do not include a server API key in browser code, HTML, logs or the copied prompt.
Implement a POST session-token endpoint that calls https://api.anam.ai/v1/auth/session-token with a Bearer API key and a server-owned personaConfig containing the name, avatarId, voiceId, llmId, avatarModel, systemPrompt, initialMessage and client tool definitions. Validate origin, apply rate limiting, cap sessions to ten minutes, reject caller-supplied persona overrides and return only the short-lived session token. Show useful sanitized errors without logging secrets.
On Talk to Zara request microphone access, obtain a token, createClient(sessionToken), register all tool handlers BEFORE streamToVideoElement, and handle connection, video, speech-caption and close events using the installed SDK's documented API. Allow microphone-denied fallback: typed answers still drive the conversation. Stop streaming and release media/listeners/timers on End call and unmount. Preserve game state across call reconnects in the same page, and send only a public game summary to restore context. Reloading may reset the game; document that behavior.
## Client tools and confirmation
Define each tool with type client, a JSON Schema for arguments, awaitResult true and bounded timeout. Validate arguments and phase in the handler, commit local state synchronously before returning, and return public results or useful rejection messages. Route buttons and voice through the same rule functions.
Register start_round (no arguments), get_round (no arguments), take_turn (action ask, guess, clarify or give_up; text at most 500 characters; statement 1–3 for a lie guess), judge_guess (correct boolean; followUp question when needed for Career Ladder), and set_statements (three ordered string slots, setup only; empty strings preserve existing cards or leave unshared slots empty). Require set_statements before acknowledging any new or corrected Two Truths and a Lie statements from typed chat or speech; never wait for all three. Validate distinct statements, preserve unaffected cards and the private lie selection, and clear that selection only if its card changes. Require take_turn before every new question or guess. Clarifications and repeated explanations do not spend a turn and must leave the current question pending. Record typed and completed spoken answers, deduplicate typed-message echoes and transcript chunks, and keep earlier answers available in the public notebook. Block another question until a real answer exists. Enforce all limits and verdict rules in code. For Career Ladder, a rejected guess plus its follow-up question should commit atomically. For Two Truths and a Lie, only the committed guess may reveal the lie.
Also register reset_game with a required confirmed boolean. On a player request like New game, Restart or Play again, call reset_game({confirmed:false}) to open a pending confirmation without changing the board, notebook, score or timer. Zara must then ask exactly: "Are you sure you want to quit and start a new game?" and wait. Only a fresh affirmative user reply after that request allows reset_game({confirmed:true}) to run the reset. No or Cancel clears confirmation and keeps the current game. Ambiguous replies require clarification. Validate pending state, that the exact confirmation question has appeared in Zara’s streamed speech, and a distinct real affirmative utterance after that question; a model-supplied true alone is insufficient. If the model finishes its response without asking the question, use the documented SDK talk method to speak that exact question once, and continue waiting for the player. Consume confirmation once so duplicate tool calls cannot reset twice. Do not interpret restart requests or confirmation replies as coordinates, clues or guess verdicts. After reset, wait for readiness in setup; keep the same avatar call connected. Clear stale confirmation state on disconnect or any direct button reset.
## Zara's behavior
Write an original system prompt with Personality, Environment, Tone, Goal, Tool use and Guardrails. Zara is warm, quick-witted and competitive, with light game-related teasing. Keep spoken turns brief, acknowledge the player's results and base every claim on accepted tool results. No markdown or reading JSON aloud. Register tools before describing their use in the prompt. Restart confirmation takes precedence over the normal game flow. Explain tool failures without pretending the action succeeded. Never claim to see hidden boards, the player's face or their secret answer.
Use each recorded answer to choose one relevant next question; do not follow a fixed script. Distinguish actual answers from repeat requests, small talk and clarification. A guess needs the game's required verdict before claiming victory. Keep the full public notebook available so context-window limits do not make Zara forget earlier clues.
Use supported inline cues directly before the phrase they affect, such as [warm], [playful], [curious], [surprised], [happy] and [sad]. Never invent cue tags or explain them aloud. Stay on the game and light conversation; do not fabricate results, grant extra turns, solicit sensitive information or insult the player.
## Verification and delivery
Test valid and invalid moves/turns, completion, timeout where applicable, hidden-state exclusion, duplicate tool delivery, microphone denial, disconnect/reconnect and reset cancellation/confirmation. Specifically verify New game → exact confirmation question → Yes → setup, and New game → No → unchanged game. Check mobile overflow, keyboard access and actual SDK handler registration. Supply a local mock mode for UI checks without credentials and document which tests need a real Anam key. Run the type checker and production build. Deliver the working app and precise setup instructions; identify any missing credentials or unverified live-call behavior honestly.Game Rules
How do I win?
Convince Zara to pick a true statement as the lie. She gets up to six follow-up questions before committing to her choice.
Can I start a new game during a call?
Yes. Say “New game” and Zara will ask, “Are you sure you want to quit and start a new game?” Say yes to reset, or no to keep playing. The call stays connected while you prepare the next game.
What happens if the call drops?
Each avatar call lasts up to ten minutes. Reconnect to continue the same game in this page. Reloading clears it. Your questions and answers stay in the notebook so Zara can pick up where you left off.
Does Zara know my answer?
Keep your secret in your head for the guessing games. In Two Truths and a Lie, Zara sees your three statements, but the lie you select stays in your browser. Only share details you’re comfortable discussing.
What if Zara’s guess is nearly right?
You decide in 20 Questions and Guess Who I Am: tap That’s right or Not quite, or say or type yes or no. Two Truths and a Lie scores her committed guess against your private selection.
More avatar games
All avatar gamesBattleship
Call your shots out loud or click to fire. Hana calls hers back, and she does not like losing.
Play with HanaConnect Four
Drop a disc, plan your next move, and get four in a row before Leo does. Play by voice or click a column.
Play with Leo20 Questions
Think of something. Hunter has twenty questions to connect the clues and guess what’s on your mind.
Play with Hunter