Skip to main content

Voice AI quickstart

Build and deploy a simple voice assistant in less than 10 minutes.

Overview

This guide walks you through the setup of your very first voice assistant using LiveKit Agents. In less than 10 minutes, you'll have a voice assistant that you can speak to in your terminal, browser, telephone, or native app.

LiveKit Agent Builder

The LiveKit Agent Builder is a quick way to get started with voice agents in your browser, without writing any code. It's perfect for prototyping and exploring ideas, but doesn't have as many features as the full LiveKit Agents SDK. See the Agent Builder guide for more details.

Requirements

Before you start, you need:

  • Python >= 3.10.
  • The uv  package manager.
  • Node.js >= 20.
  • The pnpm  package manager, version 10.15.0 or later.

Install the LiveKit CLI

The LiveKit CLI creates, runs, and deploys your agent. Install it for your operating system:

Install the LiveKit CLI with Homebrew :

brew install livekit-cli
curl -sSL https://get.livekit.io/cli | bash
Tip

You can also download the latest precompiled binaries here .

winget install LiveKit.LiveKitCLI
Tip

You can also download the latest precompiled binaries here .

This repo uses Git LFS  for embedded video resources. Please ensure git-lfs is installed on your machine before proceeding.

git clone github.com/livekit/livekit-cli
make install

Sign in to LiveKit Cloud

Sign in to LiveKit Cloud  and link a project to the CLI. If you don't have an account, sign up for free in the browser window that opens:

lk cloud auth

Set up your coding agent

Install LiveKit's Agent Skills and Docs MCP server for your coding agents, like Claude Code , Cursor , or Codex . They teach your coding agent to build, test, and deploy LiveKit agents:

lk skills install --global

Create your agent

Create your project from a starter:

lk agent init my-agent --template agent-starter-python
lk agent init my-agent --template agent-starter-node

The CLI creates the my-agent directory from the Python  or Node.js  starter project, which includes a complete working agent, tests, and an AGENTS.md for coding agents. It asks a few questions as it goes:

  • Project. If you don't have a default project set, choose the LiveKit Cloud project to use.
  • Dependencies. Install them.

Run your agent

Run your agent in development mode:

cd my-agent
lk agent dev

Speak to your agent

Talk to your agent in the Agent Console:

  1. Open the Agent Console link that lk agent dev prints.
  2. Click Start a session.
  3. Speak into your microphone.

The Console shows your agent's responses in realtime. Its tool panes show events, tool calls, and model timing for each turn.

Customize your agent

Open the my-agent directory in your coding agent and describe the agent you want. The Agent Skills and the project's AGENTS.md show it how to build, test, and debug LiveKit agents. To get started, paste one of these prompts.

Give your agent a new personality:

Turn this agent into a patient Spanish tutor. Speak mostly in Spanish, and switch to English when I get stuck. Add a simulation scenario that checks it switches languages.

Keep track of state across the conversation:

Make this agent a trivia host. Ask one question at a time, keep score, and get more dramatic as the game goes on.

Give your agent a tool:

Add a tool that looks up the current weather for a city with the Open-Meteo API. Write a simulation scenario that tests it, then try it with the agent debugger.

Hand off between agents:

Make this agent take a pizza order. When the order is complete, read it back and hand off to a separate checkout agent that confirms the delivery address.

After each change, talk to your agent again in the Agent Console to try it out.

Deploy to LiveKit Cloud

Deploy your agent to LiveKit Cloud so it runs without your computer. From the my-agent directory, run:

lk agent create

The CLI registers your agent with your LiveKit Cloud project, builds it, and deploys it. To talk to the deployed agent, open your project's Agents dashboard  and launch the Agent Console. To deploy later changes, run lk agent deploy. For more, see the deployment quickstart.

Next steps

Follow these guides to bring your voice AI app to life in the real world.

Appendix

For reference, here's a complete working version of the quickstart agent. You don't need to copy it: lk agent init already created the starter project, which includes this agent plus tests and other extras.

The agent uses an STT-LLM-TTS pipeline through LiveKit Inference, so you don't need provider API keys. Choose a pipeline to see its models and code. To compare them, see Pipeline types. For more models, see AI models.

Your agent strings together three specialized models into a voice pipeline.

ComponentModelAlternatives
STTAssemblyAI Universal-3.6 ProSTT models
LLMGemma 4 31BLLM models
TTSFish Audio S2.1 ProTTS models
from dotenv import load_dotenv
from livekit import agents
from livekit.agents import AgentServer, AgentSession, Agent, inference, room_io, TurnHandlingOptions
from livekit.plugins import ai_coustics
load_dotenv(".env.local")
class Assistant(Agent):
def __init__(self) -> None:
super().__init__(
instructions="""You are a helpful voice AI assistant.
You eagerly assist users with their questions by providing information from your extensive knowledge.
Your responses are concise, to the point, and without any complex formatting or punctuation including emojis, asterisks, or other symbols.
You are curious, friendly, and have a sense of humor.""",
)
server = AgentServer()
@server.rtc_session(agent_name="my-agent")
async def my_agent(ctx: agents.JobContext):
session = AgentSession(
stt=inference.STT(model="assemblyai/universal-3-6-pro", language="en"),
llm=inference.LLM(model="google/gemma-4-31b-it"),
tts=inference.TTS(
model="fishaudio/s2.1-pro",
voice="fa4c9eb3dccc4806b382b40d61c6b10a",
),
turn_handling=TurnHandlingOptions(
turn_detection=inference.TurnDetector(),
),
)
await session.start(
room=ctx.room,
agent=Assistant(),
room_options=room_io.RoomOptions(
audio_input=room_io.AudioInputOptions(
noise_cancellation=ai_coustics.audio_enhancement(model=ai_coustics.EnhancerModel.QUAIL_VF_S),
),
),
)
await session.generate_reply(
instructions="Greet the user and offer your assistance."
)
if __name__ == "__main__":
agents.cli.run_app(server)
import {
type JobContext,
ServerOptions,
cli,
defineAgent,
inference,
voice,
} from '@livekit/agents';
import * as aiCoustics from '@livekit/plugins-ai-coustics';
import { fileURLToPath } from 'node:url';
import dotenv from 'dotenv';
import { createAgent } from './agent';
dotenv.config({ path: '.env.local' });
export default defineAgent({
entry: async (ctx: JobContext) => {
const session = new voice.AgentSession({
stt: new inference.STT({ model: 'assemblyai/universal-3-6-pro', language: 'en' }),
llm: new inference.LLM({ model: 'google/gemma-4-31b-it' }),
tts: new inference.TTS({
model: 'fishaudio/s2.1-pro',
voice: 'fa4c9eb3dccc4806b382b40d61c6b10a',
}),
turnHandling: {
turnDetection: new inference.TurnDetector(),
},
});
await session.start({
agent: createAgent(),
room: ctx.room,
inputOptions: {
noiseCancellation: aiCoustics.audioEnhancement({ model: aiCoustics.EnhancerModel.QuailVfS }),
},
});
await ctx.connect();
const handle = session.generateReply({
instructions: 'Greet the user and offer your assistance.',
});
},
});
cli.runApp(new ServerOptions({ agent: fileURLToPath(import.meta.url), agentName: 'my-agent' }));
import { voice } from '@livekit/agents';
export function createAgent() {
return voice.Agent.create({
instructions: `You are a helpful voice AI assistant.
You eagerly assist users with their questions by providing information from your extensive knowledge.
Your responses are concise, to the point, and without any complex formatting or punctuation including emojis, asterisks, or other symbols.
You are curious, friendly, and have a sense of humor.`,
});
}

Your agent uses a single realtime model for an expressive, lifelike voice.

from dotenv import load_dotenv
from livekit import agents
from livekit.agents import AgentServer, AgentSession, Agent, inference, room_io
from livekit.plugins import ai_coustics
load_dotenv(".env.local")
class Assistant(Agent):
def __init__(self) -> None:
super().__init__(instructions="You are a helpful voice AI assistant.")
server = AgentServer()
@server.rtc_session(agent_name="my-agent")
async def my_agent(ctx: agents.JobContext):
session = AgentSession(
llm=inference.RealtimeModel(
model="openai/gpt-realtime-2.1",
voice="marin",
)
)
await session.start(
room=ctx.room,
agent=Assistant(),
room_options=room_io.RoomOptions(
audio_input=room_io.AudioInputOptions(
noise_cancellation=ai_coustics.audio_enhancement(model=ai_coustics.EnhancerModel.QUAIL_VF_S),
),
),
)
await session.generate_reply(
instructions="Greet the user and offer your assistance. You should start by speaking in English."
)
if __name__ == "__main__":
agents.cli.run_app(server)
import {
type JobContext,
ServerOptions,
cli,
defineAgent,
inference,
voice,
} from '@livekit/agents';
import * as aiCoustics from '@livekit/plugins-ai-coustics';
import { fileURLToPath } from 'node:url';
import dotenv from 'dotenv';
import { createAgent } from './agent';
dotenv.config({ path: '.env.local' });
export default defineAgent({
entry: async (ctx: JobContext) => {
const session = new voice.AgentSession({
llm: new inference.RealtimeModel({
model: 'openai/gpt-realtime-2.1',
voice: 'marin',
}),
});
await session.start({
agent: createAgent(),
room: ctx.room,
inputOptions: {
noiseCancellation: aiCoustics.audioEnhancement({ model: aiCoustics.EnhancerModel.QuailVfS }),
},
});
await ctx.connect();
await session.generateReply({
instructions: 'Greet the user and offer your assistance. You should start by speaking in English.',
});
},
});
cli.runApp(new ServerOptions({ agent: fileURLToPath(import.meta.url), agentName: 'my-agent' }));
import { voice } from '@livekit/agents';
export function createAgent() {
return voice.Agent.create({
instructions: 'You are a helpful voice AI assistant.',
});
}