Course contentsShow
← Machine Learning and Deep Learning
Lesson 2065 of 3,53844. AI Agents: FoundationsFree lesson

Action Selection and Decision Making

Understand how the LLM chooses which tool to invoke based on current state and goal progress.

Action Selection and Decision Making

What you'll learn: How an AI agent decides which tool to invoke at each step based on its current state and goal progress.

The Decision Point

In every perception-action loop iteration, the agent faces a critical question: What should I do next? This is where action selection happens. The LLM examines its current state (what it knows, what it has tried), the available tools in its action space, and the goal it's pursuing, then chooses the most appropriate action.

How the LLM Chooses

The decision-making process happens within the LLM's reasoning step (the "Thought" in ReAct). The model uses:

  1. Goal alignment: Which action moves closer to the objective?
  2. State awareness: What information is missing? What has already been tried?
  3. Tool capabilities: Which tool in the registry can provide what's needed now?
  4. Observation feedback: Did the last action succeed or fail? Should it retry, pivot, or finish?

Think of it like a chef deciding which utensil to grab next. They consider what they're making (goal), what ingredients they've already prepared (state), what tools are available (action space), and whether the last step worked (observation). They wouldn't grab a whisk after already whisking—they'd move to the next logical step.

Influencing Selection

Your prompt engineering shapes these decisions. Clear tool descriptions, explicit success criteria, and structured reasoning templates guide the LLM toward better action choices. The agent might select "search" when lacking information, "calculate" when needing computation, or "finish" when the goal is met.

Key Takeaway: Action selection is the LLM's reasoning process that maps current state and goal progress to the next tool invocation, guided by your prompt design and the agent's understanding of what each tool accomplishes.