Building a reliable AI voice agent comes down to clear prompts, controlled parameters, and iterative testing. This guide explains how to structure an AI Agent prompt with readable formatting, define the agent’s role and limits, use “hints” to keep the agent on track, and tune parameters such as temperature and top_p to balance natural conversation with predictable behavior. It also covers practical habits like beta testing, monitoring usage and interaction metrics, and keeping up with platform changes as you refine the agent over time.
What is an AI voice 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 AI agent 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 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:
sections: main: - ai: prompt: text: | Your name is AI Agent. You are a virtual assistant for a business. ## Information on the business. ## Personality and Job Duties Here you can describe personality traits and job duties in plain language. ## Greeting Rules Greet the user and thank them for showing interest in the business. Prefix the greeting with a 'good morning', 'good afternoon', or a 'good evening' depending on the time of day. temperature: 0.89 top_p: 0.64 confidence: 0.5
Understanding voice 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 for creating AI agents
Apart from the core strategies mentioned above, here are some general best practices for creating an AI assistant:
Regularly review and update your AI agent to assess and fine-tune its performance and make any adjustments.
Perform beta testing with yourself and other real users before deployment. Gather feedback, identify areas of improvement, and adjust your prompt and parameters accordingly.
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.
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. If you encounter any issues as you create your new virtual AI agent, open a support ticket, or bring your questions to our community Discord!
Frequently asked questions
What is an AI Agent?
An AI Agent is a voice agent powered by AI that can handle customer service tasks like interactive voice response (IVR) and virtual receptionist workflows.
How do you write a good prompt for an AI voice agent?
Start by defining the agent’s identity and primary responsibilities in clear, concise language, then document role boundaries so the agent knows what it should not do. Keep the prompt readable and avoid overloading it with unnecessary details.
Why use Markdown formatting in AI Agent prompts?
Markdown helps structure prompts so they are easier to read, edit, and interpret consistently, especially when non-developers may need to maintain the prompt over time.
What are “hints,” and when should you use them?
Hints are a lightweight way to steer the agent toward an intended theme or set of behaviors using keyword guidance, which helps keep responses aligned with the scenario.
What do temperature and top_p do?
Temperature influences creativity and randomness in responses, and top_p influences how diverse responses can be. Lower values generally make the agent more consistent, while higher values introduce more variety.
What should you do before deploying an AI Agent to real callers?
Beta test with real users, review and refine the prompt and parameters based on feedback, and monitor usage and interaction metrics so you can improve quality while managing costs.