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–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 don't 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's 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.
Kasun Wijayamanna
Kasun Wijayamanna Founder & Lead Developer

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

View profile →

Meet the person

Written by the person who does the work

This article comes from real projects. If it raises a question about your own system, you can ask the founder directly.

HELLO PEOPLE designs, builds and looks after AI, software, app and data solutions for Australian businesses, with senior expertise on every project and a scope agreed before work starts. For AI, that means working on your own data, with a person able to check every answer.

Since 2007, HELLO PEOPLE has delivered more than 100 projects from Perth for small and medium businesses across Australia: custom software and apps, system integrations, data migrations, reporting and dashboards, and AI that works inside the systems a business already runs.

I lead every engagement myself. I trained in accounting before moving into IT, hold accounting and IT professional qualifications and an MBA, and bring more than 20 years of experience across sales, service delivery, inventory and compliance. I am also a PhD candidate in AI at Curtin University, researching retrieval-augmented generation (RAG), so the technology is always judged by what it does for the business.

  • An old-fashioned service

    Small and boutique. The person who scopes your AI project is the person who builds it, and the same person checks its answers before your team relies on them.

  • Quick responses

    No ticket queue and no account manager in between. You hear back within one business day, usually sooner.

  • A long-term partner

    The first AI project is the start, not the end. When you need the next system, integration or report, you call the same person, who already knows your business.

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, replies within one business day

Ready to discuss your project?

Tell us what you're working on. We'll come back with a practical recommendation and clear next steps.

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.