Chapter 6. Planning and Reflection
In Chapter 3, we covered reasoning LLMs and their capabilities to demonstrate complex chains of thought. Advanced reasoning enables behavior that is vital in agentic systems, namely the ability to plan actions and reflect on them.
Agents are multi-step entities and generally require planning the actions they will take to complete their goals. Imagine you ask an agent to create a specific feature for your codebase. To bring this to completion, typical steps the agent takes include:
-
Clarify requirements
-
Analyze the existing codebase
-
Design the feature
-
Implement the feature
-
Test the feature
-
Update documentation
To execute all these actions, the agent first needs to be aware of them and track the status of its current state. Planning is essential to solidify this behavior and to allow the agent to dynamically adjust the plan when necessary. After all, without a plan, how would it know what to do next?
This plan and the steps that it contains can often ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access