Skip to content

SignalWire AI is built for unlimited programmability and scale. Integrate AI and deploy a MVP with low-code/no-code drag-and-drop tools, then scale your application on SignalWire’s cloud platform.

Quickstart

Deploy a serverless AI Agent and call it over the PSTN in under 5 minutes.

1

Create a free account

Register your SignalWire account.

2

Import SWML script

Open the RELAY / SWML tab in your SignalWire Dashboard, paste the following script, and hit Save.

Fun fact

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

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.

3

Assign a phone number

Buy a phone number using your $5 promotional credit.

4

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 the most powerful and flexible way to use AI on the SignalWire platform.

SWML is a structured language for configuring and orchestrating real-time communication applications using lightweight and readable JSON or YAML files. These SWML Scripts can be deployed serverlessly in SignalWire’s cloud, or from your server.

SWML’s ai method integrates advanced AI Agents, which can interact with external APIs.

Technical reference\ \ 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\ \ Getting started guide

Call Flow Builder

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

Call Flow Builder\ \ Guide to the AI Agent node

Agents SDK

Build powerful custom voice AI agents with Python. The SignalWire Agents SDK provides complete programmatic control for sophisticated voice applications.

Quick Start\ \ Build your first agent in 5 minutes Examples\ \ Progressive examples from simple to advanced Prefab Agents\ \ Ready-to-use agent templates

Use cases

Simple AI Phone Call

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

Agents SDK
SWML
Call Flow Builder
from signalwire import AgentBase

# Create an agent and assign a route
agent = AgentBase("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()

Agents SDK docs | Quickstart guide

FAQ Bot

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

Agents SDK
SWML
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()

Agents SDK docs | FAQ Bot prefab

Customer Service Agent

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

Agents SDK
SWML
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()

Agents SDK docs | Custom functions guide

Hotel Concierge

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

Agents SDK
SWML
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()

Agents SDK docs | Concierge prefab

Appointment Scheduling

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

Agents SDK
SWML
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()

Agents SDK docs | InfoGatherer prefab

Survey

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

Agents SDK
SWML
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()

Agents SDK docs | Survey prefab

Receptionist

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

Agents SDK
SWML
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()

Agents SDK docs | Receptionist prefab

Lead Qualification

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

Agents SDK
SWML
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()

Agents SDK docs | InfoGatherer prefab

Real-Time Transcription

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

Agents SDK
SWML
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()

Agents SDK docs | Call recording guide

View All Examples\ \ From beginner to expert level SDK Documentation\ \ Complete reference guide


How does it work?

Under the hood, the SignalWire AI Gateway (SWAIG) orchestrates the many supporting services that make integrated realtime voice AI possible.

  • AI Agent
  • Prompt
  • LLM
  • SWAIG Functions
  • TTS (Text-To-Speech) Providers

[AI Agent diagram.]

[AI Agent diagram.]

SignalWire Developer Documentation