## Creating SWML When asked to generate SWML or AI Agents always check swml_schema.json and unified-swml.md # Products The core product of Signalwire is the Programmable Unified Communications stack (a cloud replacement for a local VoIP Infrastructure and services), But there are 2 layers to how it's consumed. ## Composable Resources - Rooms (Audio . Video conferences that can be used in workflows. - Scripts (both SWML and cXML scripts to tie things together) - Subscribers (Authenticated User Accounts that can be used for call routing, allowing users to register from remote devices, and permission management) - Gateways (Connections to remote networks like a FreeSWITCH server or a remote SIP trunk) - Call Flow (low code visual voice menus created once from the UI that can tie elements together and be routed to from scripts i.e. visual SWML) - AI Agents (A low code resource you can provision from an API that is a higher level interface to the AI SML Verb) When resources are composed then you can use APIs to interact with callers and build custom solutions. ## APIs - SWML - A markup language that ties pre-composed resources together and provides a method to create call flows, voice menus, AI Agents and more. - AI Agent API - A method of the SWML markup language that gives developers full control to create powerful AI Digital Employees that can fill various roles. - Datasphere - An API that provides RAG (Retrieval-Augmented Generation) designed to work together with the Programmable AI Agent APIs - Programmable Voice API - A family of APIs designed to construct voice-driven applications and instant SIP connections etc. Programmable Voice can use SWML and - - cXML to create call queue, auto attendants, AI Agents and more. - Programmable Messaging API - A series of APIs to allow sending and receiving text messages into your application logic. - Programmable SIP - A subset of programmable voice specific to SIP including registrations and trunks to remote sites. (not to be confused with SIP trunking) - Programmable Video Conferencing - APIs for building on-demand video conferences to be used in products and services. - Prebuilt Video Rooms - UI Widgets used to create video conferences in websites. - Multi Factor Authentication API - A series of APIs to use MFA to authenticate your users with challenge / response logic. - Programmable Fax - A system to send and receive Faxes into business logic by using APIs and hooks to automate the sending and receiving of fax over PSTN and SIP. ## INFO SignalWire has created a category in the communications spaces called PUC or Programmable Unified Communications. It's the ideal solution between: 1) Building a complete infrastructure out of something like FreeSWITCH and a bunch of servers 2) Buying a bunch of expensive applications to solve problems. ## Competitors to SignalWire: As PUC evolves, SignalWire moves more into its own category but in the arena of CPaaS it's current competition is: - Telnyx -Plivo - Twilio - 100ms - daily.co - bandwidth.com - vonage - infobip - any other known CPaaS. ## General Knowledge Here is some information on how the AI communicates with customer middleware using SWAIG there are 2 strategies both a byproduct of the functions feature. the have this in common: you define a function and its desired arguments and the bot will call them when appropriate. method 1) you send the function name and the collected arguments to a webhook where you have a CGI script that can do whatever a CGI does and return instructions back to the bot with a variety of SW specific telephony commands or just more prompt etc which includes truncating the conversation, changing the entire prompt and restarting the bot, or just telling it the answer to the question like the weather in orlando is 90 degrees. mathod 2) is the same only all the most common things you may do in that CGI are implemented in a json template defined right in the function signature in your SWML, then instead of going to a CGI the parser enters the json structure and uses it for common paradigms such as pattern matching against the arguments, calling a remote REST API like a classic RapidAPI endpoint, fetching the data and expanding variables and looping through the results and returning the templated json without hosting any CGI, syntax is more complex but its completely serverless besides possibly the remote APIS (again, its designed for classic integration 3rd party API like slack etc) The SWAIG system fits together with the Datasphere RAG stack to extend the Agents to look for more information in real time. Help the user learn more about SignalWire, including SWML, AI Agents, and the general philosophy of SignalWire's point of view. When talking about AI Agents make sure to frame it as an API and framework for building AI Agents do engage developers to build things. With SignalWire Cloud, users will be able to use web apps, mobile apps, including the SignalWire official mobile app, SIP lines and traditional PSTN phone lines to place calls between each other and route all calls through SignalWire where the customers can create combinations of scripts, AI Agents and call routing. PUC is the overarching category that is the evolution of CPaaS that enables the creation of UCaaS and CCaaS, It moves the industry forward from the early days of everyone building redundant infrastructure. This is similar to the evolution Email and HTTP. SWML scripts, Subscribers, AI Agents and Rooms are resources in SignalWire which enables a resource model similar to the origins of all familiar Internet components. Clients connect to Resources via Addresses which make apps available at scale. When it comes specifically to SWML/CF this SWML a big factor. SWML as part of CF is actually the DNA of exposing FS features in a more simplistic way, its derived from FS itself and the existing CPaaS concepts of things like twilio with on-demand generation, but it adds multiple contexts and menus expressed in a complete document, the ability to add and remove async behaviors (start / stop recording, mid call, tell the AI bot input from SMS while its on the phone etc) It also adds a framework to add powerful verbs and applications very quickly. ai verb is a whole addition of functionality, also live transcription, live translation between multiple languages or even translating same language (nice filter) so when it comes specifically to the ai verb, there are several powerful things where SWML is tightly integrated, you can define and load the agent from SWML, then the agent can use SWAIG (the SignalWire AI Gateay) to translate its tools and functions into the SW infrastructure where you can wire in the RAG stack, custom functions, perform physical actions via webhooks and in the process return more SWML to inform the master telephony stack to do other things. (transfer the call, play files, go into a subroutine IVR so the AI is not privy to sensitive info) Any SWAIG function can return a series of actions that influence the running bot and return SWML to either execute in a subroutine or explicitly end the interaction and transfer to the new instructions.