Module 0 ยท The AI Substrate

From LLM to Agent

The gap between a well-prompted LLM and a functioning agent is not a matter of degree. It is an architectural leap โ€” wrapping a stateless reasoning engine in a persistent loop of observation, planning, and action.

The Core Distinction
Completion Engine

LLM

Receives tokens, predicts the next ones. Single inference call, no persistence, no action beyond text generation.

๐Ÿ“ Receive prompt
โš™๏ธ Single inference
๐Ÿ’ฌ Generate text response
๐Ÿ”š Done โ€” state discarded
System That Acts

Agent

Receives a goal, formulates a plan, executes via tools, observes results, and adapts. Persistent loop pursuing objectives.

๐Ÿ‘ Observe โ€” gather state & context
๐Ÿง  Plan โ€” determine next action
๐Ÿ”ง Act โ€” invoke tools, produce output
๐Ÿ”„ Loop โ€” until goal met or escalation
The Agent Loop
Observe โ†’ Plan โ†’ Act
The defining structural pattern that transforms a stateless inference call into a process that pursues objectives across multiple steps.
Phase 1

Observe

Gather information about current state and environment. Context window constraints determine what the agent can attend to.

Read latest user message or tool result
Query knowledge bases for context
Check workflow state and progress
Retrieve relevant memory
Phase 2

Plan

Determine what to do next. Can be implicit (next-token prediction) or explicit (structured decomposition of complex tasks).

Decompose goal into sub-tasks
Evaluate candidate approaches
Select tools to invoke
Assess whether to escalate
Phase 3

Act

Execute the plan. This is where tool use becomes essential โ€” without tools, the agent can only generate text about what it would do.

Invoke APIs and external systems
Execute code and computations
Produce structured outputs
Update state and memory
Repeat until goal met ยท stalled ยท or escalated
Four Ingredients
What Transforms an LLM into an Agent
Individually necessary, collectively sufficient. Remove any one and the system degrades.

Planning

Decompose goals into steps and revise as information arrives. Gives the agent directionality.

Without it
Reactive โ€” responds but doesn't pursue

Tool Access

Interact with systems beyond the model's parameters: APIs, databases, code execution.

Without it
Theoretical โ€” talks but can't act

Memory

Retain and retrieve information across interactions, beyond the context window's limits.

Without it
Amnesiac โ€” forgets everything between calls

Autonomy

Calibrated degree of independence. Which decisions the agent makes alone vs. which require human approval.

Without it
Inert โ€” needs approval for every action
Orchestration Patterns

Workflow

Deterministic sequences with explicit branching. Each step predefined, high auditability.

Flexibility Low โ€” predefined paths
Auditability High โ€” fully traceable
Best for Regulated processes

Agentic

A coordinator agent dynamically plans which agents to invoke, in what order, based on the task.

Flexibility High โ€” adaptive routing
Auditability Medium โ€” dynamic paths
Best for Complex, variable tasks

Choreography

No central coordinator. Independent agents react to events and each other's outputs.

Flexibility Very high โ€” event-driven
Auditability Lower โ€” distributed paths
Best for High-scale, loose coupling