Building with AILesson 11 of 80

Module 2 · Prompting as engineering

A prompt is an interface, not a paragraph

In this lesson

  • 9 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 1 of 10 in this chapter

This chapter’s goalTurn a prompt that works once into a versioned, cached, example-driven interface with a stated behaviour when the model does not know, and justify with cost and latency numbers whether a given task needs a longer prompt, a chain of smaller ones, a reasoning budget, or a fine-tune.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
The five parts, and where the cache boundary falls1. Role and scope: stableTwo sentences: who this assistant is and, moreimportantly, what it does not do2. The task, as a procedure: stableSteps you could hand to a new colleague, not a wish3. The material: variableThe retrieved passages, the ticket, the code: long,and the reason for the call4. Rules, format and the sentinel: stableIncluding what to output when the material does notcontain the answer5. The user’s question: variable, lastRecall is strongest at the beginning and the end ofa long contextParts one, two and four are byte-identical on every call; parts three and five change. Keeping thestable block above the variable one is what a provider’s prefix cache bills at, and putting thequestion last is what stops it being buried at position 4,000 of 12,000.
Parts one, two and four are byte-identical on every call; parts three and five change. Keeping the stable block above the variable one is what a provider's prefix cache bills at, and putting the question last is what stops it being buried at position 4,000 of 12,000.

Figure 2.1

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 8Free · no account needed
Lesson steps

The shape that survives

Almost every prompt that lasts in production has the same five parts, in roughly this order. The order is not aesthetic; each part is placed where it is for a mechanical reason.

  1. Role and scope. Two sentences. Who this assistant is and, more importantly, what it does not do.
  2. The task, stated as a procedure rather than a wish.
  3. The material: the retrieved documents, the ticket, the code. Long, variable, and the reason for the call.
  4. Rules and format, including what to do when the material does not contain the answer.
  5. The user’s actual question, last.

Parts 1, 2 and 4 are stable across calls. Parts 3 and 5 change. That split is not incidental: it is exactly the boundary that prompt caching bills at, and getting the order wrong can cost you a 90 per cent discount you did not know you were entitled to.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Python, from Zero, for AI exam.

Stuck on something?Ask Sayali, your AI tutor

How to cite: Addaly (2026) ‘A prompt is an interface, not a paragraph’, in Building with AI. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/building-with-ai/the-prompt-is-an-interface (Accessed: 29 November 2026).