AI Agent Visualizations

AI agent visualizations show the part that demos hide: an agent is not a smarter model, it is the same model run inside a loop that lets it act, observe, and try again. This collection animates that machinery step by step, so you can follow a proposed tool call through the harness to its result.

A language model on its own can only produce text. Turn that text into an action — a search, a calculation, a database query — feed the result back in, and let it react, and the same model starts to look like something that can get things done. That is the whole trick: an agent is a loop wrapped around a model, plus the tools it can call, plus the memory it carries between turns. These lessons take that loop apart so each piece is clear before you watch them run together.

What Makes a Model an Agent

Four capabilities turn a text predictor into an agent, and each lesson here is one of them:

  • Tools. The model emits a structured call — a function name and arguments — instead of a final answer. Something runs it and hands the result back. This is the single primitive everything else builds on.
  • A loop. Reason, act, observe, repeat. The model thinks about what to do, takes one action, reads what happened, and uses that to decide the next step — rather than committing to a whole plan blindly.
  • Memory. The agent carries state between turns, and the context window is the bottleneck: what fits, what gets summarized, what gets dropped.
  • Grounding. Retrieval pulls the relevant facts into context so the model answers from real documents instead of its frozen training data.

The Lessons, Around the Loop

LessonWhat you watch
The agent loopa while loop calling the model, running tools, and looping until the model returns text — the budget the only thing the harness decides
Tool callinga model emitting a structured function call and consuming the result
MCP Pluginexternal tool descriptions joining the host pool, a call routed through an MCP client, and the difference between a missing route and a failed lookup
Permissionallow, deny, and ask rules deciding which requested tools execute
Hooksevent and tool matching dispatching a callback before or after tool execution
ReAct loopreason → act → observe repeating until the task is done
Context and memorywhat the agent carries between turns, and the window filling up
System Prompt Assemblyruntime sources becoming system sections, tool definitions, and selected context; a listed skill or unread file does not supply its body
Error Recoverya failed model call classified before any retry — wait, compact the context, raise the output budget, switch to a backup model, or stop and surface the error
Subagentsa Task call forking the same loop onto a fresh messages[] — the noise stays in the child, one result card comes back
Plan Before Actinga checklist with completion conditions, a failed check, and a repair followed by fresh verification
Task Systema goal decomposed into a dependency graph, persisted to tasks.json — a crash costs one task, not the run
Background Tasksa slow command detached to its own shell, the agent working through its own list while it runs, and the completion notification landing at a turn boundary
Agent Teamsa contract update crossing from one private context through a recipient mailbox, then an integration check of the API and UI artifacts
RAGretrieving relevant documents and feeding them into the prompt

A Recommended Learning Order

Start with the agent loop — the structure underneath everything else. An agent is a while loop that calls the model, runs whatever tool it asks for, and loops again until the model replies with text instead of a request; the loop never decides when the task is done, the model's stop_reason does. Once that shape is concrete, tool calling zooms into a single iteration of it: watching a model produce a structured call, pause for the result, and continue makes vivid that the model never runs the tool itself; it only asks. Permission then places a rule check before execution: the harness can allow, deny, or ask for approval, and an unanswered prompt leaves the request waiting. Hooks attaches a callback to a lifecycle event: change its event and tool matcher to distinguish prevention, a report after execution, and a missed call. Then the ReAct loop reads the same cycle as the model's reasoning — it reasons about what to do, acts, observes the outcome, and reasons again, so a hard task becomes a sequence of small, correctable steps instead of one fragile plan.

With the loop in hand, context and memory is the constraint that shapes every real agent: the model is stateless between calls, so everything it "remembers" has to be re-sent in the context window, and that window is finite. Watching it fill — and watching what has to be summarized or dropped — explains most of why agents behave the way they do. Subagents is the loop's answer to that constraint: hand a noisy exploration to a child loop with a fresh context and only the conclusion comes back — at the price that the child knows nothing you didn't write into its prompt. Plan Before Acting makes the intended work and its completion conditions explicit: compare a plan that follows evidence with one that checks off attempts despite a failed result. Where subagents split work across contexts, the task system splits it across time: the goal becomes a graph of small dependent tasks written to disk, so execution order falls out of the edges and a killed process resumes at the exact task it lost — instead of starting the run over. Background tasks put the same loop on a wall clock: detach a slow command and the agent can spend its runtime on work that does not need the output — but only that work, and it only hears that the process finished at its next turn boundary. Agent Teams then connects independent contexts: a peer message carries an API-field update that a completed task status alone does not supply. Compare the same tasks with and without that update, and check whether the UI can read the response. Error Recovery returns to one model call that comes back wrong: the harness classifies the failure first and repairs what caused it — or stops — because a retry without a repair is the same call again. Finish with RAG, the most common way to feed an agent the right facts: retrieve the documents that match the question, paste them into the prompt, and let the model answer from them — grounding its output in real sources instead of memory.

All AI Agent Visualizations

After Tool Calling, open MCP Plugin to follow the external execution route. Toggle the Notes integration while keeping the requested call fixed, then request a missing note: the first change removes a host route, while the second reaches a tool that returns an error.

Follow Context and Memory with System Prompt Assembly to inspect how a request acquires its contents in the first place. Compare a listed skill with loaded instructions, then turn memory loading on and check whether the private fact reaches the assembled request.

Pick any lesson below to open its interactive player, change the input, and step through the result.

Agent LoopEvery agent is one while-loop: call the model, run the tool it asks for, feed the result back, repeat until it stops. The loop never changes — everything else is harness.Tool CallingThe model never runs anything — it returns JSON and stops; your code executes and reports back. One tool call, two round trips.PermissionBefore any tool runs, it passes a rule gate: allow runs it, deny blocks it, ask escalates to you. Set boundaries first, then grant freedom.HooksAttach a check before or after tool execution. Change the event and matcher to see a protected write prevented, reported afterward, or missed entirely.ReAct LoopThought → Action → Observation — why checking the world beats reasoning alone, and what written thoughts add to acting alone: a trace you can audit.Plan Before ActingWrite a plan with completion conditions, then follow a failed check through repair and recheck. Compare the checklist's status with the actual tool results.SubagentsHand a big task to a subagent with a clean context: it works in isolation and bubbles back only the conclusion, so noise never leaks into the main conversation.Context & MemoryWhy an agent compacts its context near the limit — what a summary keeps, what it loses, and what a memory file carries into the next session.System Prompt AssemblyAssemble system sections, tool definitions, and context from runtime sources. Compare listed skills with loaded instructions, and available memory with the contents actually sent.Error RecoveryA failed call isn't the end — it's the start of a retry chain: try again, compact to make room, escalate the token budget, fall back to another model.RAG: Retrieval-Augmented GenerationHow an LLM answers from docs it never trained on — embed, rank by cosine, top-k into the prompt — and why the answer is decided before generation.Task SystemBig goals break into a dependency graph of small tasks, persisted to disk: each node waits on what blocks it, and finishing one unlocks the next.Background TasksSlow work goes to the background while the agent keeps thinking — a long command runs off to the side, and its completion notification lands at the next turn boundary.Agent TeamsTeammates keep separate contexts. Follow a contract update through a mailbox, then check whether their API and UI artifacts agree.MCP PluginDiscover external tools, register their server routes, and follow a call through MCP. Compare an unavailable tool with a failed lookup.