Prompt Engineering is the most important part of your agent, it can make or break your agent. This guide will share our findings on how to write prompts that agents can follow more reliably.
This guide is a work in progress and will be updated as we learn more. If you have any suggestions or feedback, please let us know.
To check some of the prompts we have created, you can look at templates in Dashboard (create a new agent and select a template to start).
Using Ask Co-Pilot
If you’re unsure how to craft an effective prompt, don’t worry. Ask Co-Pilot can guide you through the process. It will ask you a series of relevant questions, step-by-step, to help you formulate a clear and concise prompt. This interactive approach ensures you cover all necessary details and get the best possible response from the AI Agent.
Existing Context
The AI Agent already has information from the profile and can access certain known details:
- You do not need to restate the AI Agent’s name or characteristics.
- You do not need to provide the current time.
- If the person the AI is interacting with is already in its contact database, there’s no need to reintroduce their details.
Sectional Prompts
When writing prompts, it is important to break down the system prompts into smaller sections, where each section has its focus, like identity, style, guideline, task & goals. This has a couple of benefits:
- reusable
- easier to maintain
- easier for LLM to understand
The AI Agent can understand all languages specified in the profile. Feel free to write the prompt in any of these languages to get the most natural and contextually rich response.
Identify
You are a friendly AI assistant for TruFlow AI. …
Style Guardrails
Be concise: …
Be conversational: …
…
Response Guideline
Return dates in their spoken forms: …
Ask up to one question at a time: …
…
Task
- Greet the user
…
Task
- Ask for user’s name.
- Ask if user needs a refund, need a replacement, or just retriving information.
- if user needs a refund, transition to refund state.
- if user needs a replacement, transition to replacement state.
- If user is just retriving information, ask for the order number.
…
Task
- Inform user why you are calling.
- Ask for user’s name.
wait for user response
- Ask if user needs a refund, need a replacement, or just retriving information.
wait for user response
- if user needs a refund, transition to refund state.
- if user needs a replacement, transition to replacement state.
- Ask for the order number.
wait for user response
…
### Using Infobase
If you’re using Infobase, you can attach a specific document folder for the AI Agent to reference when generating responses. This ensures that the AI Agent draws information from the most relevant and updated documents at all times.
### Slash Commands
Use slash commands to add dynamic elements to your prompts and instruct to when trigger any during call action:
<Frame>
<img src="/images/agent/slash_command.gif" />
</Frame>
1. **Core Commands**
- `/Customer Name` - Inserts customer/contact's name stored in contacts module
- `/Customer Email` - Inserts customer/contact's email stored in contacts module
- `/Customer Number` - Inserts customer/contact's number stored in contacts module
- `/Date` - Current Date and Time as per Agent's TimeZone
- `/To Number` - To Number while making or receiving call
- `/From Number` - From Number while making or receiving call
- `/Call Direction` - Direction of the call, Inbound or Outbound
2. **Action Commands**
Any Action which can be triggered **during call** will be visible here e.g sending SMS, emails, finding slots in calendar or booking slots etc..This helps AI agents to understand the exact moment when an action needs to be performed based on the ongoing conversation, ensuring relevance and timeliness. For example, You have enabled Send SMS during call with the action name "Send Notification" then action will be shown here as `/Send Notification`
<video
controls
className="w-full aspect-video"
src="/images/agent/slash_command_2.mp4"
></video>
## Best Practices
1. **Prompt Writing**
- Keep instructions clear and specific
- Use natural language
- Include example dialogues
- Define boundaries and limitations
- Specify error handling
2. **Template Usage**
- Start with templates as base
- Customize to match brand voice
- Test thoroughly before deployment
- Document modifications
3. **Command Integration**
- Use slash commands strategically
- Combine commands for complex workflows
- Test variable resolution
- Plan fallback responses
4. **Testing and Iteration**
- Test prompts with various scenarios
- Review and refine responses
- Gather user feedback
- Update prompts regularly
## Management Tips
1. **Version Control**
- Save different versions of prompts
- Document changes and updates
- Keep backup of working prompts
2. **Performance Monitoring**
- Track successful interactions
- Monitor command usage
- Identify common issues
- Analyze user satisfaction
3. **Maintenance**
- Regular prompt reviews
- Update business information
- Refresh templates
- Optimize based on analytics
## FAQs
<AccordionGroup>
<Accordion title="Why are prompts important for training a voice AI agent?">
Prompts provide clear directions for the AI, ensuring it understands the context and goals of each conversation, leading to better outcomes.
</Accordion>
<Accordion title="How do prompts improve AI performance?">
Good prompts guide the AI to stay on track, respond accurately, and handle different scenarios effectively, making interactions smoother and more satisfying.
</Accordion>
<Accordion title="What are the key components of a well-crafted prompt?">
- **Background Information:** Sets the stage.
- **Objection Handling:** Prepares for potential hurdles.
- **Script Instructions:** Provides a structured conversation flow.
</Accordion>
<Accordion title="Why is objection handling important in a prompt?">
It equips the AI with responses to common concerns, keeping the conversation positive and solution-focused.
</Accordion>
<Accordion title="What is the ideal number of objections to include in a prompt and why?">
We recommend to include 10 objections. This number covers most possible concerns, ensuring comprehensive preparation for the AI.
</Accordion>
<Accordion title="Can prompts make the AI sound more human?">
**Absolutely!** Well-designed prompts can give your AI a more conversational and human-like tone, making interactions feel more natural and engaging for users.
</Accordion>
<Accordion title="Can I upload media or provide links in the prompts?">
Yes, using Infobase you can train your AI with documents and links.
</Accordion>
<Accordion title="How to write a good Prompt for best results?">
### Step 1: Background Information
Provide detailed context about the scenario. This includes the role of the person interacting, the company, product information, target audience, value proposition, and the goals of the interaction.
### Step 2: Objection Handling
Prepare responses to potential objections or concerns that the client might raise. This ensures the AI can handle common challenges effectively.
**Example:**
**OBJECTION HANDLING:**
- *Current Tool Satisfaction:* Ask about their current tool's strengths and weaknesses. Highlight unique features of CloudInnovate and offer a demo.
- *First-time Users:* Explain the ease of use and benefits of CloudInnovate. Share success stories and suggest a trial.
- *Price Concerns:* Emphasize the value and ROI of CloudInnovate. Offer a comparison with competitors to showcase its advantages.
- *Feature Requests:* If they need specific features, mention upcoming updates or customization options.
- *Success Stories:* Provide a relevant case study demonstrating the impact of CloudInnovate on similar businesses.
### Step 3: Script Instructions
Outline the specific conversation flow, including questions to ask, key points to cover, and responses to common scenarios.
</Accordion>
<Accordion title="What does a bad prompt look like?">
*This prompt lacks detail, context, and clear instructions, leading to a poor interaction.*
**BACKGROUND INFO:**
You are a customer service rep at a restaurant.
**OBJECTION HANDLING:**
- If they have a question, answer it.
- If they don't want to book a table, tell them it's easy.
- If they think it's too expensive, say it's worth it.
**SCRIPT INSTRUCTIONS:**
- Say hello.
- Ask if they want to book a table.
- Tell them about the restaurant.
- Ask for their number.
- Say goodbye.
</Accordion>
<Accordion title="What does a good prompt look like?">
*This prompt is detailed, providing context, specific strategies for objection handling, and clear, step-by-step instructions.*
**BACKGROUND INFO:**
Your name is Alex, and you are a Customer Service Representative at The Gourmet Bistro, a high-end restaurant specializing in international cuisine. Your task is to handle inquiries and assist customers with booking tables. Your main goal is to provide excellent customer service and ensure a seamless booking experience for the guests.
**Product Information:** The Gourmet Bistro offers a diverse menu with dishes from around the world, crafted by top chefs. We pride ourselves on our exceptional service and elegant dining atmosphere.
**Target Audience:** Food enthusiasts and diners looking for a premium dining experience.
**Value Proposition:** Offering a unique and memorable dining experience with exquisite dishes and top-notch service.
**OBJECTION HANDLING:**
- *Booking Hesitation:* Ask if they need assistance with the booking process and highlight the convenience of online and phone reservations.
- *Price Concerns:* Explain the value and unique dining experience offered. Mention any ongoing promotions or special deals.
- *Menu Preferences:* Assure them of the wide variety of dishes available and suggest a few popular options. Offer to send a digital menu.
- *Reservation Availability:* If their preferred time is unavailable, suggest alternative timings and emphasize the flexibility of our booking options.
- *Dietary Restrictions:* Highlight the customizable menu options and the availability of dishes catering to various dietary needs.
**SCRIPT INSTRUCTIONS:**
1. **Initial Greeting:** Greet the caller warmly and confirm their name for a personal touch.
2. **Inquiry Handling:** Ask how you can assist them today. If they have a general inquiry, provide clear and detailed information.
3. **Booking Query:** If they inquire about table booking, guide them through the process, mentioning the ease and convenience.
4. **Highlighting Benefits:** Share the unique features of The Gourmet Bistro, including our diverse menu and exceptional service. Mention any special events or promotions.
5. **Confirming Details:** Verify the booking details such as date, time, and number of guests. Ensure all information is accurate.
6. **Closing and Follow-Up:** Thank them for choosing The Gourmet Bistro and confirm the booking. Offer to send a confirmation via email or SMS and wish them a great dining experience.
</Accordion>
</AccordionGroup>