Skip to main content
unmute_core.livekit puts the library’s tools, tasks, model call and telemetry on LiveKit Agents. Its main class, UnmuteAgent, is a LiveKit Agent, so you start it on your own AgentSession. You keep your room, your speech and your model. Install the library and the plugins the quickstart uses:

Quickstart

agent.py
  1. The AgentSpec says what the agent is, the same way on LiveKit and Pipecat. See AgentSpec.
  2. UnmuteAgent adds the call’s state, hooks and telemetry. It takes LiveKit’s own Agent options too.
  3. The library builds no part of the pipeline. You choose the speech to text, the text to speech and the model. Here speech runs on SLNG: Soniox hears the caller and Fish Audio speaks. See SLNG.
For a realtime model, see Realtime.

Use your own model call

With no model in the spec, the agent runs on the session’s LLM. To use another provider, give the spec a ModelCall and leave llm out of the session. This is the SLNG Context Router:
  1. Each request carries your own router config, so the model runs on your own OpenAI key.
  2. The session retries the model call as it retries its own LLM. The agent closes it when the session closes.
  3. To keep a LiveKit plugin instead, pass AgentSpec(model=LiveKitModel(plugin)).
See Model call for the interface and SLNG for the router.

Open and end the call

  1. open_call turns the caller’s audio off, runs the before_call hooks and the prefetch, then greets. A failed check says the failure line and hangs up instead.
  2. The caller’s audio comes back when the agent starts to speak, or when the greeting ends with interruptible=False.
  3. The session’s close ends the call. The job’s shutdown waits for the held saves, the models and the telemetry to close. The end reads caller_hung_up, agent_ended or max_duration.
On a phone call, read the caller’s number with sip_call_info. See Phone calls. The events and the failure line are in The call’s life.

Add LiveKit tools and MCP

native_tools gives the main agent LiveKit tools as they are. A LiveKit MCP toolset is one:
  1. The main agent gets every tool you pass.
  2. A step gets only the toolsets its task lists, by id: TaskSpec(native_tools=("crm",), ...).

Before you ship

  1. Build one AgentSpec, one UnmuteAgent, one Telemetry and one ModelCall per call. A model call shared across calls is closed under the others.
  2. A subclass that overrides on_enter or tts_node calls super(), or the spans stop.
  3. Give the spec tools or tasks, not both. The task plan holds every tool.
Every other rule is in Rules to know.

Where to go next

LiveKit adapter reference

Every argument, how a call runs inside, and every rule.

Turn taking

Turn pace, interruption and idle nudges on LiveKit.

Handoffs

Move the call between agents, each with its own model and voice.

The call's life

Call start values, events, the failure line and the end.

Add one piece to your agent

Use one piece on a plain Agent.