Agent foundations · about 20 minutes of study

Agent loop

An agent loop repeatedly observes state, chooses a permitted action, receives a result and decides whether to stop. The application enforces budgets and permissions.

Before you start: Review Workflow vs agent first. Python-like examples use variables, lists and functions.

Guided concept walkthrough

Follow the mechanism

Observe

Read explicit task state and actual results.

1 / 4

A conceptual animation, not a live model trace. Play advances every five seconds and stops at the final stage.

Start with an everyday explanation

A helper checks the task list, does one allowed errand and reports back before choosing another. They cannot keep spending forever.

See a concrete example

A three-call budget allows lookup, policy retrieval and answer preparation. A fourth proposed lookup must stop or request a new budget.

A claim to question

Think-act-observe does not imply unrestricted execution or guaranteed completion.

Try before revealing the answer

Use the agent simulator to advance until the budget is exhausted, then reset and finish with sufficient evidence.

Show the worked answer

The controller must stop at the enforced limit and expose why. It should not fabricate success or silently raise its own budget.

Now explain the idea to someone else using your own example. If you cannot explain a stage, revisit it before moving on.

Your explanation and revision notes

Loading local notes…

Read the primary reference

Building effective agents

The explanation and exercises are original teaching material. The linked source provides background; examples and assumed numbers here are not claims about a particular company.