What Is Prompt Engineering? A Practical Guide

How to write effective prompts that get consistent, useful results from language models. Techniques, examples, and common mistakes.

What is prompt engineering?

Prompt engineering is the practice of writing instructions for AI language models to get useful, consistent results. It's the difference between asking "tell me about invoices" and getting a generic essay, versus asking "extract the invoice number, date, and total from this document and return them as JSON" and getting exactly what you need.

It's not rocket science, but it does require some craft. The way you structure, phrase, and constrain your prompts has a massive impact on output quality.

Why prompts matter

Language models are general-purpose tools. They can write poetry, debug code, or summarise legal documents, depending entirely on what you ask. The prompt is your lever.

In a business context, poorly written prompts lead to:

  • Inconsistent outputs that require manual review
  • Hallucinated facts presented as truth
  • Verbose, vague, or off-topic responses
  • Missed edge cases in automated workflows

Well-engineered prompts lead to AI that behaves predictably, follows your rules, and produces output you can actually use.

Core techniques

1. Be specific

Vague prompts get vague answers. Tell the model exactly what you want, in what format, and what to avoid.

Bad: "Summarise this document."
Better: "Summarise this document in 3 bullet points. Focus on financial impacts. Use plain English."

2. Set a role

Giving the model a persona or role helps it calibrate tone and expertise level. "You are an experienced employment lawyer reviewing this contract" produces very different output from a generic prompt.

3. Use system prompts

In production systems, system prompts set the baseline behaviour: tone, constraints, output format, safety rules. User prompts then provide the specific task. Separating these gives you consistent behaviour across different queries.

4. Few-shot examples

Show the model what good output looks like. Provide 2 to 3 examples of input/output pairs before giving it the real task. This is often more effective than lengthy instructions.

5. Constrain the output

Tell it what format to use (JSON, bullet points, table), what length to target, and what to exclude. "Do not include opinions" or "respond only with the extracted data" can prevent rambling.

6. Chain of thought

For complex reasoning tasks, ask the model to "think step by step" or "explain your reasoning before giving the final answer." This improves accuracy on multi-step problems.

Business examples

Some real-world prompt patterns we use in production:

  • Invoice extraction: "You are a data extraction system. Read the following invoice text and return a JSON object with: invoice_number, date, vendor_name, line_items (array), total_amount. If a field is not found, return null."
  • Email classification: "Classify the following email into one of these categories: billing, technical_support, sales_enquiry, complaint, other. Return only the category name."
  • Knowledge Q&A: "Answer the user's question using only the context provided below. If the answer is not in the context, say 'I do not have enough information to answer that.' Always cite the source document."

Common mistakes

  • Too vague: "Help me with my data". The model has no idea what you actually want.
  • Too long: Prompts that are pages long often confuse the model. Keep instructions clear and structured.
  • No examples: Describing the format you want is harder (and less reliable) than showing it.
  • No constraints: Without boundaries, models default to verbose, generic responses.
  • One-and-done: Good prompts are iterated on. Test with real data, review outputs, and refine.

Beyond prompts

Prompt engineering is important, but it is just one part of a production AI system. For reliable business applications, you also need:

  • RAG to give the model access to your data (see What Is RAG?)
  • Guardrails to validate outputs and catch errors
  • Evaluation pipelines to measure answer quality systematically
  • Human review for high-stakes decisions

Think of prompts as the steering wheel. But you still need the engine, the brakes, and the road.

Key takeaways

  • A well-written prompt dramatically changes the quality of AI output. It's not just about what you ask, but how.
  • System prompts set the context, role, and constraints. User prompts provide the specific task.
  • Few-shot examples (showing the model what good output looks like) are one of the most reliable techniques.
  • For production systems, prompt engineering is an ongoing process. You iterate based on real outputs.

HELLO PEOPLE

When to talk to HELLO PEOPLE

We build AI systems with carefully engineered prompts baked into the architecture. If your AI outputs aren't consistent enough, we can help.

Get in touch
Kasun Wijayamanna
Kasun Wijayamanna Founder & Lead Developer

Postgraduate Researcher (AI & RAG), Curtin University - Western Australia

View profile →

Prompt engineering: common questions

What is prompt engineering?

Prompt engineering is the practice of writing instructions for artificial intelligence (AI) language models to get useful, consistent results. The way a prompt is structured, phrased and constrained has a large effect on output quality. Asking a model to tell you about invoices gets a generic essay, while asking it to extract the invoice number, date and total gets exactly what you need.

What is the difference between a system prompt and a user prompt?

A system prompt sets the baseline behaviour of an artificial intelligence (AI) model, including tone, constraints, output format and safety rules, while a user prompt provides the specific task. In production systems, separating the two gives consistent behaviour across different queries, because the rules stay the same while each task changes.

What are few-shot examples in prompt engineering?

Few-shot examples show an artificial intelligence (AI) model what good output looks like by giving it 2 to 3 example input and output pairs before the real task. They are one of the most reliable prompt techniques and are often more effective than lengthy instructions, because describing a format is harder and less reliable than showing it.

What are the most common prompt writing mistakes?

The most common prompt writing mistakes are prompts that are too vague, prompts that run to pages and confuse the model, giving no examples, setting no constraints, and treating a prompt as finished after one try. Without boundaries, models default to verbose, generic responses. Good prompts are iterated on: test them with real data, review the outputs and refine.

Is prompt engineering enough to make business AI reliable?

No, prompt engineering is only one part of a reliable business artificial intelligence (AI) system. Production systems also need retrieval augmented generation (RAG) to give the model access to the business's data, guardrails to validate outputs and catch errors, evaluation pipelines to measure answer quality, and human review for high-stakes decisions. Prompts are the steering wheel, but the system still needs the engine and brakes.

Ask the author

Still have a question?

Ask it here and it comes straight to the founder. No sales call, no obligation, and a real answer even if the answer is that you do not need us.

Kasun Wijayamanna, Founder Kasun Wijayamanna
Founder. We aim to respond within one business day.

Ready to discuss your project?

Tell us what you are working on. We will come back with a practical recommendation and clear next steps.

We aim to respond within one business day · No obligation

Get a free scoping call Direct line +61 425 531 127

Australian owned and operated Built here. Your data stays here.

  • No offshore development. Everything is written by our own team in Australia. Nothing is subcontracted overseas.
  • Your data stays onshore. Hosted in Australia, on infrastructure you own, under Australian law.
  • Every state, not just ours. Perth, Melbourne, Sydney, Brisbane, Adelaide and everywhere between.

Discuss a project

Four fields. You speak to the developer on the first call.

Or call 0425 531 127, we answer in person.

* Required

Kasun Wijayamanna

A personal promise from

Kasun Wijayamanna

Founder & Lead Developer, HELLO PEOPLE

“When you work with us, you get a clear price, an honest timeline, and the same person you spoke to on day one, right through to delivery.”

  1. 01
    Fixed prices, in writing

    Your quote is the price you pay. No surprise invoices, no creeping scope.

  2. 02
    Realistic costs, honest scope

    We’ll tell you what’s worth building now, and what can wait, before you spend a cent.

  3. 03
    On-time delivery, every sprint

    Weekly demos, fixed milestones, and a launch date we both commit to.

  4. 04
    Direct line to the founder

    Call or email me any time, no account managers, no ticket queues.

20+ years building softwarePerth-based team1 business day reply

Send an enquiry Call Kasun now

Message Sent!

Thanks for reaching out. We aim to respond within one business day.

See what else we do