Skip to main content
close
Product

Agents SDKs

Build voice and video agents in Python or TypeScript with LiveKit’s open source framework. Design complex workflows in code, define tool use, and integrate with any AI model.

Illustration of isometric grid with Agents SDKs elements
300+ AI model integrations
300,000+ developers
3M+ monthly downloads

Build agents in code, not configuration

LiveKit's Agents SDKs give you full control over your agent backend, with production-ready defaults designed for realtime conversations.

Agent logic

Define tasks and workflows, model repeatable patterns, and customize agent behavior with reusable building blocks, from structured data capture to multi-agent handoffs.

1
from livekit.agents import AgentTask, function_tool
2
3
class CollectConsent(AgentTask[bool]):
4
def __init__(self, chat_ctx=None):
5
super().__init__(
6
instructions="""
7
Ask for recording consent and get a clear yes or no answer.
8
Be polite and professional.
9
""",
10
chat_ctx=chat_ctx,
11
)
12
13
async def on_enter(self) -> None:
14
await self.session.generate_reply(
15
instructions="""
16
Briefly introduce yourself, then ask for permission to record the call for quality assurance and training purposes.
17
Make it clear that they can decline.
18
"""
19
)
20
21
@function_tool
22
async def consent_given(self) -> None:
23
"""Use this when the user gives consent to record."""
24
self.complete(True)
25
26
@function_tool
27
async def consent_denied(self) -> None:
28
"""Use this when the user denies consent to record."""
29
self.complete(False)

Any AI pipeline

Mix and match any STT-LLM-TTS pipeline combination, or use a realtime speech-to-speech model and video avatars to bring your agents to life.

1
from livekit.agents import AgentSession, inference
2
3
session = AgentSession(
4
stt=inference.STT(
5
model="deepgram/flux-general",
6
language="en"
7
),
8
llm=inference.LLM(
9
model="openai/gpt-4.1-mini",
10
),
11
tts=inference.TTS(
12
model="cartesia/sonic-3",
13
voice="9626c31c-bec5-4cca-baa8-f8ba9e84c8bc",
14
),
15
)

Custom tools

Give your agent the ability to take action with full support for LLM tool use. Make frontend calls with RPC, call external APIs, or look up data for RAG.

1
from livekit.agents import function_tool, Agent, RunContext
2
3
4
class MyAgent(Agent):
5
@function_tool()
6
async def lookup_weather(
7
self,
8
context: RunContext,
9
location: str,
10
) -> dict[str, Any]:
11
"""Look up weather information for a given location.
12
13
Args:
14
location: The location to look up weather information for.
15
"""
16
17
return {"weather": "sunny", "temperature_f": 70}

Conversational quality

Build responsive, human-like voice agents with built-in models for end-of-turn detection, noise cancellation, and interruption handling.

1
from livekit.plugins.turn_detector.multilingual import MultilingualModel
2
from livekit.agents import AgentSession, inference
3
4
session = AgentSession(
5
turn_detection=MultilingualModel(),
6
stt=inference.STT(language="multi"),
7
# ... vad, stt, tts, llm, etc.
8
)
The LiveKit Platform

Build, run, and observe
agents with LiveKit Cloud

Our end-to-end platform powers enterprise-grade voice AI
for customer support at global scale.

Open AI
Salesforce
Deutsche Telekom
Zocdoc
Coursera
xAI
Headspace
Oracle
Assort Health
Spotify
Explore the full platform

FAQs

How do I get started with LiveKit Agents?
Install the latest version of LiveKit Agents in Python or TypeScript, then follow our voice AI quickstart guide to build and deploy your first voice agent.
How is LiveKit’s agent framework different from other agent frameworks?
LiveKit’s agent framework is designed for building realtime voice and video agents in code with full-featured SDKs, so you can manage agents like real software with version control, PRs, and rollbacks. Most other voice AI platforms offer simple APIs with limited functionality, or low-code/no-code interfaces that result in rigid agent configurations deployed on black-box infrastructure.
Can my coding agent build with LiveKit?
Teach your AI coding assistant to become a LiveKit expert with our coding agent starter kit, which includes our Docs MCP server, an AGENTS.md instruction file, and agent skills.
How do I choose between Python and TypeScript?
Choose the language that best integrates with the rest of your stack and your engineering team. Both SDKs offer the same functionality and compatibility with the LiveKit platform.
Is the TypeScript SDK treated with the same priority as the Python SDK?
Yes, we are working towards feature parity across the Python and TypeScript Agents SDKs.
How do I give my agent tools?
Define custom tools in code, enable model-native tools, or connect any MCP server. To learn more, visit our docs.
Can I send realtime video to my agent, or give it a video avatar?
The LiveKit Agents SDKs support multimodal inputs and outputs, including speech and audio, text and transcriptions, and video and vision. To learn more, visit our docs.
How do I pass context or metadata to an agent?
Load user or task-specific data into the agent's context before connecting to the LiveKit room and starting the session. Agents can also perform a RAG lookup to retrieve additional context. To learn more about connecting to external data sources, visit our docs.

Ready to build?

Start building a voice AI agent with a free account. Reach out to us if you're interested in custom pricing.

No credit card required • 1,000 free agent session minutes monthly