livekit/agents

每日信息看板 · 2026-02-27
开源项目
Category
github_search
Source
10
Score
2026-02-27T01:59:38Z
Published

AI 总结

LiveKit 开源 Agents 框架用于在服务器上构建实时可编程参与者,支持语音/多模态对话、任务调度与 WebRTC/电话接入,重要性在于提供端到端可自托管的实时语音 AI 代理基础设施与生态集成。
#GitHub #repo #开源项目 #LiveKit #Agents #WebRTC #MCP #Agent

内容摘录

<!--BEGIN_BANNER_IMAGE-->

<picture>
 <source media="(prefers-color-scheme: dark)" srcset="/.github/banner_dark.png">
 <source media="(prefers-color-scheme: light)" srcset="/.github/banner_light.png">
 <img style="width:100%;" alt="The LiveKit icon, the name of the repository and some sample code in the background." src="https://raw.githubusercontent.com/livekit/agents/main/.github/banner_light.png">
</picture>

<!--END_BANNER_IMAGE-->
<br />

!PyPI - Version
PyPI Downloads
Slack community
Twitter Follow
Ask DeepWiki for understanding the codebase
License

<br />

Looking for the JS/TS library? Check out AgentsJS
What is Agents?

<!--BEGIN_DESCRIPTION-->

The Agent Framework is designed for building realtime, programmable participants
that run on servers. Use it to create conversational, multi-modal voice
agents that can see, hear, and understand.

<!--END_DESCRIPTION-->
Features
**Flexible integrations**: A comprehensive ecosystem to mix and match the right STT, LLM, TTS, and Realtime API to suit your use case.
**Integrated job scheduling**: Built-in task scheduling and distribution with dispatch APIs to connect end users to agents.
**Extensive WebRTC clients**: Build client applications using LiveKit's open-source SDK ecosystem, supporting all major platforms.
**Telephony integration**: Works seamlessly with LiveKit's telephony stack, allowing your agent to make calls to or receive calls from phones.
**Exchange data with clients**: Use RPCs and other Data APIs to seamlessly exchange data with clients.
**Semantic turn detection**: Uses a transformer model to detect when a user is done with their turn, helps to reduce interruptions.
**MCP support**: Native support for MCP. Integrate tools provided by MCP servers with one loc.
**Builtin test framework**: Write tests and use judges to ensure your agent is performing as expected.
**Open-source**: Fully open-source, allowing you to run the entire stack on your own servers, including LiveKit server, one of the most widely used WebRTC media servers.
Installation

To install the core Agents library, along with plugins for popular model providers:
Docs and guides

Documentation on the framework and how to use it can be found here
Building with AI coding agents

If you're using an AI coding assistant to build with LiveKit Agents, we recommend the following setup for the best results:
**Install the LiveKit Docs MCP server** — Gives your coding agent access to up-to-date LiveKit documentation, code search across LiveKit repositories, and working examples.
**Install the LiveKit Agent Skill** — Provides your coding agent with architectural guidance and best practices for building voice AI applications, including workflow design, handoffs, tasks, and testing patterns.

 

The Agent Skill works best alongside the MCP server: the skill teaches your agent *how to approach* building with LiveKit, while the MCP server provides the *current API details* to implement it correctly.
Core concepts
Agent: An LLM-based application with defined instructions.
AgentSession: A container for agents that manages interactions with end users.
entrypoint: The starting point for an interactive session, similar to a request handler in a web server.
AgentServer: The main process that coordinates job scheduling and launches agents for user sessions.
Usage
Simple voice agent

---

You'll need the following environment variables for this example:
LIVEKIT_URL
LIVEKIT_API_KEY
LIVEKIT_API_SECRET
Multi-agent handoff

---

This code snippet is abbreviated. For the full example, see multi_agent.py
Testing

Automated tests are essential for building reliable agents, especially with the non-deterministic behavior of LLMs. LiveKit Agents include native test integration to help you create dependable agents.
Examples

<table>
<tr>
<td width="50%">
<h3>🎙️ Starter Agent</h3>
<p>A starter agent optimized for voice conversations.</p>
<p>
<a href="examples/voice_agents/basic_agent.py">Code</a>
</p>
</td>
<td width="50%">
<h3>🔄 Multi-user push to talk</h3>
<p>Responds to multiple users in the room via push-to-talk.</p>
<p>
<a href="examples/voice_agents/push_to_talk.py">Code</a>
</p>
</td>
</tr>

<tr>
<td width="50%">
<h3>🎵 Background audio</h3>
<p>Background ambient and thinking audio to improve realism.</p>
<p>
<a href="examples/voice_agents/background_audio.py">Code</a>
</p>
</td>
<td width="50%">
<h3>🛠️ Dynamic tool creation</h3>
<p>Creating function tools dynamically.</p>
<p>
<a href="examples/voice_agents/dynamic_tool_creation.py">Code</a>
</p>
</td>
</tr>

<tr>
<td width="50%">
<h3>☎️ Outbound caller</h3>
<p>Agent that makes outbound phone calls</p>
<p>
<a href="https://github.com/livekit-examples/outbound-caller-python">Code</a>
</p>
</td>
<td width="50%">
<h3>📋 Structured output</h3>
<p>Using structured output from LLM to guide TTS tone.</p>
<p>
<a href="examples/voice_agents/structured_output.py">Code</a>
</p>
</td>
</tr>

<tr>
<td width="50%">
<h3>🔌 MCP support</h3>
<p>Use tools from MCP servers</p>
<p>
<a href="examples/voice_agents/mcp">Code</a>
</p>
</td>
<td width="50%">
<h3>💬 Text-only agent</h3>
<p>Skip voice altogether and use the same code for text-only integrations</p>
<p>
<a href="examples/other/text_only.py">Code</a>
</p>
</td>
</tr>

<tr>
<td width="50%">
<h3>📝 Multi-user transcriber</h3>
<p>Produce transcriptions from all users in the room</p>
<p>
<a href="examples/other/transcription/multi-user-transcriber.py">Code</a>
</p>
</td>
<td width="50%">
<h3>🎥 Video avatars</h3>
<p>Add an AI avatar with Tavus, Hedra, Bithuman, LemonSlice, and more</p>
<p>
<a href="examples/avatar_agents/">Code</a>
</p>
</td>
</tr>

<tr>
<td width="50%">
<h3>🍽️ Restaurant ordering and reservations</h3>
<p>Full example of an agent that handles calls for a restaurant.</p>
<p>
<a href="examples/voice_agents/restaurant_agent.py">Code</a>
</p>
</td>
<td width="50%">
<h3>👁️ Gemini Live vision</h3>
<p>Full example (including iOS app) of Gemini Live agent that can see.</p>
<p>
<a href="https://github.c…