VFlash: Fast, Accurate Visual Planning via Flash Primitive Decoding
u_Unrolled
D9: AI Agents & Tool Use · Agent Fundamentals — The Loop That Lets a Model Act
Phase 5/Domain 9/Lesson 1

Agent Fundamentals — The Loop That Lets a Model Act

20 min read·Advanced· Unrolled Pro
Agent Fundamentals — The Loop That Lets a Model Act

You already know: how a prompt becomes a request and how structured output works (D7 Prompt fundamentals); how the context window is a budget (D7 Context engineering); multi-hop retrieval, where one search depends on another (D8 Advanced RAG); and the gap the D8 bridge left: three of eight student requests need actions, not answers.

Why this matters for Atlas. An agent is a model running inside a loop: it chooses an action, your code executes it, the result goes back into the context, and the model chooses again until the task is done. That one loop is behind coding assistants, research assistants and support bots that issue refunds. It's also where most production failures come from: runaway loops, wrong arguments, context that grows until each step costs a fortune, and actions that can't be undone. This lesson builds the loop from scratch, measures what it costs, and gives you the rule for when not to use one.


1. The loop: decide, act, observe

The question. What is the smallest piece of code that turns a model into an agent?

Start from nothing. A plain model call is a function: text in, text out. To act, the model needs three things your code supplies:

That's the preview. The full lesson, with its code and exercises, is part of Unrolled Pro.
Staff AI & Pro Tier Lesson

Unlock "Agent Fundamentals — The Loop That Lets a Model Act"

The foundations are free forever. Unrolled Pro unlocks the complete lesson, production architectures, and 55 battle-tested ML system design case studies.

Everything included with Pro:
All 234+ Deep-Dive Lessons across transformer internals, inference, RAG & agents
55 Staff-Level ML & System Design Case Studies with mathematical capacity estimates
AI Engineer Sheet & Exercises with worked solutions, self-checks, and code
100 Landmark Research Papers guided walkthroughs & progress tracking
14-Day Money-Back Guarantee — 100% full refund if you aren't satisfied
View Plans & Unlock All Lessons

From ₹167/mo (~$2/mo) · Cancel anytime · Instant activation

100% Risk-Free: 14-day no-questions-asked money-back guarantee
Build Atlas · Part 8 of 9: Let it actUse this lesson in the project: Give Atlas tools, memory and a loop, then put a gateway between the model and the tools so that a fooled model still can't do damage.