Lesson 1: Introduction to SignalWire Agents 🔗 ↑ TOC

Welcome to your journey of building Fred, a friendly Wikipedia-powered AI assistant! In this first lesson, we'll explore what SignalWire AI Agents are and why they're powerful for building voice applications.

Table of Contents 🔗 ↑ TOC

  1. What is SignalWire?
  2. Understanding AI Agents
  3. The SDK Architecture
  4. What We're Building
  5. Key Concepts

What is SignalWire? 🔗 ↑ TOC

SignalWire is a communications platform that enables developers to build voice, video, and messaging applications. Think of it as the infrastructure that connects your AI agent to phone calls, allowing your bot to have real conversations with people.

Key Features:

Understanding AI Agents 🔗 ↑ TOC

An AI Agent in the SignalWire context is a Python application that:

  1. Listens for incoming calls via HTTP endpoints
  2. Generates SWML documents (SignalWire Markup Language) that define behavior
  3. Processes voice input and generates appropriate responses
  4. Executes functions based on user requests

The Communication Flow 🔗 ↑ TOC

User calls → SignalWire Platform → Your Agent → SWML Response → AI Conversation

The SDK Architecture 🔗 ↑ TOC

The SignalWire AI Agents SDK provides a clean abstraction layer:

from signalwire_agents import AgentBase

class MyAgent(AgentBase):
    def __init__(self):
        super().__init__(name="My Agent", route="/agent")

Core Components:

  1. AgentBase Class: The foundation all agents inherit from
  2. Skills System: Modular capabilities you can add with one line
  3. SWAIG Functions: Tools the AI can call during conversations
  4. Prompt Object Model (POM): Structured way to define agent behavior

What We're Building 🔗 ↑ TOC

Fred is a voice-enabled Wikipedia assistant that demonstrates:

Fred's Capabilities 🔗 ↑ TOC

By the end of this tutorial, Fred will be able to:

  1. Search Wikipedia for any topic
  2. Share fun facts about Wikipedia itself
  3. Engage naturally in educational conversations
  4. Handle voice calls through SignalWire

Key Concepts 🔗 ↑ TOC

Before we start coding, let's understand these essential concepts:

1. SWML (SignalWire Markup Language) 🔗 ↑ TOC

SWML is a JSON document that tells SignalWire how your agent should behave. It includes:

2. SWAIG (SignalWire AI Gateway) 🔗 ↑ TOC

SWAIG enables your agent to execute functions during conversations. When a user asks Fred to search Wikipedia, SWAIG handles the function call and returns results.

3. Skills 🔗 ↑ TOC

Skills are pre-built, reusable modules that add capabilities to your agent. Instead of writing Wikipedia search from scratch, we'll use the existing skill:

agent.add_skill("wikipedia_search")

4. HTTP Endpoints 🔗 ↑ TOC

Your agent exposes HTTP endpoints that SignalWire calls:

5. Authentication 🔗 ↑ TOC

Agents use HTTP Basic Authentication for security. The SDK handles this automatically, generating credentials or using environment variables.

Why This Architecture? 🔗 ↑ TOC

Benefits:

  1. Separation of Concerns: Your code focuses on logic, not telephony
  2. Scalability: Agents can handle multiple concurrent calls
  3. Flexibility: Easy to add new capabilities
  4. Testing: Can test locally without phone infrastructure

Next Steps 🔗 ↑ TOC

Now that you understand the concepts, let's set up your development environment!

➡️ Continue to Lesson 2: Setting Up Your Environment


Review Questions:

  1. What is the purpose of SWML?
  2. How do skills enhance an agent's capabilities?
  3. What are the two main HTTP endpoints an agent exposes?

Answers:

  1. SWML defines how the agent behaves during calls (personality, functions, voice settings)
  2. Skills provide pre-built, tested functionality that can be added with one line of code
  3. GET endpoint for SWML configuration, POST endpoint for SWAIG function execution

← Back to Overview | Next: Environment Setup →