> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# SignalWire AI

> Build programmable, realtime voice AI agents with SWML, the SignalWire Dashboard, Call Flow Builder, or the Server SDKs.

SignalWire AI runs programmable voice agents on the same realtime platform that carries your calls.
Deploy a minimum viable product with no-code and low-code tools, then scale it with
[SWML](/docs/swml) or the [Server SDKs](/docs/server-sdks).

## Quickstart

Deploy a serverless AI agent and call it over the public switched telephone network (PSTN) in under 5 minutes.

### Create a free account

[Sign up for a SignalWire account](https://signalwire.com/signup), or log in if you already have one.

### Create a SWML script

From your [SignalWire Dashboard](https://my.signalwire.com), click **Script**, then **SWML script**.
Paste the following script into the Primary Script field, then select **Create**.

#### Fun fact

This simple YAML/JSON document is a complete calling application!

```yaml title="swml.yaml"
version: 1.0.0
sections:
  main:
    - ai:
        prompt:
          text: You are a knowledgeable developer. Have an open-ended discussion with the caller about SignalWire and programmable communications.
```

### Assign a phone number

[Buy a phone number](https://my.signalwire.com?page=phone_numbers) using your \$5 promotional credit.
Select the number from your **Phone Numbers** list and click **Edit Settings**.
Under **Inbound Call Settings**, choose **Assign Resource**, pick the SWML script you just created,
and click **Save**.

### Give it a call

Dial your newly configured AI agent over the PSTN from your cell phone or a VoIP dialer.

## SWML

SWML (SignalWire Markup Language) is a structured language for configuring and orchestrating
real-time communication applications using lightweight and readable JSON or YAML files.
It's the foundation for AI on the platform: the Server SDKs build agents by generating SWML,
and you can write it directly, deploying serverlessly in SignalWire's cloud or from your server.

SWML's `ai` method integrates AI agents, which can interact with external APIs.

#### [Technical reference](/docs/swml/reference/calling/ai)

SWML AI method

## AI Agents

Configure AI Agents right in your SignalWire Space with a streamlined, no-code user interface.

#### [AI Agents in the Dashboard](/docs/platform/ai/no-code-agents)

Getting started guide

## Call Flow Builder

Add AI Agents built in your SignalWire Space directly to drag-and-drop call flows.

#### [Call Flow Builder](/docs/call-flow-builder/reference/ai-agent)

Guide to the AI Agent node

## Server SDKs

Build custom voice AI agents in the language of your choice. The SignalWire Server SDKs provide complete programmatic control for sophisticated voice applications.

#### [Quickstart](/docs/server-sdks/guides/quickstart)

Build your first agent in 5 minutes

#### [Examples](/docs/server-sdks/guides/build-ai-agents)

Progressive examples from simple to advanced

#### [Prefab agents](/docs/server-sdks/guides/build-ai-agents#prefab-agents)

Agent archetypes to use directly or extend

### Use cases

#### Simple AI phone call

A basic AI-powered phone agent that can hold an open-ended conversation.

#### Server SDK

```python
from signalwire import AgentBase

# Create an agent and assign a route
agent = AgentBase(name="My Assistant", route="/assistant")

# Add some basic capabilities
agent.add_skill("datetime")     # Current date/time info
agent.add_skill("math")         # Mathematical calculations

# Start the agent
if __name__ == "__main__":
    agent.run()
```

[Server SDK docs](/docs/server-sdks) | [Quickstart guide](/docs/server-sdks/guides/quickstart)

#### SWML

```yaml
version: 1.0.0
sections:
  main:
    - ai:
        post_prompt_url: https://example.com/my-post-prompt-url
        params:
          save_conversation: true
        prompt:
          text: |
            You are a knowledgeable developer.
            Have an open-ended discussion with the caller about SignalWire and programmable communications.
```

[SWML docs](/docs/swml) | [AI method reference](/docs/swml/reference/calling/ai)

#### Call Flow Builder

<img src="https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/signalwire.docs.buildwithfern.com/b0d898d351425268b68603b48f5e07393080aa09251cf059c77be37a3083a363/assets/images/img/cfb/simple-ai-cfb.webp?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260816%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260816T043314Z&X-Amz-Expires=604800&X-Amz-Signature=9bcd40773f303378623fadd888dff8b89418e33f47f596f888a1a833e5a7ba39&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject" alt="A simple AI Agent in the Call Flow Builder interface." />

[Call Flow Builder docs](/docs/call-flow-builder)

#### FAQ bot

An AI agent that answers frequently asked questions about your business.

#### Server SDK

```python
from signalwire.prefabs import FAQBotAgent

agent = FAQBotAgent(
    faqs=[
        {
            "question": "What are your hours?",
            "answer": "We're open 9 AM to 5 PM, Monday to Friday."
        },
        {
            "question": "Where are you located?",
            "answer": "123 Main Street, Downtown."
        }
    ]
)

if __name__ == "__main__":
    agent.run()
```

[Server SDK docs](/docs/server-sdks) | [FAQ Bot prefab](/docs/server-sdks/guides/faq-bot)

#### SWML

```yaml
version: 1.0.0
sections:
  main:
    - ai:
        prompt:
          text: |
            You are a helpful FAQ bot. Answer questions about our business using the available functions.
        SWAIG:
          defaults:
            web_hook_url: https://example.com/faq-webhook
          functions:
            - function: search_faq
              description: Search frequently asked questions
              parameters:
                type: object
                properties:
                  query:
                    type: string
                    description: The question to search for
```

[SWML docs](/docs/swml) | [SWAIG functions guide](/docs/swml/guides/swaig)

#### Customer service agent

An agent that looks up customer accounts and transfers calls to human support when needed.

#### Server SDK

```python
from signalwire import AgentBase, FunctionResult

agent = AgentBase(name="support")
agent.prompt_add_section("Role", "You are a helpful customer service agent.")

@agent.tool(description="Look up customer account")
def lookup_account(account_id: str) -> FunctionResult:
    # Simulate database lookup
    customer = {"name": "John Doe", "status": "active"}
    return FunctionResult(f"Account: {customer['name']}, Status: {customer['status']}")

@agent.tool(description="Transfer to support")
def transfer_support() -> FunctionResult:
    return FunctionResult("Connecting you to support.").connect("+15551234567")

if __name__ == "__main__":
    agent.run()
```

[Server SDK docs](/docs/server-sdks) | [Custom functions guide](/docs/server-sdks/guides/prompts-pom)

#### SWML

```yaml
version: 1.0.0
sections:
  main:
    - ai:
        prompt:
          text: |
            You are a customer service agent. Help customers with their questions and account needs.
            Use the available functions to look up information or transfer calls when needed.
        SWAIG:
          functions:
            - function: lookup_account
              description: Look up customer account information
              parameters:
                type: object
                properties:
                  account_id:
                    type: string
                    description: Customer account ID
              web_hook_url: https://example.com/account-lookup
            - function: transfer_to_support
              description: Transfer to human support agent
              web_hook_url: https://example.com/transfer-support
```

[SWML docs](/docs/swml) | [SWAIG functions guide](/docs/swml/guides/swaig)

#### Hotel concierge

A virtual concierge that helps guests with amenity information and service bookings.

#### Server SDK

```python
from signalwire.prefabs import ConciergeAgent

agent = ConciergeAgent(
    venue_name="Grand Hotel",
    services=["room service", "spa bookings", "restaurant reservations"],
    amenities={
        "pool": {"hours": "7 AM - 10 PM", "location": "2nd Floor"},
        "gym": {"hours": "24 hours", "location": "3rd Floor"}
    }
)

if __name__ == "__main__":
    agent.run()
```

[Server SDK docs](/docs/server-sdks) | [Concierge prefab](/docs/server-sdks/guides/concierge)

#### SWML

```yaml
version: 1.0.0
sections:
  main:
    - ai:
        prompt:
          text: |
            You are a hotel concierge for Grand Hotel. Help guests with information about amenities,
            services, and bookings. Use available functions to provide accurate information.
        SWAIG:
          functions:
            - function: check_availability
              description: Check availability for services
              parameters:
                type: object
                properties:
                  service:
                    type: string
                    description: Service to check (spa, restaurant, etc.)
                  date:
                    type: string
                    description: Date for booking
              web_hook_url: https://example.com/hotel-availability
            - function: get_amenity_info
              description: Get information about hotel amenities
              parameters:
                type: object
                properties:
                  amenity:
                    type: string
                    description: Which amenity (pool, gym, spa, etc.)
              web_hook_url: https://example.com/amenity-info
```

[SWML docs](/docs/swml) | [SWAIG functions guide](/docs/swml/guides/swaig)

#### Appointment scheduling

An agent that checks availability, books appointments, and sends SMS confirmations.

#### Server SDK

```python
from signalwire import AgentBase, FunctionResult
from datetime import datetime

appointments = []

agent = AgentBase(name="scheduler", route="/scheduler")
agent.prompt_add_section("Role", "You help customers schedule appointments.")
agent.prompt_add_section("Guidelines", """
- Collect customer name, date, and preferred time
- Confirm all details before booking
- Send SMS confirmation when booking is complete
""")
agent.add_language("English", "en-US", "rime.spore")

@agent.tool(description="Check if a time slot is available")
def check_availability(date: str, time: str) -> FunctionResult:
    for apt in appointments:
        if apt["date"] == date and apt["time"] == time:
            return FunctionResult(f"Sorry, {date} at {time} is not available.")
    return FunctionResult(f"{date} at {time} is available.")

@agent.tool(description="Book an appointment")
def book_appointment(
    name: str,
    phone: str,
    date: str,
    time: str
) -> FunctionResult:
    appointments.append({
        "name": name,
        "phone": phone,
        "date": date,
        "time": time,
        "booked_at": datetime.now().isoformat()
    })
    return (
        FunctionResult(f"Appointment booked for {name} on {date} at {time}.")
        .send_sms(
            to_number=phone,
            from_number="+15559876543",
            body=f"Your appointment is confirmed for {date} at {time}."
        )
    )

if __name__ == "__main__":
    agent.run()
```

[Server SDK docs](/docs/server-sdks) | [InfoGatherer prefab](/docs/server-sdks/guides/info-gatherer)

#### SWML

```yaml
version: 1.0.0
sections:
  main:
    - ai:
        prompt:
          text: |
            You are an appointment scheduling agent. Help customers book appointments,
            check availability, and send confirmations.
        SWAIG:
          functions:
            - function: check_availability
              description: Check if a time slot is available
              parameters:
                type: object
                properties:
                  date:
                    type: string
                    description: Date for appointment
                  time:
                    type: string
                    description: Preferred time
              web_hook_url: https://example.com/check-availability
            - function: book_appointment
              description: Book an appointment
              parameters:
                type: object
                properties:
                  name:
                    type: string
                    description: Customer name
                  phone:
                    type: string
                    description: Customer phone number
                  date:
                    type: string
                    description: Appointment date
                  time:
                    type: string
                    description: Appointment time
              web_hook_url: https://example.com/book-appointment
```

[SWML docs](/docs/swml) | [SWAIG functions guide](/docs/swml/guides/swaig)

#### Survey

An agent that conducts customer satisfaction surveys with different question types.

#### Server SDK

```python
from signalwire.prefabs import SurveyAgent

agent = SurveyAgent(
    survey_name="Customer Satisfaction Survey",
    questions=[
        {
            "id": "satisfaction",
            "text": "How satisfied were you with our service?",
            "type": "rating",
            "scale": 5
        },
        {
            "id": "recommend",
            "text": "Would you recommend us to others?",
            "type": "yes_no"
        },
        {
            "id": "comments",
            "text": "Any additional comments?",
            "type": "open_ended",
            "required": False
        }
    ]
)

if __name__ == "__main__":
    agent.run()
```

[Server SDK docs](/docs/server-sdks) | [Survey prefab](/docs/server-sdks/guides/survey)

#### SWML

```yaml
version: 1.0.0
sections:
  main:
    - ai:
        prompt:
          text: |
            You are a survey agent. Conduct a customer satisfaction survey by asking
            the provided questions and recording their responses.
        SWAIG:
          functions:
            - function: record_response
              description: Record survey response
              parameters:
                type: object
                properties:
                  question_id:
                    type: string
                    description: ID of the question being answered
                  response:
                    type: string
                    description: The customer's response
              web_hook_url: https://example.com/record-survey
            - function: get_next_question
              description: Get the next survey question
              parameters:
                type: object
                properties:
                  current_id:
                    type: string
                    description: Current question ID
              web_hook_url: https://example.com/next-question
```

[SWML docs](/docs/swml) | [SWAIG functions guide](/docs/swml/guides/swaig)

#### Receptionist

A virtual receptionist that greets callers and routes them to the right department.

#### Server SDK

```python
from signalwire.prefabs import ReceptionistAgent

agent = ReceptionistAgent(
    departments=[
        {
            "name": "sales",
            "description": "Product inquiries, pricing, and purchasing",
            "number": "+15551234567"
        },
        {
            "name": "support",
            "description": "Technical help and troubleshooting",
            "number": "+15551234568"
        },
        {
            "name": "billing",
            "description": "Payment questions and account issues",
            "number": "+15551234569"
        }
    ]
)

if __name__ == "__main__":
    agent.run()
```

[Server SDK docs](/docs/server-sdks) | [Receptionist prefab](/docs/server-sdks/guides/receptionist)

#### SWML

```yaml
version: 1.0.0
sections:
  main:
    - ai:
        prompt:
          text: |
            You are a receptionist. Greet callers and determine which department
            they need based on their inquiry. Transfer them to the appropriate department.
        SWAIG:
          functions:
            - function: route_to_department
              description: Transfer caller to specific department
              parameters:
                type: object
                properties:
                  department:
                    type: string
                    description: Target department (sales, support, billing)
              web_hook_url: https://example.com/route-department
            - function: get_department_info
              description: Get information about available departments
              parameters:
                type: object
                properties:
                  department:
                    type: string
                    description: Department name to lookup
              web_hook_url: https://example.com/department-info
```

[SWML docs](/docs/swml) | [SWAIG functions guide](/docs/swml/guides/swaig)

#### Lead qualification

An agent that collects information from potential customers and qualifies them for the sales team.

#### Server SDK

```python
from signalwire.prefabs import InfoGathererAgent

agent = InfoGathererAgent(
    questions=[
        {"key_name": "name", "question_text": "What is your name?"},
        {"key_name": "company", "question_text": "What company are you with?"},
        {"key_name": "phone", "question_text": "What is your phone number?", "confirm": True},
        {"key_name": "budget", "question_text": "What is your budget range for this project?"},
        {"key_name": "timeline", "question_text": "What is your timeline for making a decision?"}
    ],
    name="lead-qualifier"
)

agent.prompt_add_section(
    "Role",
    "You are qualifying leads for the sales team. Be friendly and professional."
)

if __name__ == "__main__":
    agent.run()
```

[Server SDK docs](/docs/server-sdks) | [InfoGatherer prefab](/docs/server-sdks/guides/info-gatherer)

#### SWML

```yaml
version: 1.0.0
sections:
  main:
    - ai:
        prompt:
          text: |
            You are a lead qualification agent. Collect information from potential customers
            and determine if they are qualified leads for our sales team.
        SWAIG:
          functions:
            - function: collect_lead_info
              description: Collect and qualify lead information
              parameters:
                type: object
                properties:
                  name:
                    type: string
                    description: Contact name
                  company:
                    type: string
                    description: Company name
                  budget:
                    type: string
                    description: Project budget range
              web_hook_url: https://example.com/lead-qualification
            - function: schedule_followup
              description: Schedule a follow-up call
              parameters:
                type: object
                properties:
                  datetime:
                    type: string
                    description: When to schedule follow-up
              web_hook_url: https://example.com/schedule-followup
```

[SWML docs](/docs/swml) | [SWAIG functions guide](/docs/swml/guides/swaig)

#### Real-time transcription

An agent that records calls and provides real-time transcription.

#### Server SDK

```python
from signalwire import AgentBase, FunctionResult

agent = AgentBase(name="transcription-agent")
agent.add_language("English", "en-US", "rime.spore")
agent.prompt_add_section("Role", "You are a helpful assistant. The call is being recorded for transcription.")
agent.set_params({"save_conversation": True})

@agent.tool(description="Start recording the call for transcription")
def start_recording() -> FunctionResult:
    return (
        FunctionResult("Recording has started.")
        .record_call(
            control_id="transcription",
            stereo=True,
            format="wav"
        )
    )

if __name__ == "__main__":
    agent.run()
```

[Server SDK docs](/docs/server-sdks) | [Call recording guide](/docs/server-sdks/guides/call-recording)

#### SWML

```yaml
version: 1.0.0
sections:
  main:
    - record_call:
        stereo: true
        format: "wav"
    - ai:
        prompt:
          text: |
            You are a transcription agent. Listen to the conversation and provide
            real-time transcription of what is being said.
        params:
          save_conversation: true
          attention_timeout: 30000
        SWAIG:
          functions:
            - function: get_transcript
              description: Get current conversation transcript
              parameters:
                type: object
                properties:
                  format:
                    type: string
                    description: Output format (text, json, etc.)
              web_hook_url: https://example.com/get-transcript
```

[SWML docs](/docs/swml) | [Call recording guide](/docs/server-sdks/guides/call-recording)

#### [View all examples](/docs/server-sdks/guides/build-ai-agents)

From beginner to expert level

#### [SDK documentation](/docs/server-sdks)

Complete reference guide

## How it works

Think of the AI agent as the **front end** of the call.
Its prompt and voice handle the conversation: understanding the caller, collecting details, and speaking naturally.
Your backend remains the backend, owning the business logic: prices, lookups, bookings, and rules.

Connecting the two is **SWAIG** (the SignalWire AI Gateway), which delivers the agent's tool calls
to your backend over HTTP.
The call itself never leaves SignalWire: the platform carries the audio, runs the speech models,
and holds the conversation state, so your code can run anywhere an HTTP endpoint can.
Because those models run inside the engine carrying the audio, no network hop sits between the
caller and the AI, which is what keeps replies quick and their timing steady from turn to turn.
[AI in the media path](/docs/platform/ai/capabilities#ai-in-the-media-path) walks through that
architecture.

```mermaid
flowchart LR
    Caller["Caller<br />PSTN · SIP · WebRTC"]

    subgraph SW["SignalWire platform"]
        Agent["AI agent<br />prompt · voice · caller intent"]
        SWAIG["SWAIG<br />SignalWire AI Gateway"]
    end

    subgraph BE["Your backend"]
        Webhook["Webhook<br />your server · any language"]
        Systems["Your systems<br />databases · APIs · rules"]
    end

    Caller <-->|conversation| Agent
    Agent -->|function call| SWAIG
    SWAIG -->|response + actions| Agent
    SWAIG -->|HTTP POST| Webhook
    Webhook -->|JSON reply| SWAIG
    Webhook <--> Systems
```

## Next steps

The guides below build one agent, a dispatcher for a taxi company called Bayview Taxi, from its first
prompt to a production script. Read them in order and each one picks up where the last left off.

#### [Tool calling](/docs/platform/ai/tool-calling)

How AI agents call your backend — and why business logic belongs in your code, not the prompt.

#### [Best practices](/docs/platform/ai/best-practices)

What it takes to hold up in production: latency, speech recognition, testing, and iteration.

#### [Platform capabilities](/docs/platform/ai/capabilities)

What the AI platform does, from the media path to analytics and compliance.