brainax

What is prompt engineering?

Short answer: prompt engineering is the skill of writing and improving your requests to an AI model so it gives useful answers reliably, not just once. A prompt is your message to the model. Engineering means doing it on purpose: you give the model a role, a task, a format and an example, show it a few samples, keep the chat history clean, and test your prompt on real examples to see what actually works. You don't need code for any of this.

Free course on this topicAI basics: free courseStart the course →

What a prompt is and why wording matters

A prompt is your message to the model, your request. The model can't read your mind, so everything you need has to be in words. A vague prompt gets a vague answer: "Tell me about marketing" gets a lecture about nothing, while "Give me 5 TikTok post ideas for a coffee shop near a campus, one line each" gets something you can use. The difference is in the details: how many, for whom, where and in what shape. Long prompts don't bother the model; they actually help.

More in the lesson: A prompt that works

Technique 1: role, task, format, example

A good prompt has four parts. Role: who to be ("You are a chemistry tutor"). Task: what to do ("Explain what a mole is"). Format: who it's for and what shape ("for 9th grade, 5 points"). Example: show the style you like.

Weak: "explain the mole". Strong: "You are a chemistry tutor. Explain what a mole is for a 9th grader. Give 5 short points and one solved problem." The answer lands at your level, not at textbook level.

More in the lesson: A prompt that works

Technique 2: few-shot, or show instead of explain

"Shot" means example. Zero-shot is a task with no examples; few-shot gives 2–3 ready "input → output" pairs and then a new input. The model spots the pattern and continues in the same style. Use identical labels ("Item: … Description: …") so the model sees where its turn begins; 2–5 examples are usually enough. The catch: it copies mistakes too, so examples must be correct and varied.

More in the lesson: Show an example: few-shot

Technique 3: refine in the same chat

The first answer is rarely perfect. Don't start over; reply in the same chat: "shorter", "simpler", "add a real-life example". Within one chat the model sees the whole conversation, and 2–3 follow-ups are often enough. Start a new chat when you switch topics.

More in the lesson: A prompt that works

Technique 4: system messages, custom instructions and the context window

Under the hood a chat is one long document with roles. The system message sits at the top: hidden instructions from the app's makers. Your custom instructions, like "keep it short, I'm a student", go into that part, which is why they apply to every new chat.

Between messages the model remembers nothing: the app sends it the whole history every time. The context window is how much text it can read at once, counted in tokens. In a very long chat old messages can fall out or get less attention, and a rejected idea that's still in the history keeps coming back. The fix: a new chat with a short summary of what's decided.

More in the lesson: Inside a chat: system, user, history

Technique 5: test prompts like an engineer

This is the "engineering" part. Collect 5–10 real examples from your task, write down the right answer for each, run them through the AI and compare. To choose between two prompts or two models, give both the same examples and score the answers with a simple checklist: correct, on point, right tone. Change one thing at a time, and run each example a couple of times because answers vary.

And always check facts: models can invent numbers, quotes and links, called hallucinations. Open the source yourself.

More in the lessons: How to tell if an AI is good, Hallucinations and privacy

FAQ

Is prompt engineering a real skill?

Yes, in a practical sense: the same model gives very different answers to a vague and a specific request. Clear parts, examples and testing on real cases make the result predictable.

Do I need to know how to code for prompt engineering?

No. Everything above is plain words: a role, a task, a format, examples and a simple checklist to compare answers.

What should I never put in a prompt?

Passwords, card numbers, seed phrases and other people's personal data. Whatever you send goes to the company's servers and may be stored. Rule of thumb: don't type into a chat what you wouldn't show a stranger.

More in the lessons: A prompt that works, How to tell if an AI is good, Hallucinations and privacy

Practise prompts on real tasks

The free Brainax course «AI basics» explains how models work, how to write prompts that work, where AI makes things up and how to tell a good model from a bad one. Short lessons with animations and a quiz. Start the lesson

Free course on this topicAI basics: free courseStart the course →