$npx -y skills add livekit/agent-skills --skill livekit-agentsBuild voice AI agents with LiveKit Cloud and the Agents SDK. Use when the user asks to "build a voice agent", "create a LiveKit agent", "add voice AI", "implement handoffs", "structure agent workflows", or is working with LiveKit Agents SDK. Provides opinionated guidance for the
| 1 | # LiveKit Agents Development for LiveKit Cloud |
| 2 | |
| 3 | This skill provides opinionated guidance for building voice AI agents with LiveKit Cloud. It assumes you are using LiveKit Cloud (the recommended path) and encodes *how to approach* agent development, not API specifics. All factual information about APIs, methods, and configurations must come from live documentation. |
| 4 | |
| 5 | **This skill is for LiveKit Cloud developers.** If you're self-hosting LiveKit, some recommendations (particularly around LiveKit Inference) won't apply directly. |
| 6 | |
| 7 | ## MANDATORY: Read This Checklist Before Starting |
| 8 | |
| 9 | Before writing ANY code, complete this checklist: |
| 10 | |
| 11 | 1. **Read this entire skill document** - Do not skip sections even if MCP is available |
| 12 | 2. **Ensure LiveKit Cloud project is connected** - You need `LIVEKIT_URL`, `LIVEKIT_API_KEY`, and `LIVEKIT_API_SECRET` from your Cloud project |
| 13 | 3. **Set up documentation access** - Use MCP if available, otherwise use web search |
| 14 | 4. **Plan to write tests** - Every agent implementation MUST include tests (see testing section below) |
| 15 | 5. **Verify all APIs against live docs** - Never rely on model memory for LiveKit APIs |
| 16 | |
| 17 | This checklist applies regardless of whether MCP is available. MCP provides documentation access but does NOT replace the guidance in this skill. |
| 18 | |
| 19 | ## LiveKit Cloud Setup |
| 20 | |
| 21 | LiveKit Cloud is the fastest way to get a voice agent running. It provides: |
| 22 | - Managed infrastructure (no servers to deploy) |
| 23 | - **LiveKit Inference** for AI models (no separate API keys needed) |
| 24 | - Built-in noise cancellation, turn detection, and other voice features |
| 25 | - Simple credential management |
| 26 | |
| 27 | ### Connect to Your Cloud Project |
| 28 | |
| 29 | 1. Sign up at [cloud.livekit.io](https://cloud.livekit.io) if you haven't already |
| 30 | 2. Create a project (or use an existing one) |
| 31 | 3. Get your credentials from the project settings: |
| 32 | - `LIVEKIT_URL` - Your project's WebSocket URL (e.g., `wss://your-project.livekit.cloud`) |
| 33 | - `LIVEKIT_API_KEY` - API key for authentication |
| 34 | - `LIVEKIT_API_SECRET` - API secret for authentication |
| 35 | |
| 36 | 4. Set these as environment variables (typically in `.env.local`): |
| 37 | ```bash |
| 38 | LIVEKIT_URL=wss://your-project.livekit.cloud |
| 39 | LIVEKIT_API_KEY=your-api-key |
| 40 | LIVEKIT_API_SECRET=your-api-secret |
| 41 | ``` |
| 42 | |
| 43 | The LiveKit CLI can automate credential setup. Consult the CLI documentation for current commands. |
| 44 | |
| 45 | ### Use LiveKit Inference for AI Models |
| 46 | |
| 47 | **LiveKit Inference is the recommended way to use AI models with LiveKit Cloud.** It provides access to leading AI model providers—all through your LiveKit credentials with no separate API keys needed. |
| 48 | |
| 49 | Benefits of LiveKit Inference: |
| 50 | - No separate API keys to manage for each AI provider |
| 51 | - Billing consolidated through your LiveKit Cloud account |
| 52 | - Optimized for voice AI workloads |
| 53 | |
| 54 | Consult the documentation for available models, supported providers, and current usage patterns. The documentation always has the most up-to-date information. |
| 55 | |
| 56 | ## Critical Rule: Never Trust Model Memory for LiveKit APIs |
| 57 | |
| 58 | LiveKit Agents is a fast-evolving SDK. Model training data is outdated the moment it's created. When working with LiveKit: |
| 59 | |
| 60 | - **Never assume** API signatures, method names, or configuration options from memory |
| 61 | - **Never guess** SDK behavior or default values |
| 62 | - **Always verify** against live documentation before writing code |
| 63 | - **Always cite** the documentation source when implementing features |
| 64 | |
| 65 | This rule applies even when confident about an API. Verify anyway. |
| 66 | |
| 67 | ## REQUIRED: Use LiveKit MCP Server for Documentation |
| 68 | |
| 69 | Before writing any LiveKit code, ensure access to the LiveKit documentation MCP server. This provides current, verified API information and prevents reliance on stale model knowledge. |
| 70 | |
| 71 | ### Check for MCP Availability |
| 72 | |
| 73 | Look for `livekit-docs` MCP tools. If available, use them for all documentation lookups: |
| 74 | - Search documentation before implementing any feature |
| 75 | - Verify API signatures and method parameters |
| 76 | - Look up configuration options and their valid values |
| 77 | - Find working examples for the specific task at hand |
| 78 | |
| 79 | ### If MCP Is Not Available |
| 80 | |
| 81 | If the LiveKit MCP server is not configured, inform the user and recommend installation. Installation instructions for all supported platforms are available at: |
| 82 | |
| 83 | **https://docs.livekit.io/intro/mcp-server/** |
| 84 | |
| 85 | Fetch the installation instructions appropriate for the user's coding agent from that page. |
| 86 | |
| 87 | ### Fallback When MCP Unavailable |
| 88 | |
| 89 | If MCP cannot be installed in the current session: |
| 90 | 1. **Inform the user immediately** that documentation cannot be verified in real-time |
| 91 | 2. Use web search |