AI Foundations and Problem Framing
Understand what AI is, how to frame problems, and how to plan experiments responsibly.
Content
Intelligent Agents
Versions:
Watch & Learn
AI-discovered learning video
Intelligent Agents: The AI Personas That Actually Do Stuff
"An agent is not a black box — it is a promise: perceive, decide, act, repeat." — Your slightly dramatic AI TA
You learned what AI is, and you already compared AI vs ML vs DL. You refreshed your Python essentials. Now we build the bridge between theory and action: intelligent agents — the organized chaos that turns data and models into behavior.
What Is an Intelligent Agent?
An intelligent agent is a system that perceives its environment through sensors, decides what to do based on its design and experience, and acts through actuators to achieve goals. Think of it like a tiny robot brain: sense, think, act — rinse, repeat.
This is not just robots. A recommender system, a spam filter, and a self-driving car are all agents if they take inputs, make decisions, and change the world.
Why care? Because framing a problem as an agent clarifies the objectives, constraints, and what success looks like — the exact mental model you need before you start coding models in Python.
PEAS: The Agent Design Checklist
When designing an agent, answer these four things. I call it PEAS because acronyms make everything feel serious.
- Performance measure: How do we score success? accuracy, reward, safety metrics
- Environment: Where does the agent operate? deterministic/stochastic, discrete/continuous, observable/partially observable
- Actuators: How does the agent affect the world? wheels, motors, API calls, emails
- Sensors: What can the agent see or sense? cameras, GPS, logs, user clicks
Example: For a self-driving car
- Performance: passenger safety, traffic laws, efficiency
- Environment: continuous, partially observable, multi-agent
- Actuators: steering, throttle, brake
- Sensors: LiDAR, cameras, radar, GPS, maps
Types of Agents (with vibes, not just definitions)
| Agent type | What it is | When to use it | Vibe check |
|---|---|---|---|
| Reflex | Act on current perception | Simple, fast tasks | Pavlovian dog — immediate reflex |
| Model-based | Keeps an internal model of the world | Partial observability | Sherlock with a notebook |
| Goal-based | Chooses actions to achieve goals | When goals drive trade-offs | Ambitious intern with a plan |
| Utility-based | Maximizes a utility function | Complex preferences & trade-offs | Ruthless optimizer with taste |
| Learning agent | Improves from experience | Unknown or changing environments | The student who actually reads the textbook |
How Does an Agent Work? (Pseudo Python loop)
You practiced Python essentials; now translate the agent loop into code. This is the canonical loop every AI system kind of follows.
# very small, very real agent loop (pseudocode/python-flavored)
state = None
while not done:
percept = sensors.read() # get input
state = update_state(state, percept) # maintain internal model
action = agent_program(state) # decide what to do
actuators.do(action) # perform action
done = check_termination(state) # is the job finished?
Notice how this mirrors your earlier Python patterns: modular functions, state management, loops, and clean separation of concerns. If you bungled closures or mutable default args in the Python refresh, this is where it would bite you, so keep your data structures clean.
Examples: From Vacuum Cleaners to Chess Engines
- Simple reflex agent: Robovac that moves and sucks when dirt sensor triggers. Cheap and delightful.
- Model-based agent: Home thermostat that infers occupancy from temperature trends and motion sensors.
- Goal-based agent: Path planner for a delivery drone — goal: deliver package to coordinates while minimizing energy.
- Utility-based agent: Trading bot that balances profit vs risk using a utility function.
- Learning agent: AlphaZero-style game agent that learns from self-play and improves its policy.
Ask yourself: is this agent in a single-agent or multi-agent environment? That drastically changes design choices.
Why Framing as an Agent Clarifies Problem Solving
Imagine being told: "build an AI to recommend movies." Cute. Now frame it as an agent and answer PEAS. Suddenly you see tradeoffs: do we maximize clicks (utility) or long-term retention (long-horizon reward)? Are we allowed to nudge users? This forces ethical and technical constraints up front.
Also, agent framing tells you which tools from Python Essentials you’ll need: async I/O for streaming sensors, numpy/pandas for state updates, classes for encapsulating agent components, and testing to ensure predictable behaviors.
Common Mistakes in Designing Agents
- Ignoring observability: assuming the agent sees the whole world leads to broken models in real settings.
- Undefined performance measure: if you can’t score success, your agent will optimize the wrong thing.
- Overcomplicating early: starting with full-blown utility-based learning when a reflex model suffices.
- Neglecting edge cases: sensors fail, networks lag — plan for degraded modes.
- Failing to simulate: never test only in production; create mock environments for fast iteration.
Quick Checklist Before You Implement
- Define PEAS for your problem
- Choose agent type that matches complexity and observability
- Decide what parts are hand-crafted vs learned
- Simulate, test, and measure with clear metrics
Small note: If you skip simulation because "real data is better," you are volunteering to debug in production. Don’t.
Closing: Tie Back and Look Forward
You came from "What is AI" and the noisy playground of AI vs ML vs DL. That gave you scope and taxonomy. You also refreshed Python essentials. Now: intelligent agents are the bridge that turns those categories and tools into functioning systems.
Remember: an agent is more than models. It’s the whole loop — sensors, state, decisions, actions, and metrics. Keep PEAS as your design North Star, start simple, simulate relentlessly, and let your agent grow (or learn) only as complexity demands.
Next up: we’ll implement a small project agent in Python — a simulated grid-world delivery agent that introduces search, planning, and reinforcement learning. Bring snacks and your favorite debugging emoji.
Version note: This piece connects conceptual foundations to practical Python patterns so you can start writing agents that don’t embarrass you in the wild.
Comments (0)
Please sign in to leave a comment.
No comments yet. Be the first to comment!