Quick Start: Your First Agent
Quick Start: Your First Agent
The Minimal Agent
Python
TypeScript
my_first_agent.py
Run the Agent
You’ll see output like:

The SDK shows:
- Security configuration (SSL, CORS, rate limits)
- Service initialization details
- Basic auth credentials (username and password)
- Server startup information
Test the Agent
Open a new terminal and test with curl. Use the Basic Auth credentials shown in the agent output:
The -u flag provides Basic Auth credentials in the format username:password. Use the exact password shown in your agent’s startup output.
You’ll see JSON output like:
What Just Happened?
1. You run: python my_first_agent.py
Agent starts a web server on port 3000.
2. SignalWire (or curl) sends: GET http://localhost:3000/
Agent returns SWML document (JSON).
3. SWML tells SignalWire:
- Answer the call
- Use this AI prompt (your personality config)
- Use this voice (rime.spore)
- Use English language
4. SignalWire’s AI:
- Converts caller’s speech to text (STT)
- Sends text to AI model (GPT-4, etc.)
- Gets AI response
- Converts response to speech (TTS)
Adding a Custom Function
Let’s add a function the AI can call:
Python
TypeScript
Now when a caller asks for a joke, the AI will call your tell_joke function!
Using the Debug Endpoint
The agent provides a debug endpoint to inspect its configuration:
This shows detailed information about:
- Registered functions
- Prompt configuration
- Voice settings
- Authentication credentials
Test with swaig-test CLI
The SDK includes a CLI tool for testing:
Complete Example with Multiple Features
Here’s a more complete example showing common patterns — voice, hints, prompts, and multiple tools.
Python
TypeScript
Next Steps
Your agent is running locally, but SignalWire can’t reach localhost. You need to expose it to the internet.
Continue to:
- Development Environment - Set up a professional project structure with environment variables and testing
- Exposing Your Agent - Make your agent accessible via ngrok so SignalWire can reach it
Or jump ahead to:
- architecture - Understand SWML, SWAIG, and the request lifecycle
- Building Agents - Learn all agent configuration options