SignalWire AI

Programmable, integrated, realtime voice AI
View as MarkdownOpen in Claude

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
1version: 1.0.0
2sections:
3 main:
4 - ai:
5 prompt:
6 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.

AI Agents

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

Call Flow Builder

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

Agents SDK

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

Use cases

Simple AI Phone Call

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

1from signalwire import AgentBase
2
3# Create an agent and assign a route
4agent = AgentBase("My Assistant", route="/assistant")
5
6# Add some basic capabilities
7agent.add_skill("datetime") # Current date/time info
8agent.add_skill("math") # Mathematical calculations
9
10# Start the agent
11if __name__ == "__main__":
12 agent.run()

Agents SDK docs | Quickstart guide

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

1from signalwire.prefabs import FAQBotAgent
2
3agent = FAQBotAgent(
4 faqs=[
5 {
6 "question": "What are your hours?",
7 "answer": "We're open 9 AM to 5 PM, Monday to Friday."
8 },
9 {
10 "question": "Where are you located?",
11 "answer": "123 Main Street, Downtown."
12 }
13 ]
14)
15
16if __name__ == "__main__":
17 agent.run()

Agents SDK docs | FAQ Bot prefab

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

1from signalwire import AgentBase, FunctionResult
2
3agent = AgentBase(name="support")
4agent.prompt_add_section("Role", "You are a helpful customer service agent.")
5
6@agent.tool(description="Look up customer account")
7def lookup_account(account_id: str) -> FunctionResult:
8 # Simulate database lookup
9 customer = {"name": "John Doe", "status": "active"}
10 return FunctionResult(f"Account: {customer['name']}, Status: {customer['status']}")
11
12@agent.tool(description="Transfer to support")
13def transfer_support() -> FunctionResult:
14 return FunctionResult("Connecting you to support.").connect("+15551234567")
15
16if __name__ == "__main__":
17 agent.run()

Agents SDK docs | Custom functions guide

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

1from signalwire.prefabs import ConciergeAgent
2
3agent = ConciergeAgent(
4 venue_name="Grand Hotel",
5 services=["room service", "spa bookings", "restaurant reservations"],
6 amenities={
7 "pool": {"hours": "7 AM - 10 PM", "location": "2nd Floor"},
8 "gym": {"hours": "24 hours", "location": "3rd Floor"}
9 }
10)
11
12if __name__ == "__main__":
13 agent.run()

Agents SDK docs | Concierge prefab

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

1from signalwire import AgentBase, FunctionResult
2from datetime import datetime
3
4appointments = []
5
6agent = AgentBase(name="scheduler", route="/scheduler")
7agent.prompt_add_section("Role", "You help customers schedule appointments.")
8agent.prompt_add_section("Guidelines", """
9- Collect customer name, date, and preferred time
10- Confirm all details before booking
11- Send SMS confirmation when booking is complete
12""")
13agent.add_language("English", "en-US", "rime.spore")
14
15@agent.tool(description="Check if a time slot is available")
16def check_availability(date: str, time: str) -> FunctionResult:
17 for apt in appointments:
18 if apt["date"] == date and apt["time"] == time:
19 return FunctionResult(f"Sorry, {date} at {time} is not available.")
20 return FunctionResult(f"{date} at {time} is available.")
21
22@agent.tool(description="Book an appointment")
23def book_appointment(
24 name: str,
25 phone: str,
26 date: str,
27 time: str
28) -> FunctionResult:
29 appointments.append({
30 "name": name,
31 "phone": phone,
32 "date": date,
33 "time": time,
34 "booked_at": datetime.now().isoformat()
35 })
36 return (
37 FunctionResult(f"Appointment booked for {name} on {date} at {time}.")
38 .send_sms(
39 to_number=phone,
40 from_number="+15559876543",
41 body=f"Your appointment is confirmed for {date} at {time}."
42 )
43 )
44
45if __name__ == "__main__":
46 agent.run()

Agents SDK docs | InfoGatherer prefab

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

1from signalwire.prefabs import SurveyAgent
2
3agent = SurveyAgent(
4 survey_name="Customer Satisfaction Survey",
5 questions=[
6 {
7 "id": "satisfaction",
8 "text": "How satisfied were you with our service?",
9 "type": "rating",
10 "scale": 5
11 },
12 {
13 "id": "recommend",
14 "text": "Would you recommend us to others?",
15 "type": "yes_no"
16 },
17 {
18 "id": "comments",
19 "text": "Any additional comments?",
20 "type": "open_ended",
21 "required": False
22 }
23 ]
24)
25
26if __name__ == "__main__":
27 agent.run()

Agents SDK docs | Survey prefab

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

1from signalwire.prefabs import ReceptionistAgent
2
3agent = ReceptionistAgent(
4 departments=[
5 {
6 "name": "sales",
7 "description": "Product inquiries, pricing, and purchasing",
8 "number": "+15551234567"
9 },
10 {
11 "name": "support",
12 "description": "Technical help and troubleshooting",
13 "number": "+15551234568"
14 },
15 {
16 "name": "billing",
17 "description": "Payment questions and account issues",
18 "number": "+15551234569"
19 }
20 ]
21)
22
23if __name__ == "__main__":
24 agent.run()

Agents SDK docs | Receptionist prefab

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

1from signalwire.prefabs import InfoGathererAgent
2
3agent = InfoGathererAgent(
4 questions=[
5 {"key_name": "name", "question_text": "What is your name?"},
6 {"key_name": "company", "question_text": "What company are you with?"},
7 {"key_name": "phone", "question_text": "What is your phone number?", "confirm": True},
8 {"key_name": "budget", "question_text": "What is your budget range for this project?"},
9 {"key_name": "timeline", "question_text": "What is your timeline for making a decision?"}
10 ],
11 name="lead-qualifier"
12)
13
14agent.prompt_add_section(
15 "Role",
16 "You are qualifying leads for the sales team. Be friendly and professional."
17)
18
19if __name__ == "__main__":
20 agent.run()

Agents SDK docs | InfoGatherer prefab

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

1from signalwire import AgentBase, FunctionResult
2
3agent = AgentBase(name="transcription-agent")
4agent.add_language("English", "en-US", "rime.spore")
5agent.prompt_add_section("Role", "You are a helpful assistant. The call is being recorded for transcription.")
6agent.set_params({"save_conversation": True})
7
8@agent.tool(description="Start recording the call for transcription")
9def start_recording() -> FunctionResult:
10 return (
11 FunctionResult("Recording has started.")
12 .record_call(
13 control_id="transcription",
14 stereo=True,
15 format="wav"
16 )
17 )
18
19if __name__ == "__main__":
20 agent.run()

Agents SDK docs | Call recording 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.