github livekit/agents livekit-agents@1.5.9

4 hours ago

Highlights

☎️Answering Machine Detection ☎️

Introducing the headline feature of 1.5.9: AMD reliably distinguishes humans from machines and classifies every outbound call as human, voicemail, IVR, or unavailable. This feature is available in the core framework with no plugins required.

Read more about it in our blog post or see our docs.

Asynchronous Tools

AsyncToolset lets tools run in the background while the voice agent keeps talking. Here's an example:

class TravelToolset(AsyncToolset):
    @function_tool
    async def book_flight(self, ctx: AsyncRunContext, origin: str, dest: str) -> str:
        await ctx.update(f"Searching flights from {origin} to {dest}...")
        # agent replies to user that it's searching the flight

        flights = await search_flights(origin, dest)
        await ctx.update(f"Found {len(flights)} options, booking the best one...")
        # agent will update to user when it's idle

        booking = await confirm_booking(flights[0])
        return f"Booked! Confirmation: {booking.id}"
        # final result will also be updated when both user and agent is idle

agent = Agent(tools=[TravelToolset(id="travel")], instructions="...")

Dynamic Tool Discovery

ToolSearchToolset — exposes a tool_search function. Matched tools are added directly to the LLM's tool list on the next turn, so the model uses native tool calls. Simpler for the model.

ToolProxyToolset — exposes exactly two fixed tools: tool_search (returns schemas) and call_tool (executes by name). The tool list remains unchanged, preserving prompt cache across turns for providers like OpenAI and Anthropic.

Both support:

  • Nested toolsets (MCPToolset), standalone tools, ProviderTool, and RawFunctionTool
  • Atomic toolset loading: if a tool picked belongs to a nested toolset, the whole toolset is loaded.
  • Pluggable search via SearchStrategy protocol
  • Built-in keywod and BM25 search strategy

See an example here: https://github.com/livekit/agents/blob/main/examples/voice_agents/tool_search_agent.py

Plugin Additions

Here are the newest plugins additions since 1.5.0:

  • STT: Inworld, Simplismart, SLNG, xAI
  • LLM: Perplexity,
  • TTS: Mistral AI, Rime Streaming, SLNG, SmallestAI, Soniox
  • Realtime: NVIDIA
  • Avatar: Runway

Deprecations

The Hedra plugin has been deprecated. Please browse our other avatar integrations instead at https://docs.livekit.io/agents/models/avatar/.

Changelog

New Contributors

Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.5.8...livekit-agents@1.5.9

Don't miss a new agents release

NewReleases is sending notifications on new releases.