> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cartesia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK Overview

The [Line SDK](https://github.com/cartesia-ai/line/) is a Python framework for building voice agents. Handles audio infrastructure, speech recognition, and conversation flow.

```bash theme={null}
uv add cartesia-line
```

<Note>
  New to Line? Start with the [Quickstart](/line/start-building/quickstart) to build and deploy your first agent.
</Note>

## Core Concepts

| Component                                           | Purpose                                                                 |
| --------------------------------------------------- | ----------------------------------------------------------------------- |
| [`Agent`](./agents)                                 | Controls the input/output event loop via a `process` method             |
| [`LlmAgent`](./agents#llmagent)                     | Built-in agent that wraps 100+ LLM providers via LiteLLM                |
| [`Tools`](./tools)                                  | Functions your agent can call—database lookups, handoffs, web search    |
| [`VoiceAgentApp`](./agents#handling-incoming-calls) | HTTP server that connects your agent to Cartesia's audio infrastructure |

```python theme={null}
import os
from line.llm_agent import LlmAgent, LlmConfig, end_call
from line.voice_agent_app import VoiceAgentApp

async def get_agent(env, call_request):
    return LlmAgent(
        model="anthropic/claude-haiku-4-5-20251001",
        api_key=os.getenv("ANTHROPIC_API_KEY"),
        tools=[end_call],
        config=LlmConfig(
            system_prompt="You are a helpful assistant.",
            introduction="Hello! How can I help you today?",
        ),
    )

app = VoiceAgentApp(get_agent=get_agent)
```

The agent speaks the `introduction` when a call starts, then responds to whatever the user says using the LLM.

## Features

* **Real-time interruption support** — Handles audio interruptions and turn-taking out-of-the-box.
* **Tool calling** — Connect to databases, APIs, and external services
* **Multi-agent handoffs** — Route conversations between specialized agents
* **Web search** — Built-in tool for real-time information lookup

## Add Capabilities

### Look up information

```python theme={null}
from typing import Annotated
from line.llm_agent import loopback_tool

@loopback_tool
async def get_order_status(ctx, order_id: Annotated[str, "The order ID"]):
    """Look up an order's current status."""
    order = await db.get_order(order_id)
    return f"Order {order_id} is {order.status}"
```

### Handoff to another agent

```python theme={null}
from line.llm_agent import LlmAgent, LlmConfig, agent_as_handoff, end_call

spanish_agent = LlmAgent(
    model="gpt-5-nano",
    api_key=os.getenv("OPENAI_API_KEY"),
    tools=[end_call],
    config=LlmConfig(
        system_prompt="You speak only in Spanish.",
        introduction="¡Hola! ¿Cómo puedo ayudarte?",
    ),
)

main_agent = LlmAgent(
    model="anthropic/claude-haiku-4-5-20251001",
    api_key=os.getenv("ANTHROPIC_API_KEY"),
    tools=[
        end_call,
        agent_as_handoff(
            spanish_agent,
            name="transfer_to_spanish",
            description="Transfer when user requests Spanish.",
        ),
    ],
    config=LlmConfig(...),
)
```

### Search the web

```python theme={null}
from line.llm_agent import end_call, web_search

agent = LlmAgent(
    tools=[end_call, web_search],  # Add built-in web search
    ...
)
```

See [Tools](./tools) for the full guide.

## Code Examples

| Example                                                                                   | Description                                        |
| ----------------------------------------------------------------------------------------- | -------------------------------------------------- |
| [Basic Chat](https://github.com/cartesia-ai/line/tree/main/examples/basic_chat)           | Simple conversational agent                        |
| [Chat Supervisor](https://github.com/cartesia-ai/line/tree/main/examples/chat_supervisor) | Fast chat model with powerful reasoning escalation |
| [Form Filler](https://github.com/cartesia-ai/line/tree/main/examples/form_filler)         | Collect structured data via conversation           |
| [Multi-Agent](https://github.com/cartesia-ai/line/tree/main/examples/transfer_agent)      | Hand off between specialized agents                |

### Integrations

| Integration                                                                                   | Description              |
| --------------------------------------------------------------------------------------------- | ------------------------ |
| [Exa Web Research](https://github.com/cartesia-ai/line/tree/main/example_integrations/exa)    | Real-time web search     |
| [Browserbase](https://github.com/cartesia-ai/line/tree/main/example_integrations/browserbase) | Fill web forms via voice |

## Next Steps

<CardGroup cols={2}>
  <Card title="Agents" icon="robot" href="./agents">
    Configure prompts, LLMs, and conversation flow
  </Card>

  <Card title="Tools" icon="wrench" href="./tools">
    Add custom tools and multi-agent handoffs
  </Card>
</CardGroup>
