DEV Community

Cover image for How AI Agents Use LLMs to Reason and Plan
Agentic Affairs
Agentic Affairs

Posted on Edited on Originally published at agentic-affairs.com

How AI Agents Use LLMs to Reason and Plan

How AI Agents Use LLMs to Reason and Plan

Strip the marketing and an agent is not a smarter chatbot. It's a language model stuck in a loop — reason, act, observe, repeat — with tools in its hands and a goal it can't drop. Whether that loop does useful work or burns your budget spinning in circles comes down to one unglamorous thing: the stopping rule.

A chatbot answers and stops. An agent takes a goal, breaks it into steps, acts on the world through tools, watches what actually happened, and replans when reality disagrees. That feedback loop is the whole difference — and the whole risk.

The model does three jobs, and fluency is the least important one

Inside a single run, the same model interprets the goal, decides the next step, and generates the text or tool call. A model can write beautifully while choosing the wrong next step entirely. If you're judging an agent by how fluent it sounds, you're grading the wrong skill. Judge it by whether each step is verifiable — "retrieve the three cheapest options that meet the budget" can be checked; "find the best option" cannot.

ReAct works because the world gets a vote

Chain-of-thought reasoning alone drifts: one early error poisons every later step, and nothing checks the reasoning against reality. The ReAct pattern — reason, act, observe, reason again — fixes that by letting observations interrupt the model's story about itself. The numbers back it up: on ALFWorld, ReAct hit 71% against 45% for acting without reasoning. The lesson isn't that reasoning is magic; it's that reasoning unchecked by the world is just confident hallucination with extra steps.

Replanning is where agent quality actually shows

Real plans fail. A tool errors, a search returns nothing, an observation contradicts the assumption the plan depended on. Good agents detect the failure from the environment — not from the model's confidence — and revise only the invalidated part. Bad agents do one of two things: blindly retry the same failing step forever, or quietly redefine success to match whatever they managed to do. The second one is worse, because it looks like it worked.

The four ways agents break are all boring, and all preventable

Hallucinated tool arguments. Endless loops with no termination condition. Goal drift as the original objective gets buried under pages of intermediate reasoning. Compounding error, where one bad step taints everything after it. None of these are solved by a smarter model. They're solved by strict tool schemas, step caps, progress checks, read-only defaults, and a human gate where getting it wrong is expensive. Guardrails don't make the model smarter — they make its mistakes cheaper and easier to catch.

Go deeper

Read the full guide, including the worked trip-planning example and the checklist for judging whether any agent's plan is sound: How AI Agents Use LLMs to Reason and Plan

Originally published on Agentic Affairs (https://agentic-affairs.com)

Top comments (0)