Lesson 1. Anatomy of a Good Prompt#
Why This Matters#
A prompt is an instruction for an AI agent. A good prompt = quality results. A bad prompt = hallucinations, errors, useless responses.
Key Idea#
Prompt = role + task + context + rules + format + examples
The clearer the instruction, the better the agent performs.
Structure of an Ideal Prompt#
1. Role (who you are)
Define who the agent should be. The role sets the style, tone, and approach.
Example roles:
- "You are a beauty salon assistant"
- "You are a sales manager's assistant"
- "You are a product selection consultant"
- "You are customer support for an online store"
Why the role matters:
The role sets the context. A salon assistant speaks in a friendly way and offers to book appointments. Customer support speaks clearly and solves problems.
2. Task (what to do)
Describe exactly what the agent should do.
Example tasks:
- "Answer common customer questions"
- "Qualify leads by asking clarifying questions"
- "Help the customer choose a product by asking about their needs"
- "Accept requests and record data in a spreadsheet"
3. Context (what to know)
Give the agent information about the business, services, and rules.
Example context:
- "We are a beauty salon in Moscow, open Mon–Fri 10:00–20:00"
- "Our services: haircut (from 1500 rub.), coloring (from 3000 rub.), manicure (from 2000 rub.)"
- "If the customer wants to book, clarify: name, phone, date, time, service"
4. Rules (how to work)
Set rules for the agent's behavior: what is allowed, what is not, how to respond.
Example rules:
- "Use only information from the knowledge base"
- "If you don't know the answer, say: 'I'll check with the administrator'"
- "Tone: friendly but not overly familiar"
- "Don't make up prices or terms"
- "If the customer is rude, stay polite"
5. Response Format (how to respond)
Describe how the agent's responses should look: length, structure, style.
Example formats:
- "Keep answers brief: 2–3 sentences"
- "Use numbered lists when there are multiple options"
- "When asking a question, provide answer options"
- "At the end of each response, suggest the next step"
6. Examples (optional but helpful)
Show the agent examples of correct responses. This improves quality.
Example:
Customer: "How much does a haircut cost?"
You: "Women's haircut — from 1500 rub., men's — from 800 rub. Would you like to book?"
Prompt Template#
Role:
You are [role, e.g.: "assistant at beauty salon 'Beauty Spot'"].
Task:
Your task: [what to do, e.g.: "answer customer questions and help book services"].
Context:
[Information about the business, services, hours, prices.]
Rules:
- [rule 1: "Use only information from the knowledge base"]
- [rule 2: "If you don't know the answer, say: 'I'll check with the administrator'"]
- [rule 3: "Tone: friendly and polite"]
- [rule 4: "Don't make up prices or terms"]
Response Format:
- [how to respond: "Keep answers brief, 2–3 sentences"]
- [structure: "Use a list when there are multiple options"]
Examples:
[Example 1: customer request → agent response]
[Example 2: customer request → agent response]
Limitations:
- [what not to do: "Don't promise what you can't guarantee"]