LiveKit Agents

Voice & Multimodal 💻 Python ⚖️ Apache-2.0 🟢 Actively maintained
14.0k stars

LiveKit Agents is a Python framework for building realtime, programmable participants that run on servers. It enables developers to create conversational, multi-modal voice agents that can see, hear, and understand, with integrated job scheduling and WebRTC client support. It is designed for developers building voice AI applications, such as voice assistants, telephony bots, and multi-agent systems.

✨ Key features

  • Flexible integrations for STT, LLM, TTS, and Realtime APIs
  • Integrated job scheduling with dispatch APIs
  • Extensive WebRTC client SDK ecosystem
  • Telephony integration for making and receiving calls
  • Semantic turn detection to reduce interruptions
  • Native MCP support and built-in test framework

🎯 Use cases

  • Build voice assistants that can converse with users in real time
  • Create outbound and inbound telephony agents
  • Develop multi-agent systems with handoff between specialized agents
  • Add voice capabilities to applications with video avatars
  • Implement text-only agents using the same framework

📦 Installation

🧰 Requirements: Requires Python and pip; environment variables LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET for connecting to LiveKit Cloud or self-hosted server.

pip install "livekit-agents[openai,deepgram,cartesia]"

🚀 Usage

from livekit.agents import (
    Agent,
    AgentServer,
    AgentSession,
    JobContext,
    RunContext,
    cli,
    function_tool,
    inference,
)

@function_tool
async def lookup_weather(
    context: RunContext,
    location: str,
):
    """Used to look up weather information."""
    return {"weather": "sunny", "temperature": 70}

server = AgentServer()

@server.rtc_session()
async def entrypoint(ctx: JobContext):
    session = AgentSession(
        vad=inference.VAD(),
        stt=inference.STT("deepgram/nova-3", language="multi"),
        llm=inference.LLM("google/gemma-4-31b-it"),
        tts=inference.TTS("cartesia/sonic-3", voice="9626c31c-bec5-4cca-baa8-f8ba9e84c8bc"),
    )

    agent = Agent(
        instructions="You are a friendly voice assistant built by LiveKit.",
        tools=[lookup_weather],
    )

    await session.start(agent=agent, room=ctx.room)
    await session.generate_reply(instructions="greet the user and ask about their day")

if __name__ == "__main__":
    cli.run_app(server)

⚠️ Good to know

The framework is under active development in a rapidly evolving field; turn detection models are licensed under a separate LiveKit Model License.

❓ FAQ

What are the environment variables needed to run an agent?

You need LIVEKIT_URL, LIVEKIT_API_KEY, and LIVEKIT_API_SECRET to connect to LiveKit Cloud or your self-hosted server.

Can I use my own model provider keys instead of LiveKit Inference?

Yes, you can replace the inference STT, LLM, and TTS with plugins like deepgram.STT, openai.LLM, and cartesia.TTS as shown in the README.

How can I test my agent locally without external servers?

Run python myagent.py console to use terminal mode with local audio input/output, which doesn't require external servers.

Does LiveKit Agents support multi-agent handoff?

Yes, you can create multiple Agent classes and return a new agent from a function tool to hand off the conversation, as shown in the multi-agent example.

📊 Repository

Stars★ 14,023
Forks🍴 3,685
Open issues🐛 775
Last commit🕒 Sep 4, 2026
Created📅 Oct 2023
Language💻 Python
License⚖️ Apache-2.0

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.