AI Engineering · The Wrenlet Saga · Free article
Make It Sound Like Us
Wrenlet is fast, cheap, and reliable, but the head of support says every reply sounds like a generic chatbot, not like her best agent. The model doesn't know your voice, your policies, or your product, because you never told it. This chapter is context engineering: assembling what the model sees so it answers like you, and prompt caching, so all that carefully packed context stays cheap to send.
Chapter 3 is where the model stops sounding like everyone else's model and starts sounding like Wrenlet. Nothing here is about intelligence, it's about the briefing. The model is a blank slate on every call, so your voice, rules, and this-ticket facts all have to be assembled into the prompt, well: a sharp system prompt, a few gold examples instead of a description, and only the context that actually helps (because more is often worse). That careful briefing is a big block you re-send every call, which is why the second half is prompt caching, the trick that makes the repeated part nearly free.
Two chapters in, Wrenlet is in good shape: accurate, and after the last chapter streaming, structured, and affordable. So you finally show it off. The head of support reads a morning's worth of drafted replies, and her face falls. They're not wrong: the facts are right, the refunds are correct. They just don't sound like Wrenlet. They open with “Dear valued customer.” They over-apologize. They're stiff and faintly robotic. “This isn't how we talk,” she says. “Can you make it sound like us?”
And you realize the model has no idea who “us” is. It has never read Wrenlet's style guide, never seen your best agent's replies, doesn't know that you keep it short, name the exact charge, and never blame the customer. Why would it? It starts every call as a blank slate: it remembers nothing about your company between requests. Whatever you want it to sound like, know, or follow has to be in the request, every time. You never put your voice there. This chapter is about doing that deliberately.
The replies that sound like a chatbot
The instinct is to write a paragraph describing the voice: “be warm, concise, professional…” It barely helps. A description of a tone is a weak thing next to an example of it. So instead you do two things. You write a real system prompt that states who Wrenlet is and the hard rules (never promise a big refund without escalating). And you paste in a few of the head of support's actual best replies as examples, and let the model copy the pattern. That's the fastest fix in this whole chapter, and it needs surprisingly few examples:
The interactive version of this example is available when JavaScript loads.
Watch how fast the reply snaps on-brand, and how the first two or three examples do almost all the work while the token bill keeps climbing. That's the recurring lesson: the model is only as good as what you put in front of it, and the skill is curation, not volume. Assembling that whole briefing well: the system prompt, the examples, the facts for this ticket, the schemas for the tools it can call, the shape you want back, is context engineering, and it's the core discipline of the chapter.
The tempting fix that makes it worse
Flush with the win, you get greedy: if a few examples helped, surely dumping the entire policy manual and every past ticket into the prompt will make it brilliant. It does the opposite. Past the handful of things that actually bear on this ticket, every extra document is a plausible distraction that dilutes the signal, and the answers get worse even though you gave the model more to work with. Slide it and feel the curve roll over:
The interactive version of this example is available when JavaScript loads.
So the goal isn't to give the model everything that might help, it's the smallest set that fully answers the question in front of it, with the load-bearing facts where the model actually reads them (the start and end, not buried in the middle). Retrieve the right context per ticket instead of hardcoding a wall of text. The context engineering page covers the whole discipline: the anatomy of a window, the position effect, the failure modes, and why a hostile line buried in a ticket has to be stopped somewhere other than the prompt.
The briefing you re-send a thousand times an hour
Getting the voice right had a side effect you can see by diffing two consecutive calls: they are almost the same bytes. The system prompt, the voice guide, the four examples, the schemas for the tools you gave it back in Chapter 2, several thousand tokens of setup, identical every time, in front of a hundred-token customer message and the one section you retrieved for this ticket. You made the prompt good and, without noticing, made it expensive to send, because you are buying that preamble again on every single request.
The fix is almost free, and it follows a layout rule you already have a reason to follow: keep everything stable at the front, let only the per-request tail change. Then the provider can cache that repeated prefix, reuse the work of processing it instead of redoing it, as long as nothing volatile sits ahead of it. Click a spot where a call differs and watch how much of the expensive head survives:
The interactive version of this example is available when JavaScript loads.
That's the neat part of this chapter: ordering your prompt stable-first buys you two things from one decision, your standing rules land where the model reads them best, and the very same repeated prefix becomes cacheable, cheap, and fast. One stray timestamp at the top throws the discount away, which is exactly the kind of trap the prompt caching page teaches you to avoid.
What you ship this sprint
None of this made the model smarter. It made the briefing better, and then made that briefing cheap to send. Every figure on the board below is Wrenlet's, and illustrative: each one is sized to make a single effect visible, so they are not a ledger you can add up and they are not measured off anyone's production cluster. What transfers is which decision moves which number. Assemble it one decision at a time. Three of the five cost you something the moment you switch them on, and two of them do nothing at all on their own, which is the first thing worth noticing about them.
The interactive version of this example is available when JavaScript loads.
Three things on that board generalise well past Wrenlet. The first is that curation is subtraction: the manual and the retrieval are not two strengths of the same fix, and adding the right section to a prompt that already carries everything else cannot undo what the everything else is doing. The second is that ordering and caching are not features you switch on. They are properties of how the other three are arranged, which is why each does nothing by itself and why one of them can make your bill worse when the arrangement is wrong. The third is the one to watch for at work, and the board will tell you when you find it: a decision that makes a number look better without making the product any better.
The Chapter 1 and 2 pattern holds again: the model is one component, and most of the outcome lives in how you wire it. Here the wiring is the context you assemble and the order you assemble it in, and the same decision that makes Wrenlet sound like itself also makes it cheap to run.
Go deep on the two that matter
The Chapter 3 reads
- Context Engineering: the anatomy of a context window, few-shot and where it stops helping, why position is a correctness lever, the more-is-worse trap, dynamic assembly, the failure modes, and the trust boundary.
- Prompt Caching, reusing the prefill work of a stable prefix, why it’s a prefix cache, the read-discount vs write-premium economics, TTL and warming, and the stray value that silently busts it.
Where the story goes next
Wrenlet sounds like Wrenlet now. Then a customer asks a detailed question about your own product, a feature, a limit, a setting, and the model answers confidently, and it is wrong, because it has never read your docs. You can't paste the entire product manual into every prompt (you just learned why that backfires). You need a way to fetch only the few relevant passages for each question and put those in the context. That's the next crisis: teaching the model your own knowledge without stuffing it into the window.
By GOAT Engineer. Back to The Wrenlet Saga. Privacy Policy · Contact.