Ordinary software could plan this trip, and parts of it are easy for code. A program can add up the kilometres, check each leg against the tank, see whether a day ends before dark and flag a plan that misses a night booked months ago. Between Sandfire and Roebuck Plains there are about 285 km with no fuel, so every plan it writes fills the tank at Sandfire. The trouble is what the family types in. One wants beach fishing. One wants the dinosaur footprints in the rock at Gantheaume Point, visible only at low tide. One wants a pool every afternoon, and one wants the shortest days in the car. It arrives in their own words, on different evenings, and half of it is vague. “Somewhere with a pool” could be a caravan park or the town pool; “not too much driving” doesn’t say how much is too much. Some wishes collide. A pool every afternoon means ending each day in a town that has one, and that’s rarely where a short day in the car would end. Somebody has to choose which wish gives way, then explain it to whoever lost in words they’ll accept at dinner. That job is usually mine.
Reading those wishes, weighing them and explaining the outcome is what an LLMA neural network trained to predict the next token in a sequence, large enough that it generalises to tasks it wasn’t explicitly trained for. is good at. An LLM, a large language model, is a program trained on so much writing that, given some text, it writes what’s likely to come next. Hand it “not too much driving” and “somewhere with a pool” and it can read them as one request: a shorter day that ends in a town with a pool. Told the tide is low at Gantheaume Point one morning, it can propose that morning for the footprints and write the line for whoever loses the beach: “The footprints need the morning, so fishing moves to tomorrow and you get the whole afternoon.”
On its own it can’t remember and can’t find things out. Within a conversation it has only what’s in front of it, and nothing carries over to the next unless something hands back what was said. Close the chat on Tuesday and by Wednesday it has never heard of the fishing. It knows what it was trained on, up to a date, and nothing since. So it can’t know that the road past Sandfire closed this morning, what time the tide turns at Gantheaume Point that week, or whether the caravan park still has a site. It’s also unreliable at exact arithmetic. A confident “you’ll make Roebuck Plains on this tank” reads like a sum, and nobody did the sum.
An AgentA system that wraps an LLM with tools, memory, and a loop, so it can take multi-step actions toward a goal rather than just answering one prompt. is an LLM with three things built around it to close those gaps. The first is Tool useLetting an LLM call structured functions you’ve defined – search, calculator, database query, API call – instead of trying to do everything in text.. A tool is a piece of ordinary code the agent runs when the LLM asks for it, and the result comes back to the LLM as text. The agent gets distances and driving times from a routing service, tides from a tide table, and the day’s closures from Main Roads WA, where the state publishes them. The sums go to a calculator or ordinary code. The second is memory, which the program around the LLM keeps and hands back at the start of every conversation: who wanted what, what we’ve already decided, and why. The third is a loop. The agent proposes a plan, checks it against the facts and the rules, fixes whatever failed, and tries again until the plan holds.
It’s still the LLM writing every proposal in that loop, and a proposal can be as confidently wrong as the fuel sentence. So the checks that matter stay in ordinary code, which gives the same answer every run: fuel on that 285 km stretch, daylight at the end of each day, the booked nights.
A few more words
A prompt and its context. A PromptThe input you hand to an LLM – system instructions, user message, examples, retrieved documents, tool descriptions, the lot. is the text handed to an LLM each time somebody asks it for something. Its Context windowThe maximum number of tokens an LLM can attend to in a single call – prompt plus output combined. is everything in that text and nothing else, up to a fixed size: what was typed, the conversation so far, and whatever a tool or the agent’s memory has added. If the family’s wishes, the car’s range and the booked nights are in the context, the LLM can plan around them. If the Sandfire roadhouse’s opening hours aren’t, it has nothing to go on but its training. Ask it when Sandfire opens and it can still give you hours, written as confidently as if it had looked them up. A good deal of building with an LLM comes down to deciding what goes into that context, and what stays out.
A coding agent. A Coding agentAn agent whose tools are the ones a programmer uses, so it can read a codebase, change it, run the tests and keep going until the task is done or it gives up. is an agent whose tools are a programmer’s: it reads and edits the code, runs it, and runs the tests written to check it. Ask one to add a rule that every day finishes before dark, and it changes the code, runs the tests, reads what failed and changes the code again until they pass, or until it runs out of things to try. That’s how this trip planner’s code gets written, whatever the planner turns out to be.
An automatic check. An automatic check is a few lines of ordinary code that put one yes-or-no question to a plan and answer it the same way every time they run. “Does every stretch between fuel stops fit in the tank?” is one. Hand it a plan that drives past Sandfire without filling up and the answer is no, on the first run and the hundredth. It reads a plan the same way whether a person, a program or an LLM wrote it, so it can check an LLM’s work. It can’t tell you whether a day was a good one, or whether the fishing gave way fairly; it tells you whether one rule was broken. It’s also the plainest way I know to show that a plan got better: a check that failed last week and passes now.
Why reach for an LLM, and why not
A first draft of a day is faster to correct than to write, and an LLM writes first drafts quickly. Planning by hand, I start from an empty day: where we leave from, where lunch is, which afternoon gets the pool, what moves if the tide’s wrong. Handed a draft of the day we reach Broome, I can see at a glance that lunch is in the wrong town and fix that one thing. The draft is useful even when it’s wrong, as long as something checks it before anyone drives it.
An LLM can also write the question nobody thought to ask. Given “somewhere with a pool”, it can come back with “Does the caravan park’s pool count, or did you mean the town pool?” before a week gets planned around the wrong one.
Asking an LLM for something costs money and takes seconds, every time. An automatic check costs nothing anyone would count and answers at once. An agent asks its LLM many times for one plan as it goes round its loop, and redoing the plan whenever somebody adds a wish repeats all of that asking. Putting an LLM in a loop changes what the whole system costs, and how far anyone can say in advance what it will do.
The same prompt can get a different answer on a different day. An LLM is usually run with a little randomness in how it picks each next word. The wishes that produced Tuesday’s plan can produce a different plan on Wednesday, with nobody having changed a thing. In the line explaining why the fishing moved, that’s harmless; either wording would do. In the fuel stop it matters. A plan that passed every check on Tuesday tells me nothing about Wednesday’s until the checks run again.
An LLM with tools can do things as well as write about them. A tool that reads the tide table changes nothing. A tool that books a caravan site, cancels one or messages the family changes the trip, and it runs whenever the LLM requests it. So once there are tools, somebody has to set which ones run without a person saying yes first, and put that in the code, where it holds every time. On a family trip, that’s a job for a parent.
I already have two ways of deciding whether a trip like this needs an agent, and both are on this blog. One is the list of signs that an LLM is the wrong tool. The other asks whether anyone could write the steps down before the request arrives; a job where nobody can is the job an agent suits. Fuel at Sandfire is a job anyone could write the steps for. Settling the fishing against the footprints may not be, and that’s where the next question starts.