7.1 What is an AI Agent?

Definitions: autonomy, goals, environment interaction

Defining AI Agents

An AI agent is an autonomous system that perceives its environment, makes decisions, and takes actions to achieve specific goals. Unlike traditional AI models that simply respond to prompts, agents exhibit proactive behavior, maintain state across interactions, and can plan and execute complex multi-step tasks.

Core Definition

An AI Agent is a goal-oriented system that can:

  • Perceive and understand its environment
  • Make autonomous decisions based on goals
  • Take actions to achieve those goals
  • Learn and adapt from experience
  • Operate independently over extended periods

Traditional AI vs AI Agents

📋 Traditional AI Models

  • Reactive: Responds to specific inputs
  • Stateless: No memory between interactions
  • Single-turn: One input → one output
  • Passive: Waits for human instruction
  • Task-specific: Designed for narrow use cases

Example: A language model that answers questions when prompted

🤖 AI Agents

  • Proactive: Initiates actions toward goals
  • Stateful: Maintains memory and context
  • Multi-turn: Engages in extended workflows
  • Autonomous: Operates independently
  • General-purpose: Adapts to various domains

Example: An agent that monitors emails, schedules meetings, and follows up automatically

Essential Characteristics of AI Agents

🎯 Goal-Oriented Behavior

Agents have explicit objectives and work systematically to achieve them, often breaking down complex goals into manageable sub-tasks.

  • Clear objective definitions
  • Success criteria measurement
  • Progress tracking and adjustment
👁️ Environmental Perception

Agents can sense and interpret their operating environment through various inputs and feedback mechanisms.

  • Multi-modal input processing
  • Context awareness
  • Real-time adaptation
🧠 Autonomous Decision Making

Agents can evaluate options, make decisions, and choose actions without constant human intervention.

  • Independent reasoning
  • Risk assessment
  • Action selection
Action Execution

Agents can interact with their environment through tool use, API calls, and other action mechanisms.

  • Tool integration
  • API interaction
  • Physical actuation (robotics)
🔄 Continuous Learning

Agents improve their performance over time through experience, feedback, and adaptation.

  • Experience accumulation
  • Strategy refinement
  • Performance optimization
Temporal Persistence

Agents maintain state and context across extended periods, enabling long-term task execution.

  • Memory management
  • State persistence
  • Context continuity

The Agent Control Loop

AI agents operate through a continuous cycle of perception, decision-making, and action:

Perceive
Environment
Process
Information
Make
Decision
Execute
Action
Observe
Results
class AIAgent: def __init__(self, goal, environment): self.goal = goal self.environment = environment self.memory = AgentMemory() self.decision_engine = DecisionEngine() self.action_executor = ActionExecutor() async def run(self): """Main agent control loop""" while not self.goal_achieved(): # 1. Perceive current state state = self.environment.get_current_state() # 2. Update memory with new information self.memory.update(state) # 3. Analyze situation and make decision decision = self.decision_engine.decide( current_state=state, goal=self.goal, memory=self.memory ) # 4. Execute chosen action result = await self.action_executor.execute(decision.action) # 5. Observe and learn from results self.memory.record_action_outcome(decision, result) # 6. Update goal or strategy if needed self.adapt_strategy(result) def goal_achieved(self): """Check if primary goal has been accomplished""" return self.goal.is_satisfied(self.environment.get_current_state())