Prompt design
The system prompt is the most important factor in determining how your agent behaves. A well-structured prompt produces consistent, predictable responses.
This page covers practical patterns for writing effective system prompts for voice agents.
Prompt structure
A clear structure helps the LLM understand its role, objectives, and constraints. Use the following sections as a starting point:
Role and context
Define who the agent is and what situation it is operating in. Include the business name, the agent's purpose, and any relevant background the LLM needs to handle the conversation correctly. Use template variables to personalize this section per caller.
Objectives
List the specific tasks the agent should accomplish during the call. Keep objectives concrete and ordered by priority. The LLM will attempt to complete them in order unless the conversation takes a different path.
Tone and personality
Define how the agent should communicate. For voice agents, shorter and clearer responses work better than long explanations. Specify how the agent should handle edge cases such as unclear input, silence, or frustrated callers.
Template variables
Template variables allow you to personalize the system prompt, greeting message, and failure message with dynamic values at the start of each call. Define variables in your prompt text using the syntax {{variable_name}}, then pass the corresponding values when starting a call through a campaign contact list.
For example, a system prompt for a clinic reminder agent might use:
When the agent starts a call, Studio replaces each {{variable_name}} with the value provided for that session.
You can use template variables in the following fields:
- System prompt
- Greeting message
- Failure message
Pass variable values
For campaigns, add variable values as columns in your contact list CSV. Each column name maps to a variable name in your prompts. See Contact list format for details.
Tips for voice agents
Voice agents have different constraints than text-based chatbots. Keep the following in mind when writing prompts:
- Keep responses short: Callers lose attention quickly. Instruct the agent to keep responses to one or two sentences where possible.
- Avoid lists and formatting: The TTS component reads text aloud. Bullet points, headers, and markdown formatting produce unnatural speech.
- Handle silence explicitly: Instruct the agent what to do if the caller does not respond. For example:
If the caller does not respond within a few seconds, repeat your last question once before ending the call. - Define a clear exit condition: Specify when and how the agent should end the call. For example:
End the call politely once the appointment outcome is confirmed. - Test with real scenarios: Write 2-3 realistic conversation scenarios before testing. This helps you identify gaps in your prompt before they appear in production.
Iterating on prompts
Make small changes and test after each one. Changing multiple things at once makes it difficult to identify what caused a change in behavior.
The recommended iteration loop is:
- Edit the system prompt or greeting message.
- Start a test session in the agent editor.
- Simulate 2-3 conversation scenarios.
- Review the transcript for unexpected responses.
- Refine and repeat.
See Test your agent for details on using the test interface.
Next steps
- Customize your agent: Configure ASR, LLM, and TTS settings in the agent editor
- Test your agent: Test and troubleshoot your agent before deployment