Observe, Decide, Act
About 36 min
Goal
By the end of this lesson, you can trace an agent cycle by separating observations, decisions, actions, and state updates and identify the authority checks required before side effects.
An agent loop becomes easier to reason about when each step has a job. The simplest useful cycle is observe → decide → act.
An observation is evidence available at the current step: a user goal, a tool result, an approval response, a timeout, or a value already stored in state. A decision chooses what should happen next. An action is the permitted operation that actually runs.
After the action, a new observation becomes available and the cycle can begin again.
Follow one cycle with concrete data
Start with this state:
goal = "resolve order 4172"
order_status = unknown
approval = none
step = 0
The system observes that the order status is unknown. The decision is get_order. Application code validates and executes the tool. The tool returns {"status":"delivered","damaged":true}.
That result is not merely text to append somewhere. It is a new observation that should update state in a controlled form:
order_status = delivered
damaged = true
step = 1
Now the next decision has different evidence than the first decision.