|
Building AI AgentsA Complete Guide from Zero
Plain-language referenceEditor · Brain · Agent · Frameworks
Building AI AgentsA complete, plain-language guide from zero — the developer's workshop, how the model thinks, and the leap from chatbot to autonomous agent. Every technical term is defined the first time it appears, in plain words, often with an analogy. Wherever a word is industry shorthand, the plain meaning comes first and the buzzword second. Diagrams are redrawn as flowcharts; code snippets are short and illustrative — meant to show you what things look like, not full tutorials. How to read this guideThe guide moves in a deliberate order. Each part assumes the one before it — read straight through the first time, then use it as a reference. 01The Developer Toolkit — the workshop you build in
02Tech Stacks — what you build software with
03How the Brain Works — LLMs, tokens, embeddings
04From Chatbot to Agent — the leap to something that acts
05Making an Agent Intelligent — planning, reliability
06Frameworks — LangChain, LangGraph, Claude Agent SDK
07Multi-Agent Systems & Deep Agents
08Putting It Together — first project, deploy, cost, security
Part 01The Developer ToolkitBefore you build anything, you set up a workshop. These are the tools every software project uses, agents included — the basics of how you write, save, and share code. 1.1 What a code editor is, and why VS CodePlainA code editor is a text editor built specifically for writing code. It's like Microsoft Word, but instead of helping you write essays it helps you write instructions for a computer — coloring your code so mistakes stand out, auto-completing words, and flagging errors before you run anything. VS Code (Visual Studio Code) is the most popular free code editor in the world, made by Microsoft. People use it because:
Analogy
Think of VS Code as a fully equipped kitchen. The stove, knives, and counters are all there. Extensions are like specialized appliances — a pasta maker, an ice-cream churn — you add when a recipe needs them. When people say IDE (Integrated Development Environment), they mean a code editor with extra built-in tooling for running and debugging programs. VS Code sits between a plain editor and a full IDE — light by default, powerful once you add extensions. 1.2 The terminal (command line) in plain termsPlainThe terminal is a text-based way to give your computer commands by typing them instead of clicking icons. You type a command, press Enter, and the computer does it. You've always controlled your computer through a GUI (Graphical User Interface — the windows, icons, and buttons you click). The terminal is the older, text-only alternative — a CLI (Command Line Interface). Developers use it because it's faster and more precise for many tasks, and most programming tools are designed to be controlled this way. A few commands you'll see constantly: Terminal cd my-project # "change directory" — move into a folder ls # "list" — show what's in the folder (dir on Windows) mkdir agent-app # "make directory" — create a new folder python app.py # run the Python program named app.py Analogy
The GUI is ordering food by pointing at pictures on a menu. The terminal is telling the chef exactly what you want in words. Slower to learn, but you can order anything, precisely. 1.3 Version control — what git actually doesThe problem it solves: you've all done this — PlainGit is a tool that takes snapshots of your project over time, so you can see exactly what changed, when, and by whom — and rewind to any earlier snapshot if you break something. Each snapshot is called a commit: a saved checkpoint with a short message describing what you did (“added login feature,” “fixed crash on empty input”). The core loop looks like this:
Edit filesin your editor
git addstage your changes
git commitsave a checkpoint
git pushupload to GitHub
↻ then back to editing — repeat for every change
Fig. 01The git workflow loop — edit, stage, commit, push, repeat.
Key terms, all defined:
Analogy
Git is a video game with unlimited save slots. A commit is a save point. A branch is starting a “what if” playthrough from a save without overwriting your main game. Merge is importing the good stuff from the experiment back into your main save. 1.4 GitHub vs git — the difference, and why it mattersThis trips up almost everyone at first, so let's be precise.
Analogy
Git is the camera that takes the photos. GitHub is the shared photo album in the cloud where the family can all view and add pictures. Why it matters for agents specifically: almost every agent framework and tool lives on GitHub — you'll go there constantly to read docs, report bugs, and copy starter projects. Cloning a repo ( The GitHub CLI ( Terminal git init # start tracking this folder git add . && git commit -m "Initial commit" # save a first checkpoint gh repo create my-project --public --source=. --push # create + upload 1.5 Environments and packages — why “it works on my machine” happensThe problem: your project depends on dozens of pieces of code written by other people — packages or libraries. Project A might need version 1 of a library; Project B might need version 2. If you install everything globally, they collide.
A typical Python setup, with every line explained: Terminal · Python python -m venv .venv # create a private bubble for this project source .venv/bin/activate # step inside it (Windows: .venv\Scripts\activate) pip install langchain anthropic # install packages — only inside this bubble Analogy
A virtual environment is a separate toolbox for each job. Project A's toolbox has a 1-inch wrench; Project B's has a 2-inch wrench. They never get mixed up, because each job carries its own box. You'll also hear about API keys here. An API key is a secret password that proves you're allowed to use a paid service (like Claude's or OpenAI's models). You store it in a hidden file (usually .env · never committed # .env file — kept secret, never committed to git
ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxPart 02Tech StacksWhat you build different kinds of software with — and where an agent actually lives in the picture. 2.1 What “tech stack” meansPlainA tech stack is the full set of technologies — languages, frameworks, databases, and services — you combine to build a particular piece of software. “Stack” because the pieces layer on top of one another. There's no single “correct” stack; you pick tools that fit the job, the same way you'd pick different vehicles for a city commute vs. hauling furniture. 2.2 Front-end, back-end, database — the restaurant analogyMost software that people interact with has three layers:
User
clicks, types
Front-endwhat you see
requests
Back-endthe logic & rules
reads / writes
Databasestored info
Fig. 02The three layers of most software — dining room, kitchen, pantry.
Where agents live
An AI agent is almost always back-end logic. It receives a request, thinks, calls tools, and returns an answer. It may have a simple front-end (a chat window), but the intelligence is back-end. This is why Python dominates agent work — it's a back-end language with the richest AI ecosystem. 2.3 Databases — SQL vs the restTwo broad families, defined simply:
For agents you'll also meet a special kind:
2.4 Typical stacks by project type
2.5 Where Python fits and why it dominates AIPython is a programming language designed to be readable — its code looks almost like English. It won the AI world for three reasons:
A complete, runnable example of talking to Claude — note how readable it is: Python import anthropic # the official Claude library client = anthropic.Anthropic() # connects using your secret API key message = client.messages.create( model="claude-sonnet-4-5", # which model to use max_tokens=300, # cap on how long the reply can be messages=[ {"role": "user", "content": "Explain what an API is in one sentence."} ], ) print(message.content[0].text) # show Claude's answer That's the entire skeleton of every AI app: connect, send messages, read the reply. Everything else in this guide is about making what happens between “send” and “reply” smarter. Part 03How the Brain WorksThis is the engine inside every agent — LLMs from the ground up. Understand this part well and the rest clicks into place. 3.1 Neural networks, explained without mathPlainA neural network is a computer program loosely inspired by how brain cells connect. It's a giant web of simple math units (“neurons”) arranged in layers. Each connection has a weight — a number that says how strongly one unit influences the next. The only idea you really need: a neural network is a machine that learns patterns from examples by adjusting those weights. You don't program the rules; you show it millions of examples and it figures out the rules itself.
InputInput
Output
input layer → hidden layers (weighted connections) → output
Fig. 03A neural network — simple units in layers, learning by tuning the weights between them.
Analogy
Teaching a child to recognize dogs. You don't list rules (“four legs, fur, tail”). You point at hundreds of dogs and say “dog.” Eventually the child generalizes. A neural network does this with numbers: it sees an example, guesses, checks how wrong it was, and nudges its weights to be a little less wrong next time. Repeat billions of times. The process of nudging weights to reduce error is called training. The “how wrong was I” measurement is the loss, and the nudging method is backpropagation — you don't need the mechanics, just the intuition: guess, measure error, adjust, repeat. 3.2 What an LLM is and how it “predicts”LLM stands for Large Language Model. Break it down: Language — it works with text. Model — it's a neural network (a trained pattern-machine). Large — it's enormous: trained on a huge chunk of the internet, books, and code, with hundreds of billions of weights. What it actually does, at its core: an LLM predicts the next chunk of text, over and over. Given “The capital of France is,” it computes that “Paris” is the most likely next word and outputs it — then does it again, now including “Paris,” to predict what comes after. That's it. Everything impressive — answering questions, writing code, reasoning — emerges from doing next-word prediction extremely well at massive scale. Analogy
It's autocomplete on your phone, but trained on essentially all written human knowledge and scaled up a billionfold. Your phone suggests one word; an LLM can continue for pages, coherently. The architecture that made modern LLMs possible is the Transformer (the “T” in GPT). Its key trick is attention — when generating each word, the model weighs how relevant every other word in the input is. That's how it keeps track of context across a long passage. Just know: “Transformer” = the design, “attention” = how it stays on-topic. 3.3 Tokens and the context window — and why they cost moneyPlainLLMs don't read whole words or letters. They break text into tokens — chunks that are often a word, part of a word, or a punctuation mark. As a rough rule, 1 token ≈ 4 characters ≈ ¾ of a word in English. (“cat” → 1 token; “unbelievable” → ~3 tokens; “Hello, world!” → ~4 tokens.) Why you must care about tokens:
Context Window · ~200,000 tokens · the model's desk
Your currentquestion
Documents /tool results
Conversationhistory
System promptinstructions
Replyalso counts toward the limit
Fig. 04The context window — everything the model uses to answer must fit on the desk at once.
Analogy
The context window is a desk of fixed size. Everything the model uses to answer — instructions, past messages, pasted documents, your question — must fit on the desk at once. When the desk fills up, older papers fall off the edge (the model “forgets” the start of a long chat). Managing what's on the desk is a real skill, covered in Part 5 as context engineering. 3.4 Training vs inference; prompting; temperature
3.5 Embeddings — turning meaning into numbersThis concept unlocks “let the agent search my documents,” so it's worth getting. PlainAn embedding is a list of numbers that represents the meaning of a piece of text. Texts with similar meaning get similar lists of numbers, even if they share no words. So “How do I reset my password?” and “I forgot my login credentials” land close together in this number-space, while “What's the weather?” lands far away.
'reset my password'
'forgot my login'
'today's weather'
Embeddingmodel
[0.91, 0.10, 0.82 …]
[0.88, 0.12, 0.79 …]
[0.10, 0.95, 0.20 …]
close vectors = similar meaning · far apart = different meaning
Fig. 05Embeddings place meaning on a map — nearby points mean nearby ideas.
Analogy
Imagine placing every sentence as a pin on a giant map where location encodes meaning. All the “billing” sentences cluster in one region, all the “shipping” sentences in another. To find relevant information, you drop a pin for the question and grab the nearest neighbors. That map is what a vector database stores. This “search by meaning” is the foundation of RAG, which we'll build in Part 4. 3.6 Limitations you must design aroundLLMs are powerful but flawed in specific, predictable ways. Good agent design is largely about working around these:
These five limitations are exactly why agents exist. An agent is the scaffolding that compensates for them. Part 04From Chatbot to AgentThe key leap — what turns a text predictor into something that acts. 4.1 LLM vs workflow vs agent — the crucial distinctionPeople use “agent” loosely. Here's a clean way to separate the ideas:
Workflow · you define the path
Step 1Step 2Step 3
Agent · the LLM chooses the path
LLM decidesnext action
Tool?Another tool?Done?
Fig. 06A workflow follows a fixed recipe; an agent decides its own next move.
Analogy
A workflow is a recipe — fixed steps, same every time. An agent is a chef given “make me dinner with what's in the fridge” — it looks, decides, tastes, adjusts, and decides when the dish is ready. Workflows are more reliable; agents are more flexible. Mature systems often mix both. Practical wisdom
Don't reach for a full agent when a workflow will do. Agents are harder to predict, test, and debug. Use the simplest thing that solves the problem. 4.2 Tools / function calling — giving the model handsThis is the concept that turns an LLM into an agent. A tool is any function the model is allowed to call to interact with the outside world — search the web, query a database, send an email, run code, do math. How it actually works (this surprises people): the LLM can't run anything itself. Instead, you describe the available tools to it, and when it wants to use one, it outputs a structured request like “call
User → LLM“What's the weather in Mumbai?”
LLM → Your code“call get_weather(city='Mumbai')”
Your code → Toolrun the real weather API
Tool → Your code“32°C, humid”
LLM → User“It's 32°C and humid in Mumbai.”
Fig. 07Tool use, step by step — the model requests, your code runs it, the result comes back.
What a tool looks like in code (simplified) — you write a normal function plus a description the model reads: Python def get_weather(city: str) -> str: """Get the current weather for a city.""" # the model reads this # ... call a real weather API here ... return "32°C, humid" # You give the model a list of tools. It decides if/when to call them. # When it does, your code runs the function and returns the result. Analogy
The LLM is a brilliant strategist locked in a room with a phone. It can't act directly, but it can call out precise instructions (“look up X,” “send Y”). An assistant outside the room — your code — carries them out and reports back. Tools are the phone lines to the outside world. 4.3 Memory — short-term and long-termBecause LLMs are stateless (Part 3.6), agents need memory bolted on. Two kinds:
New messageShort-termrecent chat
Agent
save / retrieve
Long-termsaved facts (DB / vectors)
Fig. 08Short-term lives in the context window; long-term is the agent's notebook on disk.
Analogy
Short-term memory is what you're holding in your head during a conversation. Long-term memory is your notebook — you jot down what matters and flip back to it later. The agent writes to and reads from its notebook so each session isn't a blank slate. 4.4 RAG — letting an agent read your documentsRAG stands for Retrieval-Augmented Generation. It's the standard way to make an agent answer using your private or current information (company docs, manuals, a knowledge base) instead of only what it memorized in training. Decoded: Retrieval (go find relevant text) Augmented (add it to the prompt) Generation (the model writes the answer using it). One-time prep
Your documentsSplit into chunksConvert to embeddingsStore in vector DB
Every question
User questionEmbed the questionFind nearest chunksStuff them into the promptLLM writes a grounded answer
the stored vectors feed “find nearest chunks” at question time
Fig. 09RAG — prep your documents once, then retrieve the relevant pieces for every question.
Why RAG matters: it directly fixes hallucination and knowledge-cutoff (Part 3.6). The model isn't guessing — it's answering from real text you handed it, and it can cite which chunk it used. Analogy
Closed-book vs. open-book exam. A bare LLM takes the exam from memory and may misremember. RAG lets it bring the textbook, look up the exact relevant page, and answer from there. 4.5 The agent loop — think, act, observe, repeatNow we assemble Parts 4.1–4.4 into the beating heart of every agent: the loop. Given a goal, the agent repeatedly reasons about what to do, acts (calls a tool), observes the result, and decides whether it's done — until the goal is met.
Goal / task
Thinkwhat should I do next?
Do I have the answer?
NoAct · call a toolObserveread the result
YesReturn final answer
↻ observe → think again — loop until done
Fig. 10The agent loop — an LLM driving a cycle of tool calls toward a goal.
A concrete trace — “What was Tesla's revenue last quarter, in rupees?”
Analogy
A detective on a case. They form a hypothesis (think), follow a lead (act), see what it reveals (observe), and update the theory — looping until the case is solved. The “goal” is closing the case; the loop is the investigation. That loop — an LLM driving a cycle of tool calls toward a goal — is an agent. Everything in the remaining parts makes the loop smarter, more reliable, or larger in scale. Part 05Making an Agent Actually IntelligentA basic loop works for simple tasks. Making an agent reliable on hard, multi-step work is where the real engineering lives — the techniques that separate a toy from something trustworthy. 5.1 Planning and task decompositionThe idea: before charging ahead, a good agent first breaks a big goal into smaller steps and makes a plan. This is task decomposition. It mirrors how a person tackles “plan a conference” by splitting it into venue, speakers, catering, tickets. LLMs do far better on small, concrete sub-tasks than on one giant vague one. A written plan also keeps the agent on track over long tasks and gives you something to inspect. A common implementation is a to-do list the agent maintains for itself — it writes the steps, works through them, checks them off, and re-plans if something changes.
Big goal“Research & write a market report”
Plan1. Find competitors
2. Gather pricing 3. Analyze trends 4. Write report Step 1Step 2Step 3Step 4 ↻ new info → revise the plan and continue
Fig. 11Planning — decompose the goal, then work the list, re-planning as reality intervenes.
Analogy
A good project manager doesn't start building — they draft a plan, sequence the tasks, and adjust as reality intervenes. Planning gives an agent that same discipline. 5.2 Reasoning patterns — ReAct, reflection, self-correctionThese are named “thinking styles” you can prompt an agent to use:
Attempt the task
Reflectis this good? does it meet the goal?
Flaws foundRevise and retry
Good enoughDeliver
↻ revise → reflect again
Fig. 12Reflection — draft, critique against the goal, revise, then deliver.
Analogy
Reflection is the difference between a student who hands in the first draft and one who re-reads it, catches the weak argument, and fixes it before submitting. The second reliably scores higher. 5.3 Guardrails, evaluation, and reliabilityIntelligence isn't only capability — it's trustworthiness. Three pillars:
Agent wants to act
Allowed? safe?
NoBlock or ask a human
YesRun itLog itobservabilityScore vs evals
Fig. 13Every consequential action passes a guardrail check, gets logged, and is scored against evals.
Reality check
This is the least glamorous and most important part. Demos are easy; reliable agents are hard. The teams that ship real agents spend most of their time here, not on the clever loop. 5.4 Context engineering — what to feed it, whenRecall the context window is a fixed-size desk (Part 3.3). Context engineering is the discipline of deciding exactly what to put on that desk at each step so the model has what it needs and nothing that distracts it. More context isn't better — a cluttered desk degrades performance and costs more. The skill is curating:
Analogy
A surgeon's tray holds exactly the instruments needed for this step, laid out in order — not every tool in the hospital. Context engineering is laying out the model's tray. As of the mid-2020s, this is widely considered the core skill of building good agents — often more decisive than the choice of model or framework. Part 06FrameworksThe power tools. They handle the repetitive plumbing — but you should understand the loop by hand first. 6.1 What a framework is and when you need onePlainA framework is a pre-built structure that handles the repetitive plumbing of a common task, so you write only the parts unique to your project. For agents, frameworks handle the tool-calling loop, memory, connecting to different LLMs, and so on. The honest truth about whether you need one: you don't, to start. You can build a capable agent with just the Claude or OpenAI library and a loop you write yourself (Anthropic and others actively recommend starting simple). Frameworks add power but also abstraction — layers that hide what's happening, which can make debugging harder when you don't yet understand the basics. Recommendation
Build one agent by hand first (Part 8), so you understand the loop. Then adopt a framework to avoid re-writing plumbing. Frameworks make sense once you feel the repetition they remove. 6.2 LangChain — the toolboxWhat it is: the most popular, earliest agent framework. Think of LangChain as a big box of pre-made components — connectors to dozens of LLMs, ready-made tools, memory modules, RAG helpers, document loaders — with standard ways to snap them together. Strengths: huge ecosystem, integrations for almost everything, tons of tutorials, fast for prototyping. Trade-offs: because it tries to do everything, it can feel heavy and over-abstracted; the API has changed a lot over time. Many teams use parts of it (like its document loaders) without using all of it. Analogy
LangChain is the giant multi-tool with every attachment. Incredibly handy, occasionally bulky for a job that needed just a screwdriver. 6.3 LangGraph — agents as controllable flowchartsWhat it is: a newer library from the same team, built for when you need control over an agent's flow. LangGraph lets you define your agent as a graph — boxes (steps) connected by arrows (transitions), exactly like the flowcharts in this guide. You decide the possible paths; the agent moves through them. It has first-class support for memory, human-in-the-loop pauses, and resuming after interruptions — the reliability features from Part 5.
Start
Classify request
question
needs dataTool nodeEnough info?
YesWait for human approvalEnd
NoEnd
Fig. 14LangGraph — the agent decides, but only along routes you drew, with a human-approval gate.
Analogy
LangChain hands you parts; LangGraph hands you a blueprint engine. You draw the map of allowed routes, and the agent drives — but it can't wander off the roads you built. For serious, reliable agents, this graph approach has become the preferred style. When to use which: LangChain for quick prototypes and grabbing integrations; LangGraph when you need a dependable, structured, production agent. 6.4 Where Claude / the Claude Agent SDK fit — and the no-framework path
MCP-connected toolsUSB-C for AI
Three ways to build with Claude
Plain Claude API + your loopClaude Agent SDKLangChain / LangGraph
Fig. 15Three routes to an agent on Claude — all reaching the same model, all able to use MCP tools.
6.5 A quick tour of the alternatives
Don't framework-shop
They all do similar things. Pick one (for you: the Claude path, or LangGraph) and learn it deeply. Concepts transfer; switching later is easy once you understand the fundamentals from Parts 3–5. Part 07Multi-Agent Systems & Deep AgentsMany agents working together — and the long-horizon agents that plan, file their work, and run for hours. 7.1 Why use multiple agentsSo far, one agent. Sometimes a single agent juggling a big, varied task gets confused — too many tools, too many responsibilities, an overflowing context window. The fix mirrors how companies scale: divide the work among specialists and add a coordinator. A multi-agent system is several agents, each focused on a piece, working together. The most common shape is an orchestrator (or “supervisor”) agent that breaks the task up and delegates to specialist sub-agents, then combines their results.
User goal
Orchestratorplans & delegates
Research agentAnalysis agentWriting agent
Combined result
delegate down · results back up · orchestrator integrates
Fig. 16The orchestrator pattern — a boss agent delegates to specialists and assembles the edition.
Analogy
A newspaper. The editor (orchestrator) assigns stories to reporters (specialists), each an expert on their beat, then assembles the edition. No single person writes, researches, and edits everything — and the paper is better for it. A crucial, often-overlooked benefit: each sub-agent gets its own clean context window. The research agent's messy intermediate notes don't clog the writer's desk. This isolation is a big part of why multi-agent setups handle complex work better. 7.2 Common multi-agent patterns
7.3 When multi-agent is overkillMulti-agent systems are powerful but costly: more LLM calls (more money and latency), more ways to fail, and harder debugging. Coordinating agents is its own hard problem. Start with a single, well-designed agent. Only split into multiple agents when you have a clear reason: distinct skill sets, context-window pressure, or genuinely parallel sub-tasks. Many problems that look like they need a team are better solved by one good agent with the right tools. Analogy
You don't hire a ten-person team to run a lemonade stand. Add people when the work truly exceeds one capable person — not before. 7.4 Deep Agents — long-horizon, autonomous agentsThe term: “Deep Agents” describes agents built to handle complex, long-running, multi-step tasks — work that unfolds over many steps and a long stretch of time (researching and writing a full report, doing a multi-file coding project), rather than a quick question. “Shallow” agents do a few tool calls and stop; deep agents go far. The name is associated with a popular open-source harness from the LangChain team (
Complex long task
Deep Agent
1 · Maintains a to-do plan2 · Reads / writes a file system3 · Spawns sub-agents4 · Loads skills & instructions
Finished deliverable
Fig. 17What makes an agent “deep” — planning, files-as-memory, sub-agents, and skills.
Analogy
A shallow agent is a clerk answering one query at the counter. A deep agent is a project lead given a month-long assignment: they keep a running plan, file their work in folders they revisit, pull in specialists for specific parts, and follow playbooks for how each job is done. That combination is what lets it tackle work too big to hold in its head at once. Connecting it back
Deep agents are just Parts 4–7 combined thoughtfully — the loop, plus planning, plus memory-as-files, plus sub-agents, plus good context engineering. There's no new magic, just disciplined assembly of fundamentals. A real-world example: Hermes AgentA useful way to see these ideas in the wild is Hermes Agent, an open-source, self-hosted agent from Nous Research. Its pitch is an agent that grows with you: it runs persistently, remembers your projects and preferences across sessions, and — notably — writes its own reusable skill documents when it solves a hard problem, so it doesn't have to relearn later. It ships with tools (web search, file handling, terminal execution), can run scheduled work, and reaches you through channels you already use (Telegram, Discord, Slack, WhatsApp, CLI). It's free and self-hostable, running on anything from a small cloud server to a GPU box. Map it onto this guide and it's almost exactly a Deep Agent: persistent file-based memory (ingredient 2), self-written skills (ingredient 4), built-in tools (Part 4.2), and the autonomous loop (Part 4.5). It's worth studying as a concrete, running implementation of the patterns described here. Name clash to avoid
Nous Research also makes a family of open LLMs called Hermes (Hermes 2, 3, 4). Those are models (the engine, Part 3). Hermes Agent is the agent (the scaffolding, Parts 4–7) — you could even run it on top of a Hermes model, or another model entirely. Same brand, two different layers of the stack. Part 08Putting It TogetherA first project, deployment, cost, and security — and a sane path for what to learn next. 8.1 A realistic first projectDon't start with a multi-agent deep-research system. Build the smallest thing that exercises the core loop. A great first agent: a research assistant that answers questions using web search. It touches every fundamental without overwhelming you:
User question
Claude agent loop
Toolsweb search + calculator
↻ results return Complete answer?
No, keep going
YesCited answer
Fig. 18A realistic first agent — one loop, two tools, a loop cap, and cited answers.
A suggested learning sequence — build each step, run it, then break it on purpose:
Understanding comes from watching the loop actually run, not from reading about it. 8.2 How to run and deploy it
8.3 Costs, security, and what to watchCost — the thing that surprises people:
Security — non-negotiable basics:
8.4 What to learn next, in order
The one mindset to keep
An agent is not magic — it's an LLM (a next-word predictor with known flaws) wrapped in a loop, given tools and memory, and constrained by guardrails. Every advanced idea in this guide is a variation on that sentence. Master the simple version and everything else is incremental. GlossaryQuick reference — every term in one place, in plain words.
End of guide.
An agent is an LLM in a loop, with tools, memory & guardrails.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||