Skip to main content

Introduction

Cartesia Line is an SDK for building low-latency voice agents. Pairing Line with Tavily gives your voice agent live web access — use Tavily Search for fast, voice-friendly lookups and Tavily Extract for deep-dives into specific pages. This integration is also documented on Cartesia’s docs, and a complete reference implementation lives in the Cartesia Line repo.

Step-by-Step Integration Guide

Step 1: Install Required Packages

Step 2: Set Up API Keys

Create a .env file:

Step 3: Define Tavily Tools

Wrap Tavily’s AsyncTavilyClient in two @loopback_tool functions so the voice agent can call them mid-conversation. Reusing a single AsyncTavilyClient across calls keeps the underlying HTTP session warm, which matters for latency on a live call.

Step 4: Wire the Tools into a Voice Agent

Ensure you have the Cartesia CLI installed. Please refer to the Cartesia CLI documentation for more information.
Run the agent and connect to it:

Choosing a Search Depth

Voice agents are latency-sensitive. Tavily exposes four search depths — for live calls, we recommend using fast or ultra-fast.

Additional Parameters

Extend web_search with any of Tavily’s search parameters:
  • time_range"day", "week", "month", or "year" for recency filtering
  • include_domains / exclude_domains — restrict or block specific sources
  • include_answer"basic" or "advanced" for an LLM-generated answer alongside results
See the Search API reference and the Python SDK reference for the full parameter list. For web_extract, the most useful knobs are:
  • extract_depth"basic" (default) or "advanced" for tables and embedded content
  • format"markdown" (default) or "text"
See the Extract API reference for more.

Benefits of Tavily + Cartesia

  • Voice-optimized latency: fast and ultra-fast search depths keep round-trips short enough for live conversation.
  • Fresh context: Voice agents can answer questions about today’s news, prices, and events without retraining.
  • Targeted deep-dives: Providing URLs to web_extract allows the agent to pull full-page content when a snippet isn’t enough.