Session 12
Uber Eats. Swiggy. Zomato. Talabat. You order. A rider brings it. Watch the little bike on the map. That picture is enough to explain LLM, agent, and harness — and why Deep Agents exists when you already have LangChain and LangGraph.
Say this first
If you mix them, students will ask “why do I need a harness if the agent already delivers?” Keep the names separate. Then the next slides prove why.
LLM = knows the way · Agent = does the delivery · Harness = bike + app that make the movement real.
Proof 1 — LLM alone
This is LangChain at its simplest: a model that answers in chat.
“How do I get to Gulf Mart?” — perfect directions. No bag. No door. No file. Close the notebook and the answer is gone.
Proof 2 — Agent + harness
Agent decides: go to the shop, then your door. Street closed? Take the other street. You did not write a new Python node named add_detour.
Harness is what actually moves the icon and marks delivered. That is Deep Agents: the same LangGraph engine, with file tools, rules, how-tos, and helpers already attached.
The third thing
Harness = equipment + system. Two pieces. Both sit outside the rider’s head.
He decides. The bike-and-app carry it out. Two jobs. That is why we use two names.
The sharp question
You are right: in operation they must work together. A rider with no bike delivers nothing. A bike with no rider goes nowhere. We still name them separately because you can swap one without swapping the other.
If they were one inseparable thing, you would rebuild the brain every time the app changed.
Play this in class
Same LLM. Food-delivery tools. He is a delivery agent.
Why engineers care
| Symptom | Fix this | |
|---|---|---|
| Bad route choices | He keeps turning into the closed street | The brain — better model or prompt |
| App crash / no map | He decided correctly; nothing moved | The harness — tools, loop, files |
| Forgot “always Gulf Mart” | Rule was not in today’s prompt | Memory file — AGENTS.md |
| Invoice format wrong | How-to was stuffed in every chat, or missing | Skill file — SKILL.md |
If you called it all “one thing,” you would never know where the problem is.
Memory · loads every run
AGENTS.md — standing rules on every shiftOfficial docs name it AGENTS.md. This course also uses AGENT.md. Same idea: a markdown file the harness injects every time. You do not paste it into the user message.
Standing rules: - Every shopping list starts with Store: Gulf Mart - Never invent items the user did not name. - Confirm the bag is sealed before you leave the shop.
Delivery version: the rider does not re-learn “always confirm the seal” each order. The app loads it at the start of the shift. Change the file, not the Python.
Skill · loads only if the job matches
SKILL.md — the how-to he opens when he needs itAt start he only sees the name and description. He reads the full page when the task matches. A 200-line invoice how-to does not sit in every “hello.”
--- name: invoice description: Write a store invoice. --- 1. Line 1: Invoice #: INV-001 2. Line 2: Store: Gulf Mart 3. Then one line per item 4. Save as invoice.md
Do not mix these up
| Memory · AGENTS.md | Skill · SKILL.md | |
|---|---|---|
| When loaded | Every run. Always in the prompt. | Only if the task matches the description. |
| Delivery | “Always seal the bag. Always Gulf Mart.” | “How to process a refund” — opened only on refunds. |
| In the notebook | memory=["/AGENT.md"] + seed in files= | skills=["/skills/"] + /skills/invoice/SKILL.md |
| If you put it in the wrong place | Invoice how-to in memory = wasted tokens on every chat | Standing rules only in a skill = forgotten on a normal list |
LangChain: paste the rule into every prompt. Forget once, gone. LangGraph: paste it into every node you write. Harness: one file.
The rest of the bike and app
tools=. Deep Agents keeps them and already has write_file. LangChain can call get_store_hours and only talk. Here it lands in hours.md.shopping.md, not in a chat bubble. “Add eggs” is edit_file. You do not add_node('add_eggs').Screenshot this
| Question | LangChain | LangGraph | Deep Agents |
|---|---|---|---|
| Where does the work live? | Chat | State keys you named | Files the model writes |
| “Also add eggs” | Another chat | New add_node | edit_file |
| Always Gulf Mart | Paste every prompt | Paste every node | AGENTS.md |
| How to write an invoice | Giant system prompt | A node with that prompt | SKILL.md on demand |
| Call my hours tool | Yes — in chat | Yes — a node | Yes, and save hours.md |
| Don’t flood the main chat | You hope | You split nodes | Helper with empty chat |
create_deep_agent() still returns a LangGraph graph. You did not replace LangGraph. You stopped writing a new node for every “also…”
Notebook: 12_deepagents/notebooks/01_langchain_langgraph_deepagents.ipynb · Docs: overview · memory · skills · subagents