A well-written prompt is the difference between an agent that sounds robotic and one that handles real conversations naturally. This guide covers the key principles and patterns for writing prompts on OSVI.Documentation Index
Fetch the complete documentation index at: https://docs.osvi.ai/llms.txt
Use this file to discover all available pages before exploring further.
Anatomy of a Good System Prompt
Every agent prompt should cover four things:- Identity — who the agent is and who it works for
- Goal — what the agent is trying to accomplish in this conversation
- Rules — constraints on what the agent can and cannot do
- Tone — how the agent should sound
Writing for Voice vs Chat
Voice and chat conversations have different rhythms. Keep these differences in mind:| Voice | Chat | |
|---|---|---|
| Sentence length | Short — listeners can’t re-read | Medium — readers can scan |
| Lists | Avoid bullet points; say “first… second… third…” | Lists and formatting work well |
| Confirmation | Repeat key information back (“So that’s order number 1234, correct?”) | Less repetition needed |
| Pace | Build in natural pauses with short sentences | Not applicable |
Single-Prompt Agents
For straightforward workflows, a single prompt is usually enough. Structure it as:Multi-Prompt Agents
Multi-prompt agents let you define distinct states, each with its own prompt and transition conditions. Use this when your flow has meaningful branches. When to use multi-prompt:- The conversation has 3+ distinct phases (greeting → qualification → closing)
- Different parts of the conversation require very different tones or instructions
- You want explicit control over when the agent moves between topics
- Name states clearly:
greeting,qualification,objection_handling,closing - Keep each state prompt focused — it should only describe what happens in that state
- Define clear transition triggers: “Move to
closingwhen the user agrees to a demo”
Using additional_data
The additional_data field on POST /call lets you inject runtime context into the agent’s prompt. Reference it with {{variable_name}} syntax.
In your API call:
Using Jinja for Dynamic System Prompts
OSVI system prompts are rendered as Jinja2 templates before the call begins. This means you can use the full Jinja syntax — not just simple variable substitution — to build prompts that adapt to your data.Variable Substitution
The most common use. Any key fromadditional_data (or the top-level person_name) is available as a Jinja variable:
Conditionals
Use{% if %} to include or exclude sections of the prompt based on the data passed in:
Loops
Use{% for %} to enumerate lists — useful when the agent needs to cover multiple items:
Default Values
Use thedefault filter to guard against missing fields so the prompt doesn’t break if a value isn’t provided:
Filters
Jinja filters let you transform values inline:Passing Data from the API
All Jinja variables are populated from theadditional_data object and the top-level person_name field in your POST /call request:
Common Mistakes to Avoid
Prompts that are too vague
Prompts that are too vague
Bad: “Help the user with their query.”Good: “Help the caller track their order status. Ask for their order number and registered email address to look up the order.”Vague prompts lead to inconsistent behaviour. Be specific about the goal and the steps.
Too many rules at once
Too many rules at once
Long lists of rules are hard for the model to follow consistently. Group related rules together, and prioritise the most important ones at the top.
Not handling the 'wrong person' case
Not handling the 'wrong person' case
For outbound calls, always define what the agent should do if someone other than the intended contact answers. Example: “If the person who answers is not
{{person_name}}, ask them to pass on the message and end the call politely.”No defined ending
No defined ending
Agents need to know how and when to end a conversation. Always include a closing instruction: “Once you have confirmed the appointment, thank the caller and end the call.”
Using text formatting in voice prompts
Using text formatting in voice prompts
Markdown, bullet points, and bold text don’t translate to speech. Write voice prompts as plain prose, the way you’d actually say it.
Prompt Testing Checklist
Before deploying an agent, test these scenarios:- Happy path — the conversation goes exactly as planned
- Wrong person answers the call
- User goes off-topic or asks something unrelated
- User refuses or says they’re not interested
- User asks to speak to a human
- User gives ambiguous or incomplete answers
- User interrupts the agent mid-sentence
