Guide for creating effective prompts and instructions for LiveKit voice agents...
Create production-ready prompts for LiveKit voice agents that work seamlessly with text-to-speech systems.
For most use cases, follow this simple workflow:
assets/templates/ that matches your use casescripts/validate_prompt.pySelect the template that best matches your needs:
General Purpose:
Basic Assistant (basic-assistant.txt) - Simple conversational agent
Tool-Enabled Agent (tool-enabled-agent.txt) - Agent with function calling
Customer Service (customer-service.txt) - Support agent with escalation
Specialist Agent (specialist-agent.txt) - Task-specific agent (reservations, orders, etc.)
Multi-Agent Coordinator (multi-agent-coordinator.txt) - Routes to other agents
Industry-Specific:
Front Desk Receptionist (front-desk-receptionist.txt) - Professional call routing
Debt Collection (debt-collection-agent.txt) - Compliant recovery agent
Open your selected template and fill in the placeholders:
Example - Customizing basic-assistant.txt:
Template:
You are [NAME], a friendly voice assistant. You are [TRAIT_1] and [TRAIT_2], with [TRAIT_3].
Customized:
You are Casey, a friendly voice assistant. You are helpful and patient, with a sense of humor.
Key customization areas:
Ensure your prompt includes these critical voice optimization rules:
Required elements:
Keep your responses brief - 1-3 sentences. Respond in plain text only - no emojis, asterisks, markdown, or special formatting. Ask one question at a time.
For agents that mention numbers, prices, or contact info:
Spell out numbers ("fifteen" not "15"). Spell phone numbers digit by digit ("5-5-5, 1-2-3-4"). For URLs, omit "https://" and say "dot" for periods.
For agents with tools:
If a tool call fails, explain the issue simply and suggest a fallback. Summarize tool results in conversational language - don't recite technical IDs or raw data.
Run the validation script to check for common issues:
python scripts/validate_prompt.py your_prompt.txt
The validator checks for:
Fix any errors before deploying your prompt.
Deploy your prompt in a LiveKit agent and test with real conversations:
Test scenarios:
Based on testing, refine your prompt:
Common refinements:
Voice agents differ from text chatbots:
Critical differences:
Implications for prompts:
Every voice agent prompt should have:
Additional sections (domain context, guardrails, handoffs) add as needed.
Use templates when:
Write custom when:
Even with custom prompts, reference the templates for voice optimization patterns.
Load reference documentation based on your specific needs:
For all users:
Load prompt-components.md when:
Load voice-optimization.md when:
Load tool-integration.md when:
Load examples.md when:
Load industry-best-practices.md when:
Load iterative-improvement.md when:
Strategy: Start minimal (templates + SKILL.md). Load references only when you hit specific challenges or need deeper guidance.
For systems with multiple agents, design each agent separately:
Pattern:
Coordinator/Greeter - Uses multi-agent-coordinator.txt
Specialist Agents - Use specialist-agent.txt
Key considerations:
Template: basic-assistant.txt
Use for: Chat, demos, general assistance
Prompt structure:
Example use cases:
Template: tool-enabled-agent.txt
Use for: Looking up data, answering questions from external sources
Prompt structure:
Example use cases:
Template: specialist-agent.txt
Use for: Booking, ordering, scheduling, transactions
Prompt structure:
Example use cases:
Template: customer-service.txt
Use for: Help desk, customer support, troubleshooting
Prompt structure:
Example use cases:
Symptoms: TTS says "asterisk asterisk hello" or skips characters
Solution: Ensure prompt includes:
Respond in plain text only - no emojis, asterisks, markdown, or special formatting.
Prevention: Run validation script
Symptoms: Users interrupt frequently, seem impatient
Solution: Add stricter constraints:
Keep responses very brief - 1-2 sentences maximum. Ask one question at a time.
Prevention: Test with real users early
Symptoms: "Dollar sign forty-nine point nine nine" or unclear prices/phone numbers
Solution: Add number formatting rules:
Spell out numbers ("forty-nine ninety-nine" for prices). Spell phone numbers digit by digit ("5-5-5, 1-2-3-4").
Symptoms: Tools called at wrong time, missing parameters, no error handling
Solution:
Check: Load tool-integration.md for detailed patterns
Symptoms: Agent tries to handle requests beyond capabilities
Solution: Add boundaries and guardrails:
You can only help with [specific domain]. For questions about [out-of-scope topics], direct users to [alternative resource].
Symptoms: Abrupt handoffs, lost context, repeated questions
Solution:
Check: See multi-agent examples in examples.md
For agents that should convey emotion, use descriptive language:
Good:
When users share good news, respond warmly and enthusiastically. When they express frustration, respond with empathy and patience.
Avoid: Trying to use emojis, asterisks, or formatting to convey emotion.
Trust TTS: Modern TTS systems convey emotion through intonation based on word choice.
Different TTS providers have different characteristics:
Universal best practices work across all providers:
Test your specific provider to identify any quirks.
For healthcare, finance, or other regulated industries:
Add explicit constraints:
Never:
- Share customer information without verification
- Provide medical/legal/financial advice
- Process transactions without explicit confirmation
Be security-conscious:
For security, you'll need to verify identity before providing account information.
Escalate appropriately:
For [sensitive issue], immediately transfer to [appropriate specialist].
See healthcare and banking examples in examples.md.
Templates:
General Purpose:
assets/templates/basic-assistant.txt - Simple conversational agentassets/templates/tool-enabled-agent.txt - Agent with function callingassets/templates/customer-service.txt - Support with escalationassets/templates/specialist-agent.txt - Task-specific workflowsassets/templates/multi-agent-coordinator.txt - Router/greeter agentIndustry-Specific:
assets/templates/front-desk-receptionist.txt - Professional call routing and receptionassets/templates/debt-collection-agent.txt - Compliant debt recovery (FDCPA/TCPA)Reference Documentation:
references/prompt-components.md - Detailed component guidereferences/voice-optimization.md - TTS formatting deep divereferences/tool-integration.md - Function calling patternsreferences/examples.md - Complete real-world promptsreferences/industry-best-practices.md - Industry-specific patterns and compliancereferences/iterative-improvement.md - Systematic prompt refinement and testingTools:
scripts/validate_prompt.py - Validation scriptExternal Resources:
Scenario: Build a pizza ordering agent
Step 1: Choose template
specialist-agent.txtStep 2: Customize
You are Marco, an order specialist at Mario's Pizza. You are friendly, efficient, and helpful.
Keep responses very brief - 1-2 sentences. Plain text only, no formatting. Ask one question at a time.
Our menu:
- Margherita: twelve dollars
- Pepperoni: fourteen dollars
- Veggie Supreme: fifteen dollars
Collect in order:
1. Pizza selection - "What pizza would you like?"
2. Size - "What size: small, medium, or large?"
3. Any modifications - "Any special requests or modifications?"
4. Name - "Name for the order?"
5. Phone - "Phone number?"
Confirm: "Let me confirm: [size] [pizza] for [name] at [phone]. Total is [price]. Is that correct?"
Use create_order(pizza, size, modifications, name, phone) after confirmation.
Spell out prices: "fourteen dollars" not "dollar sign fourteen".
Spell phone numbers: "5-5-5, 1-2-3-4".
Step 3: Validate
python scripts/validate_prompt.py pizza_prompt.txt
Step 4: Deploy and test with LiveKit
Step 5: Refine based on feedback
Voice agent prompts improve through continuous refinement based on real-world usage:
For detailed guidance: See references/iterative-improvement.md
Different industries require specialized approaches:
Debt Collection:
Healthcare:
Banking/Financial:
Customer Service:
Front Desk/Reception:
For detailed patterns: See references/industry-best-practices.md
The templates handle 80% of the work. Focus your customization on domain-specific information, tools, and workflows. Then continuously improve based on real-world performance.