Skip to main content

02. AI Agent Fundamentals

Goal-Based, Utility-Based and Learning Agents

Goal-based agents plan toward a desired state. Utility-based agents score trade-offs among good outcomes. Learning agents improve from feedback. Together they power most serious Agentic AI systems.

What you will learn

  • Define goal-based, utility-based, and learning agents
  • Contrast binary goals vs utility scores
  • Name the four parts of a classic learning agent
  • Map these types onto LLM tool-using systems
  • Answer interview questions with short, solid answers
Goal-based, utility-based, and learning agents overview
Interview staple: goals reach a state; utility ranks outcomes; learning improves the policy.

Definition

These three types go beyond reflex. Goal-based agents choose actions that help reach a goal state. Utility-based agents maximize a score when many outcomes are acceptable. Learning agents change their behavior using feedback.

In Agentic AI, a coding agent that loops until tests pass is goal-based. One that also prefers cheaper, faster fixes is utility-aware. One that stores successful tool patterns or fine-tunes from evals is learning.

Introduction

This lesson (#4 in AI Agent Fundamentals) follows Reflex Agents. Reflex maps situation to action. Here the agent reasons about the future, preferences, or improvement over time.

Most production LLM agents are primarily goal-based tool users, often with utility constraints (budgets) and optional learning loops.

Why these types matter

  • Explain why ReAct / planner loops exist (goals need multi-step action)
  • Justify cost, latency, and quality trade-offs (utility)
  • Design feedback and eval pipelines (learning)
  • Avoid calling every chatbot โ€œlearningโ€ when the policy is fixed

Goal-based agents

A goal describes desirable world states. The agent searches, plans, or reasons about action sequences that make the goal true. Success is often binary or a checklist (tests green, form submitted, research brief delivered).

  • Decision - prefer actions that advance toward the goal
  • Needs - goal representation, outcome prediction or search, stop when done
  • Examples - navigate to destination; coding agent until CI passes; research until sources cited
  • Limit - many paths may satisfy the goal; does not say which is best

Utility-based agents

When several outcomes meet the goal (or goals conflict), a utility function scores how preferable each outcome is. The agent maximizes expected utility, not only โ€œdone / not done.โ€

Side-by-side comparison of goal-based and utility-based decision criteria
Goals answer โ€œfinished?โ€ Utility answers โ€œwhich finished path is better?โ€
  • Decision - pick action with best expected utility
  • Needs - preferences over cost, time, risk, quality, compliance
  • Examples - travel: price vs duration; support: CSAT vs handle time; LLM: quality vs token spend
  • Limit - designing and calibrating a good utility function is hard

Learning agents

A learning agent improves performance from experience. The classic structure has four parts: performance element, critic, learning element, and problem generator.

Learning agent with performance element, critic, learning element, and problem generator
Without a critic and an update path, you have a fixed agent - not a learning agent.
  • Performance element - the current policy that chooses actions (your agent loop)
  • Critic - compares outcomes to a standard and produces feedback
  • Learning element - updates rules, prompts, memory, or model weights
  • Problem generator - proposes exploratory tasks to improve coverage
  • Modern forms - eval harness + prompt/memory updates; fine-tunes; RLHF-style loops; curated tool-use memory

How the three relate

  • Start with goals for clear success criteria
  • Add utility when trade-offs appear among good outcomes
  • Add learning when you can measure success and safely update behavior
  • Hybrids are normal: goal loop + budget utility + offline learning from traces

Mapping to Agentic AI / LLM systems

Name the dominant type honestly in design reviews.

  • ReAct / plan-execute loops - goal-based performance elements
  • Token budgets, latency SLOs, risk scores - utility constraints or soft utility
  • Trace review, golden evals, memory curation - critic + learning element
  • Synthetic task generation for red-team / coverage - problem generator
  • Fixed prompt agent with no feedback path - not a learning agent

Program / implementation notes

Encode goals and stop conditions as code. Treat utility as explicit scores or ranked constraints. Treat learning as a controlled pipeline, not silent prompt drift.

  • Write done checks: goal predicates you can unit-test
  • Log utility components (cost, latency, quality) per run
  • Separate online acting from offline learning updates
  • Require human or policy approval before high-impact policy changes
  • Next: Autonomous, Reactive and Proactive Agents - behavior axes

Advantages and limitations

  • Advantage: goals make success measurable
  • Advantage: utility handles real trade-offs products face
  • Advantage: learning improves agents without rewriting every rule
  • Limitation: vague goals cause endless loops
  • Limitation: bad utility functions optimize the wrong thing
  • Limitation: bad feedback teaches bad behavior - needs monitoring

Key points

  • Goal-based agents choose actions to reach a desired state.
  • Utility-based agents maximize a preference score among outcomes.
  • Learning agents update their policy using critic feedback.
  • Classic learning structure: performance, critic, learning element, problem generator.
  • Most LLM tool agents are goal-based; budgets add utility; evals add learning.
  • Do not call a fixed-prompt agent a learning agent.

FAQs

Is every LLM agent a learning agent?

No. The model was trained earlier, but the deployed agent only โ€œlearnsโ€ if it systematically updates from feedback (memory, fine-tunes, policy changes). Otherwise it is a fixed performance element.

Do I need utility if I already have a clear goal?

Not always. Add utility when multiple solutions satisfy the goal and you care which one (cheaper, safer, faster, higher quality).

How is a goal different from a utility of 1 or 0?

A binary goal is a special case of utility. Utility-based agents generalize to graded preferences and trade-offs among many dimensions.

What is a critic in a learning agent?

The component that judges outcomes against a standard and produces the feedback signal the learning element uses to improve.

Interview questions

  1. What is a goal-based agent?

    Answer An agent that selects actions to reach a desired goal state, often by planning or reasoning about future outcomes.

  2. What is a utility-based agent?

    Answer An agent that scores outcomes with a utility function and chooses actions that maximize expected utility when trade-offs exist.

  3. Difference between goal-based and utility-based?

    Answer Goal-based asks whether a state is achieved. Utility-based ranks how good outcomes are among alternatives that may all be โ€œsuccessful.โ€

  4. What are the components of a learning agent?

    Answer Performance element, critic, learning element, and problem generator.

  5. Give a real example of each type in software agents.

    Answer Goal: coding agent until tests pass. Utility: support bot balancing CSAT vs cost. Learning: agent that updates playbooks from weekly eval failures.

  6. Where do modern ReAct agents fit?

    Answer Primarily as goal-based performance elements; they become utility-aware with budgets and learning agents only with a real feedback update path.

  7. What can go wrong with learning agents?

    Answer Noisy or biased feedback, reward hacking, unsafe exploration, and unmonitored policy drift that degrades production behavior.

Related topics

Practice task

Complete each numbered practice step in a notebook or doc before opening the next lesson.

  1. Write one-sentence definitions for goal-based, utility-based, and learning agents.
  2. For โ€œbook a flight,โ€ list a goal check and three utility dimensions.
  3. Draw the four-box learning agent structure and label each box.
  4. Classify a product you use: goal only, goal+utility, or learning - justify.
  5. Answer interview questions 1, 3, and 4 in two sentences each.