5 Agent Reasoning and Planning
This chapter covers
- How LLMs reason and plan
- Instructing agents to reason and plan
- Advanced planning with agents
- Utilizing the Sequential Thinking MCP server
Reasoning, for an LLM, is the ability to break down a problem into tasks, and then use planning to assemble an approach to carrying out those tasks Without the ability to reason, agents become limited in their ability to plan, and, ultimately, use agency to make decisions, carry out actions, and achieve a goal. As we will see, this core element of an agent's ability often starts with the LLM powering it.
5.1 Understanding LLM Reasoning and Planning
We use our own reasoning all the time to achieve complex goals or even simple ones, like leaving home. For example, to achieve the goal of “leaving home,” we may consider tasks such as getting dressed, verifying that the toaster is off, and making sure to have our keys. Internally, we create the plan: dress -> check toaster -> get keys -> leave. Then we execute the plan according to the tasks.
Non-reasoning large language models are, by default, empirically token-prediction engines. This means they don’t have a thought process that enables them to reason through and complete complex tasks. This limitation often restricts agents to performing one task at a time.