Skip to main content
AI Agents & Automation

⏱ About 10 min10 XP

The Sense-Think-Act Loop

Your heart beats over and over, all day and all night, without stopping. Lub-dub. Lub-dub. Lub-dub. It never gets tired of the same beat. AI agents have their own kind of heartbeat. It is called the sense-think-act loop. Every agent that does something useful in the world runs this loop over and over, again and again. Sense. Think. Act. Sense. Think. Act. Today we will learn each step, understand how they connect, and see why the loop is the key to everything an agent does.

Step 1: Sense

Sense means: gather information about the world right now. This is the first step because the agent needs information before it can do anything useful. It uses its sensors — cameras, microphones, temperature sensors, buttons, GPS — to collect a snapshot of what is happening at this moment. Is the light on or off? Is there a voice speaking? Is the room warm or cold? Is someone tapping the screen? Every sensor sends its information to the agent in this step. Without sensing, the agent is completely in the dark.

Step 2: Think

Think means: look at the information and decide what to do. This is the middle step, and it is the agent's brain doing its work. The agent takes all the sensor information from step 1 and asks: what is going on? And then: given what is going on, what is the best thing to do right now? For a simple thermostat, the thinking step is easy: if the temperature is below 68 degrees, turn on the heater. If it is above 68, turn it off. For a more powerful agent, like a self-driving car, the thinking step is very complex: there is a red light, a pedestrian crossing, a car to my left, and a bicycle to my right. The safest thing is to slow down and stop at the line. Whether simple or complex, thinking is always the same: use the information to choose the best next action.

The Big Idea

The sense-think-act loop has three steps. SENSE: gather information using sensors. THINK: look at the information and decide what to do. ACT: do the thing you decided. Then go back to sense and start again!

Step 3: Act

Act means: do the thing you decided. This is where the agent changes something in the world. It might move, speak, click a button, send a message, turn on a light, or pick up an object. The action always connects back to the sensing. The agent sensed something, thought about it, and now does something in response. After acting, the agent immediately goes back to step 1 and senses again. Because the world changed — maybe because of what the agent just did! — there is new information to gather.

Match each example to which step of the sense-think-act loop it belongs to.

Terms

The camera sees a red traffic light ahead
The agent decides the car should slow down and stop
The car's brakes press and the car slows to a stop
The camera checks if the light is still red or has turned green

Definitions

Sense: gathering information from the world
Act: doing the thing that was decided
Sense again: the loop starts over with new information
Think: choosing what to do based on the information

Drag terms onto their definitions, or click a term then click a definition to match.

The loop never truly stops for an active agent. Even while the car is stopped at the red light, it is still sensing — watching the light, checking for pedestrians, feeling the road. As soon as the light turns green, the agent thinks again and then acts again. This constant loop — sense, think, act, sense, think, act — is what lets the agent respond to a changing world. The world is always changing, so the agent must always be looping.

You Run This Loop Too!

Playing catch is the sense-think-act loop in action. Your eyes sense the ball flying toward you. Your brain thinks: move your hands to that spot. Your body acts: you catch it! Then your eyes sense where your friend is, your brain thinks: throw it back, and your arm acts. Sense, think, act — over and over!

Flashcards — click each card to reveal the answer

What is the correct order of the sense-think-act loop?

A thermostat senses the temperature is 65 degrees. It thinks: that is too cold. It turns on the heater. What comes NEXT?

Loop in a Line

  1. Play this game with two or more people.
  2. One person is the AGENT. One person is the WORLD.
  3. The World picks a secret situation — for example: a cup is about to fall off the table.
  4. The World whispers the situation to the Agent.
  5. The Agent must say out loud: what they sense, what they think, and what they will act.
  6. For example: 'I sense the cup is near the edge. I think it might fall. I act by moving the cup to the center.'
  7. The World then says what happened next — maybe the cup is safe now! The Agent loops and responds again.
  8. Play three rounds, taking turns being the Agent and the World.
  9. After the game, talk about: which step was hardest to figure out?