Notes

Observation (Agent)

An agent that acts without looking at the result is only guessing twice. Every time it runs a search, writes a file or calls an API, something comes back — and that return value, handed to the model on its next turn, is the observation.

Where it sits in the loop
The plan–act–observe cycle closes here. The model proposes an action, the runtime executes it, and the outcome is appended to the conversation as a message the model reads before deciding what to do next. In the ReAct pattern it is an explicit labelled step — Thought, Action, Observation, then round again. What arrives is rarely tidy:

  • Tool results: a JSON payload, rows from a query, the text of a file.
  • Failures: a 404, a validation error, a stack trace — equally informative, and usually more.
  • Environment state: a screenshot, a directory listing, the exit code of a shell command.

Why it matters
Observation is what makes an agent correctable. A single model call has to commit to its answer; a loop can discover that the file was empty, the customer id was wrong, or the test still fails, and adjust. Remove the feedback and the agent confabulates a result it never verified.

Shaping what comes back
Observations are also the main cost and risk channel. A 40,000-token API dump buries the plan it was meant to inform, so runtimes truncate it, summarise it, or write it to disk and return a handle instead. And because the text is untrusted, instructions hidden in a fetched web page arrive as an observation — the standard route for prompt injection.

An observation is the result an agent receives after taking an action — tool output, an error message, a screenshot, an exit code — fed back into the model's context as the input to its next decision. It closes the plan–act–observe loop and is the agent's only evidence of what actually happened. Without it the model cannot detect failure or correct course, and will report success it never verified.

Think of someone assembling flat-pack furniture. They turn a screw, then look to see whether the panel actually lined up. That look is the observation.

When AI software does something on its own — searches a site, saves a file, sends a request — whatever comes back is handed straight back to it to read. Maybe the file saved fine. Maybe there was an error message. That feedback is how the software knows whether its last move worked and what to try next. Take it away and you have something acting confidently in the dark, insisting the job is done without ever having checked.