Skip to main content
Creating effective prompts is crucial for getting the best results from AI agents. This guide outlines a structured approach to prompt engineering that will help you consistently create high-quality prompts.

Core Components

Every well-structured prompt should include these key elements:

Goal

The goal defines what you want to achieve. Be specific and measurable in your objective. For example:
  • ✅ Good: “Create a sales script for cold calling enterprise SaaS prospects with objection handling”
  • ❌ Poor: “Help with sales”
Your goal should:
  • Focus on one primary outcome
  • Define clear success criteria
  • Be achievable within the context

Persona

The persona shapes how the AI should behave and communicate. Define:
  • Expertise Level: What knowledge should the AI demonstrate?
  • Role: What position or perspective should the AI take?
  • Communication Style: How should the AI present information?

Background Information

Provide context that helps the AI understand the full picture:
  • Relevant domain knowledge
  • Constraints or limitations
  • Target audience details
  • Previous context or history
  • Special requirements

Flow and Rules

Conversation Flow

Define how the interaction should progress:
  1. Initial response format
  2. How to handle follow-up questions
  3. When to ask for clarification
  4. How to structure complex responses

Tool Usage Rules

If the AI has access to tools, specify:
  • When tools should be used
  • Required input/output formats
  • Error handling procedures
  • Data validation requirements

Example Conversations

Provide the agent with example conversations to follow. This will help the agent understand how to behave in the conversation. Here’s a well-structured example of an agent conversation:
Agent: Hi [Name], I’m Gabby from Telkom Fibre. I see you have coverage for Fibre Telkom’s High Speed Fibre Internet. Do you currently have Fibre installed at home?
Customer: No, I use mobile data.
Agent: Fibre is faster, more stable, and much cheaper for streaming, gaming, and working from home. You won’t have to worry about running out of data! How do you currently use the internet?
Customer: Mostly Netflix and work calls.
Agent: Telkom’s fibre plans ensure smooth video calls and HD streaming without buffering. If you’re interested, I can check what’s available at your address.
Customer: That sounds good.
Agent: Great! Let me confirm your address so I can send you a quote. Is [current address] correct?

Example Prompt

Here’s an example of a well-structured prompt, with all the elements we’ve discussed:
[Goal]
Act as a medical scheduling assistant to efficiently book doctor appointments by collecting patient preferences, medical concerns, and coordinating available time slots while providing excellent customer service.

[Flow]
1. Greet patient warmly and identify yourself as the medical scheduling assistant
2. Ask about and document their specific medical concern or reason for visit
3. Inquire about their preferred appointment dates and times
4. Use calendar tool to check and suggest available slots matching preferences
5. Gather/verify patient details and relevant medical history
6. Confirm all booking details with patient
7. Complete appointment booking and provide confirmation details
8. Offer to answer any remaining questions

[Tool Use Rules]
- Use checkAvailability() only after collecting specific date/time preferences
- Use getPatientHistory() before proceeding with booking to ensure appropriate scheduling
- Use bookAppointment() only after explicit patient confirmation of all details
- Never share patient information between sessions
- Log all booking attempts, successful or not

[Background]
You are the scheduling assistant for City Health Clinic, representing a professional medical practice. Your role is critical because:
- Each successful booking impacts both patient health and clinic operations
- Patient comfort and privacy are top priorities
- Clear communication prevents booking errors
- Flexible scheduling options increase booking success rates
- Professional yet friendly interaction builds patient trust
- Systematic information collection ensures complete records

Maintain a balance between efficiency and empathy, always prioritizing patient needs while following clinic protocols.

[Example Converstion]
Assistant: Good morning! This is Sarah from City Health Clinic. How can I help you today?
Patient: Hi, I need to book an appointment for a recurring headache.
Assistant: I'm sorry to hear about your headache. I'll help you book an appointment. When would you prefer to see the doctor?
Patient: Maybe next Tuesday afternoon?
Assistant: Let me check our availability for next Tuesday... [uses checkAvailability tool]

Conclusion

Effective prompt engineering is an iterative process. Start with this structure and refine based on your specific needs and results. Remember that the best prompts are clear, specific, and provide just enough context to achieve the desired outcome.