Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

AI agents are software systems that do more than generate one response. They can break a goal into steps, use outside tools, store useful information, and update their next action based on results. This matters because many real tasks, such as scheduling, coding, research, and robotics, require a loop of thinking, acting, and checking rather than a single answer.

A typical AI agent starts with an input goal, builds a plan, chooses tools, performs actions, reads feedback, and revises its next step. Memory helps the agent keep track of past interactions, important facts, and intermediate results across the task. Reasoning helps it compare options and detect errors, while the action loop lets it continue until it reaches a stopping condition such as success, timeout, or human approval.

Understanding How AI Agents Work

A planner is not a magical map of the whole task. It is a method for turning a broad request into smaller decisions. For a travel task, the agent may first identify dates, budget, location, transport, and booking rules.

Each part can depend on an earlier result. A fixed plan works for simple jobs, but real tasks change as new information arrives. If a flight is unavailable, the agent needs to revise the later steps that depended on it.

Good planning includes constraints. These are limits such as a spending cap, a deadline, allowed websites, or a rule that requires human approval before payment. Without clear constraints, an agent can produce an answer that sounds sensible but does not satisfy the real task.

Tools give an agent ways to obtain or change information outside its language model. A search tool can return web pages. A calculator can check arithmetic.

A code runner can test a program. A calendar tool can read free times or create an event. The agent must translate its intention into the exact inputs a tool expects.

It then has to interpret the result correctly. Tool output is not automatically true or safe. Search results can be outdated.

A database can contain missing records. A tool can fail because of a network problem or lack of permission.

Reliable agents check details such as dates, units, source quality, and whether the result actually answers the needed subtask. They should never treat a tool response as proof without examining it.

Memory solves a practical limit. An agent cannot keep every detail from a long task active forever. Working memory holds the current goal, recent observations, unfinished steps, and temporary values.

It is similar to notes on a desk during a calculation. Longer lasting memory may store user preferences, successful procedures, or facts learned in earlier tasks. This memory is often retrieved by finding entries that are similar to the current situation.

That process can help, but it can introduce errors. An old preference may no longer apply. A remembered fact may be wrong.

Personal data may be sensitive. Well designed systems label where memories came from, record when they were saved, and allow people to review or delete them.

The ReAct approach links reasoning with actions and observations. Instead of committing to a long chain of steps at once, the agent makes a small decision, gathers evidence, then uses that evidence for the next decision. This is useful when the world can surprise the system.

A coding agent might run a test, read an error message, locate the relevant file, make one change, then test again. Self reflection is a checking stage, not a guarantee of correctness. The agent can compare its result with requirements, search for contradictions, or ask for a second method to verify a calculation.

Students should pay attention to failure cases. An agent needs clear stop rules, limits on repeated attempts, and human control for important actions. The strongest lesson is that an agent is judged by reliable outcomes, not by confident sounding explanations.

Key Facts

  • Agent loop: observe -> plan -> act -> evaluate -> repeat
  • A planner decomposes a goal G into subgoals {g1, g2, g3, ...}
  • Tool use extends capability: output = model(input, tool_results, memory)
  • Working memory stores short term state, while long term memory stores reusable facts and past outcomes
  • A simple score for choosing an action can be written as U(a) = expected benefit - expected cost
  • The loop ends when goal_reached = true, max_steps reached, or confidence drops below a safety threshold

Vocabulary

AI agent
An AI agent is a system that can perceive information, make decisions, and take actions to pursue a goal.
Planner
A planner is the part of an agent that breaks a large task into ordered steps or subgoals.
Tool use
Tool use means the agent calls external resources such as calculators, search systems, databases, or code runners to get results.
Working memory
Working memory is the short term information the agent keeps active during the current task.
Feedback loop
A feedback loop is the cycle in which the agent checks the result of an action and uses that result to decide the next step.

Common Mistakes to Avoid

  • Thinking the model alone is the whole agent, which is wrong because an agent usually includes planning, memory, tool access, and control logic around the model.
  • Assuming memory means perfect recall, which is wrong because stored information can be incomplete, outdated, or retrieved at the wrong time.
  • Using tools without verification, which is wrong because tool outputs can contain errors or irrelevant data that should be checked before the next action.
  • Treating the first plan as fixed, which is wrong because effective agents revise plans when feedback shows failure, new constraints, or better options.

Practice Questions

  1. 1 An agent has a goal that it breaks into 4 subgoals. Each subgoal requires 3 tool calls and 1 evaluation step. How many total tool calls and evaluation steps are needed if all subgoals are completed once?
  2. 2 A memory system stores 12 facts from earlier tasks. During a new task, the agent retrieves 5 facts, but 2 are irrelevant. What fraction and percentage of the retrieved facts are useful?
  3. 3 Explain why an agent that can use tools but has no memory may perform worse on a multi step task than an agent with both tools and memory.