ProjekinAja. Agentic AI Stage 4 · Building Agents Lesson 4.1
● Stage 4 · Lesson 4.1

Anatomy of the Agent You'll Build

Time to build. Before any tool or line of code, here's the blueprint — the five parts every agent has, and the plan for assembling your own (no-code first, then real code).

⏱ ~14 min read 🧱 The blueprint 🚀 Stage 4 opener

🎯 By the end you'll understand

The five building blocks of every agent (goal, brain, tools, loop, memory) and how each maps back to what you already learned, the two paths this stage teaches (no-code to build intuition, then Python to build understanding), exactly what you'll have built by the end of Stage 4, and an honest sense of what "I can build an agent" will and won't mean.

KEY INSIGHTYou already know the blueprint

Building an agent isn't inventing something new. It's wiring together five parts you've already met — and a blueprint makes the wiring obvious.

Back in Lesson 1.1 you learned the formula: Agent = LLM + tools + a loop, pointed at a goal. That was the whole field in one line. Now, opening the stage where you actually build, we add the fifth part that turns a clever demo into something useful: memory / context. Five blocks. That's an agent. Everything you assemble in this stage snaps onto that frame.

🔑 Hold onto this

You're not learning a new thing — you're learning to assemble a known thing. An agent is a brain wired to hands, given a loop to keep going, a goal to aim at, and a memory so it doesn't forget what just happened. Get those five parts wired and you have an agent.

FRAMEWORKThe five building blocks

Stage 2 took each of these apart in depth. Here they are reassembled into a parts list — the bill of materials for the thing you'll build. Notice every block points back to a lesson you've already done; if any feels shaky, that's your review link.

🎯

1 · The Goal / instructions

What the agent is for and the rules it follows — its system prompt, its job description. This is what aims the whole machine. (You met this idea as the "goal" in 1.1; you'll learn to write it well across this stage.)

🧠

2 · The LLM brain

The reasoning engine that decides, at each step, what to do next. You don't build this — you choose it and direct it. (Lesson 2.7 on picking and steering the model.)

🛠️

3 · The Tools

The hands. Functions the brain can call to act on the world — search, run code, send a message, hit an API. Without tools, the brain can only talk. (Lesson 2.2.)

🔁

4 · The Loop

The heartbeat: think → act → observe the result → decide again → repeat, until the goal is met. This is what makes it an agent and not a one-shot answer. (Lesson 2.1.)

📦

5 · Memory / context

The working notebook. What the agent carries from one loop step to the next — and across sessions — so it doesn't repeat itself or forget the plan. (Lesson 2.3 on context.)

▸ The updated formula

Agent = LLM (brain) + tools (hands) + a loop, pointed at a goal — with memory to hold it all together. Five parts. Memorize this version; it's the one you'll be wiring for the rest of the stage.

SEE ITThe Agent Blueprint

Here are the five blocks arranged the way they actually work — the brain in the middle, the loop wrapping around it, tools and memory feeding in, the goal aimed at the top. Click any part to highlight it and see what it does and where you learned it.

🧱 Interactive · Agent Blueprint

Select a building block to inspect it.

loop ↻ 🎯 Goal 🧠 LLM Brain 🛠️ Tools 📦 Memory
🎯 Goal / instructions

This diagram is the map you'll keep returning to. Every later lesson in this stage is really just "now let's build this part for real."

CORE CONCEPTTwo paths: no-code first, then real code

There are two honest ways to learn to build agents, and this stage walks both on purpose — because each teaches something the other can't.

🧩 No-code path💻 Real-code path
ToolsClaude Projects, Custom GPTs, n8nPython + an LLM API
What it gives youthe concepts in your hands fast — see the five blocks working with zero setupreal understanding and control of every part
The trade-offthe platform hides the loop and wiring from youyou write the loop yourself — more effort, far more insight
Lessons4.2–4.34.4–4.8

Start with no-code because intuition beats syntax. When you've configured a Custom GPT with instructions and a tool, the five blocks stop being abstract — you've felt them. Then we drop into Python, where nothing is hidden: you'll write the loop, register the tools, and watch the brain decide. That's when "agent" goes from a word you can use to a thing you can actually control.

💡 Why both, in this order

No-code answers "what does an agent feel like to build?" Code answers "how does it actually work, and how do I fix it when it breaks?" Skip the no-code intro and code feels abstract; skip the code and you stay dependent on whatever a platform lets you do. You want both.

PRACTICALWhat you'll actually build

Concretely, by the time you finish Stage 4 you will have built — with your own hands — these things:

①

A no-code agent

A Claude Project or Custom GPT with real instructions and at least one tool — your first working agent, live, in lessons 4.2–4.3.

②

An agent loop in Python, from scratch

A real think→act→observe loop you wrote yourself — calling an LLM, parsing its decision, running a tool, feeding the result back. (Lessons 4.4–4.5.)

③

Tools + memory wired in

Your agent calling functions you defined and remembering across steps and turns — the full five blocks, working together. (Lessons 4.6–4.7.)

④

A peek at multi-agent

One agent handing work to another — the next rung on the autonomy ladder, so you know what's beyond a single agent. (Lesson 4.8+.)

Not a slide deck about agents. A small, real agent you can run, break, and fix — and crucially, one where you understand every part because you wired each one in yourself.

CORE CONCEPTThe mental model for building

When you sit down to build, hold this picture, not a pile of code:

You're wiring a brain to a set of hands, giving it a loop so it keeps going, a memory so it remembers, and a goal so it knows where to aim.

That sentence is the entire job. Every decision you'll make in this stage is just which brain, which hands, how the loop ends, what goes in memory, and how clearly you've stated the goal. The frameworks and platforms you'll see (n8n, the API SDKs) are just convenient ways to do that wiring — none of them change the five-block picture. Master the picture and every tool becomes legible.

🔑 The builder's question

Stuck on any agent — yours or someone else's? Ask the five questions: What's its goal? Which brain? What tools? What's its loop? What does it remember? If you can answer all five, you understand the agent completely.

CONTEXTHonest expectations

Here's the honest version, because overselling helps no one. By the end of this stage you will be able to build a real, simple agent and understand every part of it. That's a genuine, valuable skill — most people who "use AI" can't do it.

What it is not: a production-grade system. Real-world agents that run unattended at scale need a lot more — robust error handling, evaluation and testing, guardrails, observability, cost control, and security hardening. Those are real, hard, ongoing work, and much of it lives beyond this course (Stage 3 gave you the supervision instincts; production engineering is a field of its own).

✗ "I built an agent, so it's ready to ship."

The gap between works on my machine in a demo and safe to run unattended on real tasks is large and is mostly reliability engineering. Building one is the start, not the finish. Know which side of that line you're on.

That said — the understanding you'll gain here is exactly the foundation that production work is built on. You can't engineer reliability into something you don't understand. So we build understanding first.

FRAMEWORKThe Stage 4 roadmap

Here's the whole stage in one view, so you always know where you are. We climb from no-code intuition, through code fundamentals, to a glimpse of multi-agent.

LessonWhat you'll do
4.1The blueprint — the five building blocks and the plan (you are here).
4.2No-code: build with Claude Projects & Custom GPTs.
4.3No-code workflows with n8n — wiring tools without writing the loop.
4.4Your first Python setup — talking to an LLM from code.
4.5Building the loop from scratch — think → act → observe in code.
4.6Giving it tools — defining and registering functions the brain can call.
4.7Adding memory — carrying context across steps and sessions.
4.8Frameworks — when (and when not) to use one instead of from-scratch.
4.9A peek at multi-agent — one agent handing work to another.
4.10Debugging your agent — reading the loop when it goes wrong.
4.11Stage capstone — assembling a complete simple agent end to end.

Eleven steps, one frame. Every single one is just "now build this block, for real." Keep the blueprint open in your head and none of it will feel like magic.

WEAKNESSCommon mistakes to avoid

✗ Jumping to multi-agent first.

Multi-agent looks impressive, so it's tempting to start there. Don't. A team of agents you don't understand is just a bigger mess. Get one agent solid first — the five blocks — and multi-agent becomes a small extension instead of a mystery.

✗ Reaching for frameworks before fundamentals.

Frameworks (LangChain, CrewAI, and friends) hide the loop — which is exactly the part you're here to understand. Write one loop by hand first (4.4). Then a framework is a convenience you control, not a black box you pray to.

✗ Skipping the no-code intuition.

"I'm a coder, I'll just start with Python." You'll learn faster if you feel the five blocks in a Custom GPT first (4.2). Twenty minutes of no-code makes the code far less abstract. Don't skip the warm-up.

KEY INSIGHTWhere this connects in your course

  • The formula (1.1) — "LLM + tools + loop, pointed at a goal." This lesson adds memory and turns it into a build plan.
  • The loop (2.1) — block #4; you'll write it yourself in 4.5.
  • Tools (2.2) — block #3, the hands; wired in 4.6.
  • Context (2.3) — block #5, memory; added in 4.7.
  • Multi-agent (2.4) — the rung beyond one agent; previewed in 4.9.
  • Choosing & steering the model (2.7) — block #2, the brain you'll pick and direct.

Stage 2 explained how each part works. Stage 4 is where you pick them up and wire them together. Same five parts, new verb: from understand to build.

GLOSSARYKey terms introduced

Blueprint
The fixed five-part frame of every agent (goal, brain, tools, loop, memory) — the map you build against.
Building block
One of the five reusable parts you assemble into an agent; each maps to a Stage 2 lesson.
No-code
Building an agent through a visual platform (Claude Projects, Custom GPTs, n8n) without writing a program.
Scaffolding
The supporting code or structure around the brain — the loop, tool wiring, and memory plumbing that turns an LLM into an agent.
Framework
A pre-built library (e.g. LangChain, CrewAI) that supplies common agent scaffolding so you write less of it yourself.
From-scratch
Building the loop and wiring by hand in code, with no framework, so every part is visible and under your control.

ACTIVE RECALLCheck your understanding

Answer in your own words first, then reveal.

1What are the five building blocks of an agent, and which one is new since Lesson 1.1?›

Goal/instructions, LLM brain, tools, the loop, and memory/context. The memory/context block is the one added on top of the 1.1 formula (LLM + tools + loop, pointed at a goal).

2Why does this stage teach no-code before real code?›

No-code (4.2–4.3) puts the five blocks in your hands fast and builds intuition with zero setup; real code (4.4–4.8) then gives you understanding and control of every part. Intuition first makes the code far less abstract — and skipping the code leaves you dependent on whatever a platform allows.

3State the one-sentence mental model for building an agent.›

You're wiring a brain to a set of hands (tools), giving it a loop to keep going, a memory to remember, and a goal to aim at. Every build decision is just which/how for each of those five.

4What will you be able to do at the end of Stage 4 — and what will still be out of reach?›

You'll be able to build a real, simple agent and understand every part of it. What's still out of reach is production-grade reliability — robust error handling, evaluation, guardrails, observability, cost control, and security hardening — which is a large engineering effort mostly beyond this course.

The blueprint is set. Next: build your first agent with no code →