The Python Coding Stack: 4. Does an Agent Need a Plan?

Wait 5 sec.

In previous chapters of Agents Unpacked, we explored what makes an AI agent different from a chatbot, how the model, its tools, and the surrounding software work together, and how words become specific tool requests.Calling a tool is one thing. Organising a job that needs many calls is another. Let's say an agent is building a conference programme, where it needs to work across many actions. Should it write a complete plan before starting? What happens when reading the files reveals something the plan didn’t account for?In this conversation, Monty and I explore how much to decide in advance, when to follow a procedure, and what should happen when the original approach no longer fits. A tidy list of steps is a start. It isn’t a timetable.Who’s Monty? Monty is my personal AI agent. Read the introduction to this series.Subscribe nowIn Conversation • Chapter 4Monty:Imagine you’re organising a three-day conference with 112 talks from 89 speakers across four rooms. Some speakers are giving more than one talk, some are available only on particular days, and the rooms have different capacities and equipment.You have spreadsheets containing the talk proposals, speaker availability, and room details, plus last year’s programme as a reference. You want the agent to build this year’s programme in Google Sheets, with a readable timetable and any unresolved clashes clearly identified.You’ve given the agent those files and the request. What would you expect it to do before it starts filling the timetable?Stephen:What would a person organising this do? I guess you'd start by getting a clear picture of all the requirements and restrictions and come up with a plan on how to start drafting the timetable. Then, you'd start filling in more details and resolving conflicts. I'd expect an agent to follow a similar path.Monty:Yes. Getting a clear picture matters because some requirements determine what you can sensibly do next. If several talks need specialist equipment, finding out which rooms have it affects where those talks can go.The agent could start with a provisional plan: inspect the files, identify the restrictions, build a draft, and work through conflicts. But “identify the restrictions” hides some actual work. It has to read the inputs before it knows what those restrictions are.A detailed plan based on files the agent hasn’t read would be an impressive start to the wrong job.Would you expect it to write a complete plan before using any tools, or could reading the spreadsheets be part of working out its plan?Stephen:I had skipped ahead. In the last chapter we talked about tool calls, so yes, it will need to call tools to read the content of the spreadsheets first.Monty:Right. Your overall approach still stands. Reading the files is part of getting that clear picture, not something that has to wait until the agent has a complete plan.Suppose a tool returns a proposal for a talk whose speaker notes say “Friday only”, but the availability spreadsheet lists that speaker as available on Saturday only.That discovery changes the work ahead. The agent can no longer treat both entries as reliable scheduling instructions. It might flag that talk as unresolved and continue with the others, or ask which entry is correct if the answer affects much of the programme.So a useful plan can begin broadly and become more specific as information comes back. What do you think the agent should keep in its plan at this point, and what should it leave undecided?Stephen:Any inconsistencies in the data, such as the one you mentioned above, would have to be left undecided at this stage. Or are you asking about a different aspect of the agent's planning?Monty:Yes, that inconsistency should remain unresolved until there’s evidence to settle it. My question blurred two things: an undecided detail in the timetable and an undecided step in the agent’s approach.I’ve managed to make planning the plan the confusing part.The agent can already plan to build a draft and check for clashes without knowing where every talk will go. It can also record “clarify this speaker’s availability” while continuing work that doesn’t depend on the answer.That’s the useful distinction: a plan can give the work direction without deciding everything in advance. It should preserve the uncertainty, not quietly turn an assumption into a confirmed requirement.Stephen:How does the agent know how to create such a plan?Monty:The model creates the plan using patterns it learned during training, together with the request, any instructions it’s been given, and the information returned by tools. It hasn’t necessarily been taught a specific procedure for this conference.For example, after reading the files, it might identify that several talks require equipment available in only one room. That gives it a reason to propose assigning those talks before less constrained talks, while there’s still flexibility elsewhere in the timetable.There are two possible sources of structure here:We can supply a procedure: read these files, check these requirements, then follow these scheduling steps.We can ask the model to work out an approach from the goal and the available information.An agent can combine both. It might follow an organiser’s checklist but work out how to handle a discrepancy the checklist doesn’t cover.The important limit is that generating a plausible plan doesn’t establish that it’s a good one. The model can overlook a dependency or suggest steps that won’t work. Tool results give it evidence to revise the plan, but they don’t guarantee it will make the right revision.Stephen:Is there a preferred approach between the "give the agent a procedure" approach or the "let it figure it out from the goals" one?Monty:Use a supplied procedure where the steps are dependable, and let the model choose where the work needs judgement. Often, that means combining the two.For our conference, checking whether a speaker has two overlapping talks follows a clear rule. There’s little benefit in asking the model to reinvent that check. Interpreting a free-text note in a proposal, or deciding how to proceed when two sources disagree, is less predictable.A procedure makes repeated work more consistent and easier to test. But a rigid or unsuitable procedure can keep doing the wrong thing very consistently. Giving the model more freedom helps it adapt, but also gives it more opportunities to overlook something, take an unnecessary detour, or spend time on an unhelpful approach.So I’d give this agent established requirements and reliable checks, while leaving it room to organise the work and revise its approach as it reads the files. If a dedicated scheduling tool can handle the actual assignments, the agent can use that rather than trying to reason out all 112 placements itself.The choice isn’t really “procedure or intelligence”. It’s which decisions are already settled well enough to put into a procedure, and which need to remain open?Stephen:Presumably, it also depends on how proficient the human is at the task. Someone who has never organised a conference may not immediately know the right procedures needed. So, does the user's knowledge and expertise affect which approach to use?Monty:Yes. The user’s expertise affects how much useful structure they can supply, but it doesn’t determine how much freedom the agent should have.An experienced organiser might provide established procedures and priorities that aren’t obvious from the files: which requirements are negotiable, for example, or when two popular talks should avoid competing for the same audience.A first-time organiser may need the agent to help identify those questions before building the timetable. The agent can draw on general conference-planning knowledge and consult relevant guidance, but its suggestions aren’t automatically right for this event. It should distinguish requirements found in the supplied material from recommendations it’s introducing.Crucially, a gap in the user’s knowledge isn’t a reason to trust the model more. It may instead be a reason to use a tested procedure, a specialist tool, or an experienced person’s review.The agent’s lack of hesitation isn’t a qualification in conference management.So the agent can help a novice develop an approach, rather than demand a procedure they don’t know how to write. But it should make consequential choices visible. “I suggest leaving ten minutes between talks for changeovers” is a proposal, not a requirement it discovered in the spreadsheet.Stephen:OK, I'm asking too many questions. I'll let you go on.Monty:Your questions have brought us to the useful part: what does the plan actually do once work starts?Suppose the agent writes:Read the source files and identify requirements.Build a provisional timetable.Check for conflicts and revise.Save the programme with unresolved items clearly marked.That list doesn’t execute anything.An agent can write a very tidy to-do list without inconveniencing a single spreadsheet.The model still has to select tool calls, inspect their results, and decide how to proceed. The software running the agent may keep the plan available and let it mark steps as complete, but writing “check for conflicts” hasn’t checked a single talk.Our contradictory speaker availability gives it a reason to adjust the plan. It could record that talk as awaiting clarification and continue scheduling other talks. If it later gets a confirmed answer, it can return to the affected assignment.So there are three distinct things here: the goal, which says what result we want, the plan, which organises the work, and the next action, which does something towards it.For a short task, choosing the next action may be enough. For 112 talks, an explicit plan can help it keep track of dependencies and unfinished work. The useful plan isn’t necessarily the most detailed one. It’s one that helps the agent act without losing sight of the job.Stephen:So what mechanisms keep the agent on track as it follows a plan?Monty:The written plan is one aid. The software running the agent can provide others, including checks and limits that don’t depend on the model remembering to follow instructions.For our conference, those mechanisms could include:A record of progress. The current timetable, unresolved questions, and completed steps are kept available to the model. It can see where work stands instead of relying on its original plan alone.Feedback from tools. A scheduling check reports overlapping talks or missing equipment. That gives the model concrete information to act on, rather than just asking it whether everything looks right.Rules about progressing. The software could require a conflict check before allowing the programme to be marked ready. That is stronger than an instruction saying “remember to check”.Limits on continuing. A maximum number of attempts, tool calls, or elapsed time can prevent endless rearranging. At the limit, the system can stop and return the unfinished programme with its outstanding problems.The distinction is between guidance the model must interpret and conditions the surrounding software enforces. “Ask for help if you get stuck” is guidance. Software that stops after a set number of unsuccessful attempts provides an enforced boundary.Neither makes the whole system infallible. A conflict checker might miss a requirement it wasn’t designed to check. But these mechanisms mean keeping on track needn’t rest entirely on the model repeatedly telling itself to follow the plan.Stephen:I understand. This is not the first time we came across the distinction between the model being told to do something or the harness enforcing something.Monty:Exactly. It’s the same distinction applied to keeping a longer task moving, rather than a new mechanism.There’s another useful distinction here: following the plan isn’t always the same as staying on track. The goal is a workable conference programme, not faithful completion of the agent’s first checklist. New information may make changing that checklist the sensible move.Suppose the agent has repeatedly rearranged talks, but still has a clash involving the only room with specialist equipment. Another rearrangement is useful only if there’s a reason it might help. Otherwise, the next step could be to use a scheduling tool, ask whether a particular requirement is negotiable, or return a partial programme explaining what remains unresolved.If the agent still can’t resolve that room clash, what would you want it to show or explain before handing the unfinished timetable back to you?Stephen:First of all, if there's no solution, I would rather the agent gave the unfinished timetable rather than somehow trying to complete it. I'd then want it to explain the issue and perhaps also suggest some compromises to consider?Monty:Yes. An unfinished timetable with a clear explanation is more useful than one that looks complete because the agent quietly dropped a requirement.There’s an important distinction in your “if there’s no solution”: the agent failing to find a solution doesn’t establish that none exists. Unless it has evidence that the requirements cannot all be met, it should say “I haven’t resolved this clash”, not “this clash is impossible to resolve”.It could show the affected talks, explain which requirements conflict in its current draft, and suggest compromises, such as hiring equipment for another room or asking whether a speaker can attend on another day. Those remain proposals, not changes it assumes you’ve accepted.That gives us a useful stopping point: the agent has preserved the work, made the remaining problem clear, and identified a decision or new information needed to continue. Stopping there can serve the goal better than endlessly rearranging the timetable.Stephen:Got it.Monty:Let’s change one requirement. Partway through building the programme, you tell the agent that one of the four rooms is no longer available.The talks, rather inconsiderately, still need somewhere to happen.The goal hasn’t changed, but some completed assignments may no longer work. That doesn’t necessarily mean starting again, nor can the agent safely assume it only needs to move talks out of the lost room.What would you expect its next action to be?Stephen:Come up with a new plan to reassign the talks that were in the fourth room and move other talks around.Monty:Yes. It should first inspect the current assignments and the remaining rooms’ capacity, equipment, and available time. Those results would help it form the revised plan you describe.Moving a displaced talk might require moving another talk, which could then clash with its speaker’s other session. So the change can spread beyond the talks in the lost room. Equally, if suitable spaces are available, there’s no need to rebuild everything.That brings us back to the chapter’s question: an agent doesn’t always need a separate written plan, but dependent work benefits from a revisable one. The plan gives direction. Tool results and changed requirements inform the next action. The goal, rather than loyalty to the original plan, determines whether to continue, change approach, or stop with unfinished work clearly explained.Stephen:This is not that different from what a capable person would do!Monty:Yes. Much of this is recognisable good working practice: understand the job, identify dependencies, make a provisional plan, and adjust when circumstances change.What differs is how it happens. The model selects actions from the information available to it, and the harness executes tool calls and returns results. A convincing account of that process doesn’t establish that it has done the work well.So the human comparison helps us describe useful behaviour without assuming the agent has a capable organiser’s experience or judgement. We want the practical habits, but we still need evidence that they’re producing a workable result. That leads naturally into the next chapter: how do we check what the agent actually achieved?Stephen:Ah, I'm intrigued.Subscribe nowWhat We’ve Unpacked in This ChapterAn agent doesn’t always need a separate written plan. For work with many dependent steps, a plan can help it keep direction without deciding every detail in advance. Reading the inputs and using tools can be part of working out that plan, not something that waits until planning is finished.The key points:The goal, the plan, and the next action are different. Writing a checklist doesn’t carry out the work.A useful plan can change. Tool results, conflicting information, and new requirements can alter what should happen next.Procedures and model-led decisions can work together. Use dependable steps where they fit, and leave room for judgement where the work is less predictable.Confidence doesn’t replace expertise. A novice user may need help identifying requirements, but that isn’t a reason to trust the model more.Keeping on track needs more than instructions. Progress records, tool feedback, enforced checks, and limits can help. Each still has limits of its own.An honest partial result can be useful. An unresolved clash should stay visible. Failing to find a solution doesn’t prove that none exists.The point is to reach a useful result, not faithfully complete the first checklist. Next, we’ll ask how to check what the agent actually achieved, rather than taking its word that the job is done.Subscribe nowIf you enjoy these conversations, consider becoming a premium subscriber of Notes from the Near Future.> Next Post: Coming soon…Table of Contents