Skip to content
Let’s Talk
WORKING WITH AI AGENTS / LESSON 2 OF 10

How does an agent get a job done?

An agent works in a loop: it looks at the goal, picks a step, takes it, reads the result and picks the next step. It repeats this until the job is done or a rule tells it to stop.

WHERE YOU ARELesson 1 said what an agent is. This lesson follows one through a single request.

One request, step by step.

A customer writes: “Where is my order? I placed it last Tuesday.” Here is what the agent does.

  • It reads the message and works out the goal: tell this customer where the order is.
  • It looks up the customer’s orders by email address.
  • It finds one order from last Tuesday and reads its status: shipped.
  • It checks the carrier’s tracking and sees the parcel is due on Thursday.
  • It writes a reply with the status and the date, and sends it.

The loop.

Each step has the same four parts. The agent picks a step, takes it, reads what came back and decides what to do next.

Working out the steps is called planning. The plan is not fixed in advance. It changes with what the agent finds.

When the path changes.

Suppose the look-up finds two orders from last Tuesday. A fixed rule would fail here. An agent can ask the customer which one, or report on both.

This is the strength of an agent. It is also the risk, because nobody wrote down each move ahead of time.

Knowing when to stop.

An agent needs a finish line. For this job it is a reply sent, or the message passed to a person.

It also needs a limit on tries. An agent with no limit can repeat the same failed step many times.

Try it: what does the agent do next?

A customer asks where an order is. At each of four points, choose the agent’s next step. The case is fictional.

  • The message has arrived. The agent has not found the order yet.

    Show the answer

    It looks something up. It needs the order before it can say anything.

  • The order is found. Its status says “shipped”, with no delivery date.

    Show the answer

    It looks something up. The carrier’s tracking has the date.

  • The tracking shows the parcel is due on Thursday.

    Show the answer

    It replies. It has what the customer asked for.

  • The tracking shows the parcel was sent back to the shop.

    Show the answer

    It passes this to a person. Something has gone wrong, and the customer needs more than a status.

Check yourself.

Answer each question in your head, then open it.

What are the four parts of each step?

The agent picks a step, takes it, reads what came back and decides what to do next.

How is an agent’s plan different from a fixed rule?

A rule is written in advance. An agent’s plan changes with what it finds.

What two things tell an agent to stop?

A finish line, such as a reply sent, and a limit on how many times it may try.

Go further.

Glossary
Insights

The examples are fictional. This is general guidance, not advice for your situation.