LiveKit Agents for Node.js
repository·main·Indexed 21 days ago
https://github.com/livekit/agents-jsA framework for building real-time, programmable, multi-modal voice and visual agents on servers. It enables the integration of various STT, LLM, and TTS providers to create conversational AI participants. The framework includes plugins for Anthropic, AssemblyAI, Azure, Baseten, and Anam, and provides examples for implementing complex workflows such as drive-thru ordering, appointment scheduling, hotel reception, and survey agents.
What's inside livekit-agents-js
- The LiveKit Agents Framework is used to build real-time, programmable participants that run on servers. It is designed for creating conversational, multi-modal voice agents capable of seeing, hearing, and understanding users in real-time.
Overview of the Hotel Receptionist Example
mainThe Hotel Receptionist is a phone-oriented agent designed for a hotel front-desk scenario. It demonstrates complex agentic workflows including:
- Reservations: Room booking, restaurant reservations, and booking verification/changes.
- Payments: Card collection and updates via the
GetCardTaskworkflow. - Information Retrieval: Policy lookups and concierge requests.
- Guest Services: Privacy-safe guest messaging, wake-up calls, and group inquiries.
- Error Recovery: Handling overbooking scenarios.
The example is structured into three main components:
hotel_db.ts: An in-memory inventory and booking store seeded with demo data.policies.ts: Implements thelookupPolicytool by processing hotel policy text.hotel_receptionist.ts: Defines theHotelReceptionistAgentand theGetCardTaskcard-capture workflow.
For general setup instructions, refer to the main repository README.
Use the ElevenLabs plugin for voice synthesis
mainThe@livekit/agents-plugin-elevenlabspackage provides integration for ElevenLabs, allowing you to use their high-quality voice synthesis capabilities within a LiveKit Agent. This enables your conversational agents to speak with realistic, expressive voices during real-time interactions.Use the Neuphonic plugin for voice synthesis
mainThe Neuphonic plugin for LiveKit Agents provides voice synthesis capabilities. It allows your programmable participants to generate speech as part of a conversational, multi-modal voice agent workflow. For general information on how to integrate plugins into the Agents Framework, refer to the LiveKit Agents documentation.Use the Rime plugin for text-to-speech (TTS)
mainThe Rime plugin provides high-quality text-to-speech (TTS) capabilities for voice synthesis within the LiveKit Agents framework. It allows you to create conversational, multi-modal voice agents that can synthesize speech in real-time.Use the Silero plugin for Voice Activity Detection
mainThe Silero plugin is a specialized plugin for the LiveKit Agents Framework that provides Voice Activity Detection (VAD). It allows your agents to detect when a user is speaking and when they have finished speaking, which is essential for building responsive conversational voice agents.Use the Deepgram plugin for speech recognition
mainThe
@livekit/agents-plugin-deepgrampackage provides speech recognition capabilities for LiveKit Agents. It allows your programmable participants to hear and transcribe audio in real-time, enabling the creation of conversational voice agents.For detailed implementation guides, refer to the LiveKit Agents documentation. For specific technical details on classes and methods, consult the Deepgram plugin API reference.
Use the Resemble plugin for voice synthesis
mainThe Resemble plugin for LiveKit Agents enables voice synthesis capabilities for your agents. It allows your programmable participants to generate speech using Resemble's voice models, making them suitable for conversational, multi-modal voice agents that can hear and speak in real-time.Use the Anam plugin for voice synthesis
mainThe Anam plugin for the LiveKit Agents Framework enables voice synthesis capabilities for your real-time, programmable participants. It allows agents to generate spoken output as part of a conversational, multi-modal experience.Use the xAI plugin for LiveKit Agents
mainThe xAI plugin provides access to xAI's Grok models via the Realtime API within the LiveKit Agents framework. It allows you to build realtime, programmable participants that can participate in conversational, multi-modal voice agent workflows. To use this plugin, you must integrate it into a LiveKit Agent implementation as described in the LiveKit Agents documentation.Use the Fish Audio plugin for voice synthesis
mainThe Fish Audio plugin for LiveKit Agents enables voice synthesis capabilities for your agents. It supports two modes of operation:
- Streaming Synthesis: Uses the Fish Audio Live TTS WebSocket API for real-time, low-latency voice generation.
- One-shot Synthesis: Uses the HTTP
/v1/ttsendpoint for generating complete audio clips in a single request.
Output Format: The plugin delivers audio as raw 16-bit little-endian PCM. The default sample rate is 24 kHz.
Use the AssemblyAI plugin for speech recognition
mainThe AssemblyAI plugin for LiveKit Agents enables real-time speech recognition using AssemblyAI's Universal-Streaming (v3) API. It allows your programmable agents to 'hear' and transcribe audio streams during a LiveKit session.