AI systems

How do AI agents work?

An AI agent combines a model with instructions, state, tools, and a control loop. Instead of producing only one response, the system can choose an allowed action, execute it, observe the result, update state, and continue until it reaches a stopping condition.

Step-by-step

  1. 1

    Receive the goal

    The agent starts from the user's request plus system instructions, permissions, available tools, and any relevant state supplied by the application.

  2. 2

    Select the next action

    The model evaluates the current state and chooses whether to answer, ask for needed information, or invoke one of the actions the application exposes.

  3. 3

    Invoke an allowed tool

    When external work is needed, the orchestration layer executes a structured tool call such as a search, database read, code runner, or connected-app action.

  4. 4

    Observe the result

    The tool returns data or an action result. The agent can use that observation as new context rather than assuming the action succeeded.

  5. 5

    Update progress

    Useful observations are added to the working state, and the control loop decides whether another action is necessary.

  6. 6

    Stop or continue

    The loop continues within configured limits until the task is complete, a safety or permission boundary is reached, or another stopping condition applies.

Keep learning