This release is a pre-release and may not be stable for production use.
SignalWire SDK for AI voice agents, live call control (RELAY) and REST. Run sw-pydocs for its documentation.
pip install signalwire-sdk==3.4.3.dev119 Copy PIP instructions
Build AI voice agents, control live calls over WebSocket, and manage every SignalWire resource over REST, all from one package.
pip install signalwire-sdk The package installs its own documentation. sw-pydocs prints a map of the SDK for the installed version, with the docs, examples and tutorials on disk, and sw-pydocs api reads signatures from the installed code. If you're a coding agent working with the SDK, start there:
sw-pydocs # the map: what the SDK does and where to start sw-pydocs agents # one topic: concepts, files to read, examples, API sw-pydocs api AgentBase # a signature, docstring and members AI Agents Each agent is a self-contained microservice that generates SWML (SignalWire Markup Language) and handles SWAIG (SignalWire AI Gateway) tool calls. The SignalWire platform runs the entire AI pipeline (STT, LLM, TTS), and your agent defines the behavior.
from signalwire import AgentBase from signalwire.core.function_result import FunctionResult class MyAgent(AgentBase): def __init__(self): super().__init__(name="my-agent", route="/agent") self.add_language(name="English", code="en-US", voice="inworld.Mark") self.prompt_add_section("Role", body="You are a helpful assistant.") @AgentBase.tool(name="get_time") def get_time(self): """Get the current time""" from datetime import datetime return FunctionResult(f"The time is {datetime.now().strftime('%H:%M:%S')}") if __name__ == "__main__": agent = MyAgent() agent.run() swaig-test checks the agent locally, without running a server:
swaig-test my_agent.py --list-tools swaig-test my_agent.py --dump-swml swaig-test my_agent.py --exec get_time Agent Features An agent built on AgentBase gets these features:
The examples/ directory contains 50+ working examples:
See examples/README.md for the full list organized by category.
Real-time call control and messaging over WebSocket. The RELAY client connects to SignalWire via the Blade protocol and gives you imperative, async control over live phone calls and SMS/MMS.
from signalwire.relay import RelayClient client = RelayClient( project="...", token="...", host="example.signalwire.com", contexts=["default"] ) @client.on_call async def handle(call): await call.answer() action = await call.play([{"type": "tts", "params": {"text": "Welcome!"}}]) await action.wait() await call.hangup() client.run() The RELAY client provides:
See the RELAY documentation for the full guide, API reference, and examples.
Synchronous REST client for managing SignalWire resources and controlling calls over HTTP. No WebSocket required.
from signalwire.rest import RestClient client = RestClient(project="...", token="...", host="example.signalwire.com") client.fabric.ai_agents.create(name="Support Bot", prompt={"text": "You are helpful."}) client.calling.play(call_id, play=[{"type": "tts", "params": {"text": "Hello!"}}]) client.phone_numbers.search(areacode="512") client.datasphere.documents.search(query_string="billing policy") The REST client provides:
See the REST documentation for the full guide, API reference, and examples.
The core package covers agents, RELAY and REST. The search extras add local document search; install the one that fits your needs:
# Core SDK (agents, RELAY, REST) pip install signalwire-sdk # With search (pick one based on your needs) pip install "signalwire-sdk[search-queryonly]" # Query pre-built .swsearch files (~400MB) pip install "signalwire-sdk[search]" # Build + query search indexes (~500MB) pip install "signalwire-sdk[search-full]" # + PDF, DOCX, Excel, HTML processing (~600MB) pip install "signalwire-sdk[search-all]" # All search features (~700MB) Documentation Full reference documentation is available at signalwire.com/docs/server-sdks.
Guides are also available in the docs/ directory. They're installed with the package, with the examples and tutorials: sw-pydocs path prints where.
# Install dev dependencies pip install -r requirements-dev.txt # Run the test suite pytest # Run by category pytest -m unit pytest -m integration pytest -m skills # Coverage pytest --cov=signalwire --cov-report=html License MIT. See LICENSE for details.
search-queryonly search search-full search-nlp search-all pgvector mcp-gateway all
signalwire ai agents voice telephony swaig swml
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.




