Skip to main content

Writing instructions

An AI agent’s conversational performance depends directly on prompt quality. This guide helps you design clear, reliable prompts aligned with your business goals.

Think like an AI

An AI agent is not a human employee. It is a language prediction system that follows explicit rules. Your prompt should be a strict set of instructions and constraints.

3-step cycle for effective agents

1) Design

Build a prompt with these components:

  • Role: Who the agent is and how it behaves.
  • Goal: The main success outcome.
  • Constraints: What the agent must never do.
  • Flow: Step-by-step conversation structure.
  • Context/Data: Product info, FAQs, policies, schedules.

2) Test

Run test calls for:

  • Happy path scenarios
  • Edge cases (off-topic users, rude users, missing info, slang)

3) Refine

  • Remove ambiguity and add deterministic instructions.
  • Strengthen guardrails for failure cases.
  • Iterate until outcomes are consistent.

Best practices

  1. Use examples (positive and negative).
  2. Use clear sections/delimiters (<role>, <task>, etc.).
  3. Be explicit with role, tone, and mission.
  4. Define hard guardrails with absolute wording.
  5. Prioritize concise responses and deterministic behavior on critical steps.

Simple appointment-booking prompt example

<IDENTITY>
You are SARAH, Fonema's Virtual Advisor.
Tone: Empathetic, warm, and professional.
Mission: Help {{name}} schedule an in-person appointment.
</IDENTITY>

<GOAL>
End the conversation with a scheduled appointment.
</GOAL>

<TASK>
1. Introduce yourself and notify approval.
2. Explain the next step is scheduling.
3. Resolve questions and objections.
4. Ask for preferred date/time.
5. Check availability.
6. If available, schedule with {{email}}.
7. If unavailable, offer alternatives.
8. Confirm booking.
9. Thank the user and end the call.
</TASK>