The Agent Loop: How AI Makes Decisions
The core pattern all agents follow:
- Observe: Gather information about the current situation
- Decide: Determine what action to take next
- Act: Execute the action using available tools
- Repeat: Loop until goal is achieved
Example: "Help me study for Friday's test"
- Observe: Today is Tuesday, test is in 3 days, topic is calculus
- Decide: Check student's calendar for free time
- Act: Call calendar API → sees Wednesday 4-6pm free
- Observe: Found 2-hour block, need study materials
- Decide: Search for calculus practice problems
- Act: Call web_search → found Khan Academy resources
- Observe: Have time slot and materials
- Decide: Create study plan and set reminder
- Act: Call create_event, set_reminder → Done!