Prompts
The instructions you give an AI
Everything you build in this course starts with a prompt. A better prompt gives you a better answer, a better app, and fewer headaches.
What is a prompt?
A prompt is the message you send to an AI. It can be a question, an instruction, or a long description of an app you want built.
Think of ordering at a coffee shop. "Coffee, please" gets you something. "A large oat milk latte, extra hot, no sugar" gets you exactly what you want. The barista is the same. Your order made the difference.
- A prompt is written in plain words. No code needed.
- It can be one line or a full page.
- The AI only knows what you tell it, so details matter.
Vague vs clear prompts
Here is a vague prompt:
Make me a study plan.The AI has to guess everything: which subjects, how much time, and when the exams are. You'll get a generic plan that doesn't fit your life.
Here is a clear prompt:
Make me a 2-week study plan for my exams.
Subjects: Biology (exam on June 10) and History (exam on June 14).
I can study 2 hours on weekdays and 4 hours on weekends.
Show it as a table with one row per day.Let's break this down:
- The goal is clear: a 2-week study plan.
- The details are given: subjects, dates, and hours.
- The format is clear: a table, one row per day.
System messages and user messages
There are two kinds of instructions an AI can get:
- User message: what you type in the chat box. This is what you'll write most of the time.
- System message: background instructions that set the AI's role and rules for the whole chat. Think of it as the job description the AI reads before the conversation starts.
When you build apps with AI features, you will write system messages yourself. For example, an online shop's shopping assistant might get one like this:
You are a friendly shopping assistant for an online store
that sells handmade home goods. Only recommend products from
our catalog. Keep answers short and helpful.In chat apps, you can often set something similar in the settings, often called "custom instructions" or "personalization".
Multi-turn chats
You don't have to get everything right in one message. A chat is a conversation. Each message you send is called a turn, and the AI can see the earlier turns.
This back-and-forth is how you will build apps too. You ask for a first version, then improve it step by step.
Common mistakes
Being too short
# Wrong
Fix my email.
# Right
Make this email more polite and shorter, under 100 words.
Keep the meeting date and time the same.
[paste your email here]Starting over instead of refining
If the answer is almost right, don't open a new chat. Reply with what to change: "Good, but make the tone more casual."
Asking for many unrelated things at once
One clear task per message usually works better than five tasks mixed together.
Practice
Try these exercises to lock in what you just learned.
What's next?
Your prompt is made of words, but the AI doesn't read words the way you do. Next, let's see how it reads them as tokens.