The PEAS Framework

Unit 2: Intelligent Agents — Section 2.2

Before a software team writes a single line of code, they write requirements. Before an architect draws building plans, they interview the client. Before you design an intelligent agent, you need to answer four essential questions — and the PEAS framework is the tool that helps you do it.

Why PEAS?

When designing an AI agent, you must answer:

  • What is the agent trying to achieve?

  • What kind of world does it operate in?

  • What can it do in that world?

  • What can it sense about that world?

PEAS provides a structured checklist that ensures you have thought through all essential aspects of agent design before implementation begins. Teams that skip this step often build technically correct systems that solve the wrong problem.

PEAS

A four-component framework for specifying intelligent agent design problems: P — Performance measure (how success is evaluated), E — Environment (the world the agent operates in), A — Actuators (mechanisms for taking action), S — Sensors (mechanisms for perceiving the environment).

The Four Components

Performance Measure

The performance measure defines what counts as success. It is the external, objective criterion by which an outside observer evaluates the agent.

The performance measure is set by the designer, not the agent. The agent does not need to "know" its performance measure — it just needs to behave in ways that score well on it. A vacuum robot does not need to understand the concept of cleanliness; it just needs to pick up dirt. We evaluate its performance by measuring floor cleanliness.

Important subtleties:

  • Performance measures often involve multiple criteria that can conflict with each other. A self-driving taxi must be safe, fast, comfortable, and fuel-efficient — and these goals sometimes pull in opposite directions.

  • A poorly specified performance measure can cause an agent to optimize for the wrong thing. A cleaning robot rewarded for "reported cleanliness" might cover its sensors rather than actually cleaning.

Environment

The environment is the world the agent inhabits — everything it can potentially interact with or be affected by. Specifying the environment fully helps you anticipate edge cases and failure modes before they occur.

Actuators

Actuators are the mechanisms through which the agent takes actions. They translate the agent’s decisions into physical or digital effects in the environment. When specifying actuators, be concrete: what exactly can the agent change about its world?

Sensors

Sensors are the mechanisms through which the agent receives percepts. Specifying sensors precisely reveals the information the agent will and will not have access to — which directly determines how difficult the design problem is.

PEAS in Practice: Three Worked Examples

Self-Driving Taxi

Component Specification

Performance

Safe arrival at destination; minimize travel time; minimize fuel consumption; passenger comfort (smooth driving); obey traffic laws; maximize profit (fares minus costs)

Environment

Roads, traffic signals, other vehicles, pedestrians, cyclists, weather conditions, construction zones, parking lots

Actuators

Steering system, accelerator, brake, turn signals, horn, passenger display/audio system

Sensors

Cameras (360°), LIDAR, radar, GPS, speedometer, accelerometer, microphone (passenger requests), weather feed

Notice the trade-offs in performance: safety and speed can conflict; fuel efficiency and passenger comfort can conflict. The agent design must balance these competing criteria.

Medical Diagnosis System

Component Specification

Performance

Diagnostic accuracy; minimize false negatives (missed diseases); minimize false positives (unnecessary treatment); minimize cost of recommended tests; time to diagnosis

Environment

Patient, hospital information system, medical knowledge base, test results database, medical imaging systems

Actuators

Display for diagnosis and recommendations, report printer, database write interface

Sensors

Symptom input interface, laboratory test result feeds, medical imaging reader, patient history database, electronic health record API

Notice the critical trade-off: false negatives (missing a real disease) are often far worse than false positives (over-diagnosing), so the performance measure must weight them asymmetrically.

Interactive English Tutor

Component Specification

Performance

Student improvement on standardized metrics; engagement and session length; student satisfaction scores; reduction in error rates over time

Environment

Student, curriculum database, exercise library, student performance history

Actuators

Lesson display, exercise delivery system, feedback display, audio speaker (pronunciation guidance)

Sensors

Keyboard (written responses), microphone (spoken responses), touchscreen, camera (engagement detection), timer

Applying PEAS to Your Own Systems

The PEAS framework is most valuable when you apply it yourself, not just read examples. Here is a step-by-step process:

How to Write a PEAS Description:

  1. Start with Performance — ask: "How would a neutral observer evaluate this agent’s behavior? What outcomes matter most? What trade-offs exist?"

  2. Specify the Environment — list everything the agent must deal with, including the unexpected. Think about edge cases.

  3. List the Actuators — be concrete. What actions can the agent physically or digitally perform?

  4. List the Sensors — what information is available? What is not available? Gaps in sensing directly create design challenges.

  5. Check for consistency — does every sensor feed information relevant to the performance measure? Does every actuator contribute to a performance goal?

Choose one of the following systems and write a PEAS description:

  1. A restaurant reservation chatbot

  2. A drone package delivery system

  3. An automated stock trading system

  4. A smart irrigation controller for a farm

Pay particular attention to the performance measure: what does success look like, and what trade-offs are embedded in your definition of success?

Why PEAS Matters in Real AI Development

The PEAS framework is not just academic — it mirrors requirements engineering practices used in industry:

  1. Requirements Gathering: PEAS forces you to identify what you need before coding begins

  2. Team Communication: A shared PEAS description gives a team a common vocabulary for discussing agent design

  3. Test Design: Performance measures from PEAS directly become your evaluation criteria

  4. Failure Analysis: When an agent underperforms, revisiting PEAS often reveals a missing sensor, an underspecified actuator, or a performance measure that incentivized the wrong behavior

  5. Scope Management: PEAS makes the boundaries of the system explicit, preventing scope creep

Many high-profile AI failures trace back to a poorly specified performance measure — the "P" in PEAS. Amazon’s experimental recruiting tool, trained to score job candidates, learned to penalize resumes that included the word "women’s" (as in "women’s chess club"). The performance measure (predict which candidates were hired historically) encoded historical bias rather than actual job suitability. A careful PEAS analysis might have caught this before deployment.

Test Your Understanding

Apply the PEAS framework to analyze a spam filter agent.


Based on the UC Berkeley CS 188 Online Textbook by Nikhil Sharma, Josh Hug, Jacky Liang, and Henry Zhu, licensed under CC BY-SA 4.0.

This work is licensed under CC BY-SA 4.0.