Contact Sales

All fields are required

Advanced communications from the source. | SignalWire

Tips for Building Your First AI Agent with SignalWire

Best practices for creating an AI voice agent

What is an AI Agent?

SignalWire AI Agent is a voice agent powered by artificial intelligence. A dynamic conversational AI tool for building smarter voice applications, an AI agent can perform customer service functions, acting as an IVR or a virtual receptionist. Even the most basic AI voice agent can answer the phone to respond to customer queries or offer tier 1 support.

With a little extra coding in either YAML or JSON, you can integrate your AI agent with backend CRM systems to schedule calendar appointments, send text messages, and perform other functions.

When creating even a simple AI agent, you must offer clear instructions and parameters to the AI. In this post, we’ll delve into some best practices to ensure your SignalWire AI Agent operates seamlessly while offering a top-notch customer experience.

If you’re interested in specific code examples and additional functions, check out our developer guide to best practices for creating an AI virtual agent.

Tips for prompt writing

The initial prompt is the backbone of your AI Agent's performance. The AI can only function as far as what you tell it to do.

We recommend structuring your prompts with Markdown for organized and well-functioning content. Most of the prompt will then be written in plain text language, making it easy for almost anyone to edit. This enhances readability, simplifies editing, and also ensures that the AI interprets the content accurately.

When writing the prompt, make sure you succinctly outline the AI's identity and primary responsibilities. This will help the AI understand its mission and respond appropriately. However, steer clear of overwhelming your virtual assistant with too much information. Instead, provide a concise overview that clearly defines the AI's role and limitations.

Depending on how you want to use your AI agent, you can also add a “hints” section for it to follow after your prompt. Hints are your secret weapon for keeping the AI on track and aligned with any given context. Hints offer keyword guidance to direct the AI’s attention, ensuring it stays focused on an intended theme.

Lastly, be sure to open a support ticket if you’re having any trouble with your AI agent. Our team of world-class experts is here to help.

Below is a starter format for a basic AI voice assistant with a prompt and parameters:

Understanding AI parameters

In the above example, parameters are listed just below the initial prompt. These parameters allow you to fine-tune the AI’s response. They will always be a value between 0 and 1, and you may have to test specific values in order to get the result you want.

The temperature parameter influences the AI's response creativity. Lower values closer to 0 make responses more focused, while higher values introduce more variety. The closer the value is to 1, the more random the response will be. The closer the value to 0, the more likely the AI is to do the same thing every time.

The top_p parameter also determines the diversity of the AI's responses. Lower values narrow down potential responses, while higher values make them more varied. The closer this value is to 0, the more likely it is to follow established patterns.

The temperature and top_p parameters are similar and related to each other. For natural, engaging, yet somewhat controlled conversational responses, consider setting both of these parameters closer to 0.5.

The confidence parameter can impact the truthfulness of the AI. A value closer to 0 reduces the pause time after user interaction, but it can lead to false positive responses.

The presence_penalty and frequency_penalty are also parameters that can be added. Presence penalty controls the AI’s tendency to introduce more topics. A positive value makes diversified responses more likely. Frequency penalty determines the AI’s inclination to repeat itself, with positive values discouraging repetition.

Additional best practices

Apart from the core strategies mentioned above, here are some general best practices for creating an AI assistant:

  1. Regularly review and update your AI agent to assess and fine-tune its performance and make any adjustments.

  2. Perform beta testing with yourself and other real users before deployment. Gather feedback, identify areas of improvement, and adjust your prompt and parameters accordingly.

  3. Keep up-to-date with SignalWire changes. AI is constantly evolving, and the platform along with it. Regularly check up on documentation and other resources.

  4. Monitor your metrics - token usage, user interaction times, and any other relevant data - to optimize your AI’s performance and manage costs.

Get started for free when you sign up for a SignalWire account with code SWAIG. If you encounter any issues as you create your new virtual AI agent, open a support ticket, or bring your questions to our community Slack channel!

Related Articles