How AI agents plan and reason

Before an agent acts, it needs a plan: break the goal into smaller steps, choose tools and an order, then adjust when something changes. While it works, it reasons: it thinks through what it knows to decide the next best step. Good planning and reasoning are what stop agents from taking random actions or getting stuck.

Everyday analogy

Planning a family trip. You split it into tasks (book travel, hotel, activities), decide the order, keep a backup plan if a flight is cancelled, and keep thinking things through: "It will rain on Saturday, so let's move the beach day."

Example

Goal: "Plan a 3-day trip to Goa." The agent breaks it into steps (check weather, search flights, search hotels, find places to visit, build a day-by-day itinerary), runs each step with a tool, notices hotels are over budget, replans with cheaper options, and returns the final itinerary.

🎯Goal🧩Break into steps💭Think🔧Act with a tool👀Observe🔄Replan if neededPlan + reason
Agents plan, act, check the result and adjust until the goal is reached.
Type of planningIn plain words
Task decompositionBreak a big goal into smaller tasks
Hierarchical planningPlan at a high level first, then fill in the details
Sequential planningDo the steps one after another
Conditional planning"If this happens, do that" branches
ReplanningChange the plan when results or conditions change
Type of reasoningIn plain wordsExample
DeductiveApply a rule to reach a sure conclusionAll refunds over ₹10,000 need approval; this is ₹12,000, so it needs approval
InductiveSpot a pattern from examplesSales dipped every August for 3 years, so expect a dip this August
AbductiveFind the most likely explanationThe website is slow and the database is busy, so the database is probably the cause
CommonsenseUse everyday knowledgeDon't book a beach day in heavy rain
Multi-stepChain small reasoning steps togetherWork out the budget, then the hotel, then the activities

A ReAct trace: thinking and acting in turns

StepWhat the agent writes or does
💭 ThoughtI need the weather in Goa first.
🔧 Actionsearch_weather("Goa")
👀 Observation30°C and sunny.
💭 ThoughtGood beach weather. Now find hotels under ₹5,000.
🔧 Actionsearch_hotels("Goa", budget=5000)
👀 ObservationA list of hotels with prices.
✅ Final answerRecommends the top 3 hotels, with the weather forecast.

Chain of thought, in one example

Question: "I check 3 flights a day for 2 days. How many searches is that?"
Steps: flights per day = 3; days = 2; total = 3 × 2.
Answer: 6 searches. Writing the steps out makes mistakes much less likely.

Popular techniques: chain of thought (step by step), tree of thoughts (explore several paths), ReAct (think, act, observe), plan-and-execute (full plan first, then run it) and self-reflection (check and improve its own answer). See also advanced reasoning prompts.

Try it yourself

About 10 min

Write a ReAct trace

  1. Pick a goal, e.g. find a good restaurant for a team lunch near the office on Friday.
  2. Write 3 rounds of Thought → Action → Observation, like the table in this lesson.
  3. Add one replanning moment, e.g. the first choice is fully booked.

What you should see: You've just reasoned like an agent: think, act, look, adjust.

Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.

Build it for real · guided projectBuild a document Q&A assistant (RAG, no code)About 60 min · No coding needed · step by step
Test what you learned

Take a quick quiz, or look up any word in the glossary.