Skip to content
Hameed's dev blog

Blog

Agentic AI Chapter 7: Planning, Routing and Decision Strategies

·3 min read·---
Agentic ai chapter 7 planning routing and decisions.png
On this page

Part of the Agentic AI study series.

A real request often needs several steps, different tools, and an order. The agent has to decide what steps are needed, which tool to use next, in what order, and whether it needs more information from the user.

Agentic AI Chapter 7: Planning, Routing and Decision Strategies, handwritten study notes

📊 Real-World Example: A Complex Amazon Request

The user says: "I want to return my laptop, get a refund, and find a similar one with better battery life under ₹70,000."

The LLM generates a plan:

  1. Get order details for the laptop
  2. Check return eligibility
  3. Create a return request
  4. Check refund status
  5. Search for similar laptops with better battery life under ₹70,000
  6. Show the top 3 recommendations

The runtime then executes each step and feeds the result into the next decision. The final answer confirms the return, the refund timeline, and three similar laptops.

🔴 CHECKPOINT: Remember

Planning typeWhen to useAmazon example
Single-stepSimple tasksGet order status
Multi-step (plan and execute)Complex tasks with multiple toolsReturn an item, find a similar product, create a new order
ReAct (reason and act)Tasks with uncertaintySearch with filters and refine on results
Structured function callingWell-defined tasksCancel an order
Hierarchical (manager and workers)Large, complex tasksHandle return, refund, replacement, and recommendations
Routing strategyDescription
Rule-basedPredefined rules, such as "cancel order" goes to the Order Agent
LLM-basedThe LLM picks the best tool or agent
HybridRules for simple cases, LLM for complex ones
Classifier modelA small model classifies the intent and routes
Context-basedUses conversation history and user data

Intent classification: "Can you cancel my order?" is classified as cancel_order, routed to the Order Management Agent, which runs the relevant tools.

Use intent classification, user context, and business rules for better routing.

🛠️ From My Own Work

When I started rebuilding this blog, the work was planned in phases, and each phase had to leave the site deployable. The order of the phases was a plan I could see and change, which is the benefit of a plan written out before execution.


← Previous: State, Memory and Context · Back to the series start · Next: Human-in-the-Loop and Persistence →

Practical notes on product management, distributed systems, and AI—written from real engineering and product experience.