This lesson on What an AI Agent Actually Is is hands-on and example-driven. You will be able to categorize any AI system into a foundational LLM, a deterministic workflow, or an autonomous agent based on its runtime control logic. You will learn to architect self-refining ReAct loops and avoid the architectural fallacy of mistaking complex linear pipelines for true agentic systems.
What You'll Be Able To Do
- Differentiate between static LLM generation, deterministic control workflows, and autonomous agents.
- Map the ReAct (Reason + Act) loop onto multi-turn autonomous tool selection and execution.
- Identify structural boundaries where deterministic execution pipelines fail and require agentic decision-making.
- Construct closed-loop iteration cycles incorporating critique, reflection, and self-refinement logic.
Detailed Concept Walkthrough
1. Foundational LLMs and Execution Constraints
Base LLMs are passive prediction engines bound strictly to static training data without native access to live runtime state.
- Mechanism: Standard text generation samples tokens purely based on learned weight distributions conditioned on the prompt.
- Under the Hood: Prompts querying real-time calendars or proprietary internal databases fail because the base model lacks live I/O bindings.
- Best Practice: Treat foundational LLM completions as pure generation or reasoning steps rather than dynamic data retrieval engines.
# Level 1: Passive LLM call with no live context
import openai
response = openai.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "What is on my calendar at 3 PM today?"}]
)
# Fails: Model lacks calendar integration and hallucinates or rejects
Key Takeaway: Base LLMs cannot interact with external state or perform actions outside static text generation.
2. Deterministic AI Workflows and RAG
Workflows chain multiple tools and retrieval steps together, but runtime routing remains strictly human-engineered and deterministic.
- Execution Flow: Automation platforms like Make.com or n8n execute predefined DAGs (e.g., Google Sheets -> Perplexity -> Claude).
- Under the Hood: Control logic is fixed at design time; an edge case outside configured branches causes pipeline failure.
- Nuance: Retrieval-Augmented Generation (RAG) injects factual grounding into prompts but does not grant the LLM authority to alter execution order.
# Level 2: Deterministic Workflow (Human-authored DAG)
def deterministic_pipeline(sheet_url: str):
links = read_google_sheet(sheet_url) # Step 1: Fixed input
summary = perplexity_search(links[0]) # Step 2: Fixed API call
post = claude_generate_post(summary) # Step 3: Fixed generation
return post # No dynamic branching
Key Takeaway: Hardcoded multi-step pipelines remain workflows regardless of how many LLM or RAG nodes they contain.
3. Autonomous Agents and the ReAct Framework
The ReAct paradigm enables an LLM to iteratively reason, invoke tools, observe feedback, and self-correct until a goal is achieved.
- Mechanism: The LLM generates a reasoning trace ('Thought'), outputs a tool call ('Action'), and pauses for the environment.
- Under the Hood: The execution environment runs the requested tool, injects the result ('Observation'), and triggers the next LLM step.
- Best Practice: Implement an iterative critique step in the loop so the agent evaluates its own output against constraints before terminating.
# Level 3: ReAct Agent Loop Structure
def react_agent_step(goal: str, tools: dict, max_turns: int = 5):
messages = [{"role": "system", "content": "Reason, select a tool, or finish."}, {"role": "user", "content": goal}]
for _ in range(max_turns):
step = llm_reason_and_act(messages, tools=list(tools.keys()))
if step.is_finish: return step.output
observation = tools[step.tool_name](step.tool_input)
messages.append({"role": "assistant", "content": f"Thought: {step.thought}\nAction: {step.tool_name}"})
messages.append({"role": "user", "content": f"Observation: {observation}"})
Key Takeaway: An agent exists when the model dynamically governs tool selection and loop termination at runtime.
4. The Workflow vs Agent Fallacy
Autonomy is defined by runtime decision-making authority, not the quantity of integrated APIs or tools.
- Mechanism: Adding weather APIs, scrapers, and database writes to a rigid DAG only produces a complex workflow.
- Runtime Internals: An agent dynamically evaluates tool outputs against semantic goals and chooses new branches without human intervention.
- Nuance: Vision and search agents parse unstructured data directly without pre-tagged indices by iteratively inspecting visual targets.
# Fallacy Check: 10 tools chained statically != Agent
# Agent: Model evaluates result and decides whether to retry or switch tools
if agent_evaluator.critique(draft) == "REJECT":
# Agent autonomously decides to pivot tool
next_tool = "perplexity_web_search"
Key Takeaway: Runtime decision-making authority separates deterministic workflows from true AI agents.
Topics Covered in What an AI Agent Actually Is
- Foundational LLM Constraints (1:05 - 2:18) — Examines why base LLMs fail at retrieving proprietary or real-time data without external tools.
- Deterministic AI Workflows (2:19 - 5:28) — Details linear Make.com pipelines integrating Google Sheets, Perplexity, and Claude.
- Defining Agents via ReAct (5:29 - 7:50) — Explains the Reason plus Act paradigm for autonomous tool selection and self-refinement.
- Three-Tier Architecture Model (7:51 - 10:09) — Analyzes Andrew Ng's semantic video search and contrasts the three architectural tiers.
LangChain & LangGraph for AI Agents Cheat Sheet
-
ReAct Step Cycle— Alternates reasoning, tool execution, and observing results iterativelyprompt = "Thought: Need current data.\nAction: search_api('AI')\nObservation: ..." -
Dynamic Tool Dispatch— Executes functions selected dynamically by the model at runtimetools[action.name](**action.args) -
Critique-Refinement Loop— Evaluates interim drafts against criteria before final output generationwhile not passes_rubric(draft): draft = agent.refine(draft, feedback) -
Static Workflow DAG— Executes predefined deterministic nodes in fixed sequencenode_1 = fetch_data(); node_2 = llm_process(node_1); save_db(node_2)
Comparison Table
| Architectural Tier | Control Authority | Edge Case Handling |
|---|---|---|
| Foundational LLM | Prompt input only | Hallucinates or rejects query |
| AI Workflow | Predefined human DAG | Fails without explicit branches |
| AI Agent | Dynamic LLM runtime | Autonomously reasons and self-corrects |
Common Pitfalls
- Mistake: Confusing a multi-step API pipeline containing LLM nodes with an autonomous AI agent. Avoid: Verify whether the LLM dynamically chooses tools and execution branches at runtime.
- Mistake: Relying on a foundational LLM to accurately report proprietary calendar or real-time data. Avoid: Provide live tool bindings or retrieval mechanisms instead of prompting the base model directly.
- Mistake: Deploying an agentic ReAct loop without critique or termination validation steps. Avoid: Implement explicit evaluation criteria so the agent verifies intermediate outputs against constraints before finishing.
FAQs
- Why isn't a complex Make.com or n8n scenario with 10 tools considered an AI agent? If the execution path between tools is hardcoded by the developer, it is a deterministic workflow. A system becomes an agent only when the LLM chooses which tool to invoke at runtime.
- What is the primary role of the ReAct framework in agent architecture? ReAct enables the LLM to alternate between reasoning about the current state and executing tool actions to gather observations.
- How does RAG fit into the three-tier model? RAG provides static retrieval augmentation to supply context to an LLM or workflow, but does not inherently provide autonomous multi-turn agency.