Agents & tools — A model, in a loop, with tools. That's it.
This is the track I care most about, because it is the one where the industry's marketing is furthest from the engineering. An agent is not a mysterious autonomous intelligence. It is a while loop. Write one by hand and the mystique never comes back — and then build the harness around it, which is where the actual work has moved.
Track 3 of the AI engineering roadmap by K Laxman — about 17 hours across 6 stages.
The agent loop, by hand
You can write an agent without a framework and explain every line of it.
environment · tool schemas · the while loop · context accumulation · approval gates
Interactive explainer on the live page: agent loop — You can write an agent without a framework and explain every line of it.
In short:
- An agent is a while loop. Call the model; if it asks for a tool, run it, append the result to the conversation, and call again. Stop when it answers without a tool call.
- The context is the agent's memory. Every tool result goes back into the context. The model knows only what the loop has put there so far.
- You own the stopping conditions. A step limit, a cost ceiling and approval gates for risky actions belong in your code, not in the prompt.
- How We Build Effective Agents — Barry Zhang · Anthropic (video, free, ~0.5h, rated 10/10). Kills the mystique in twenty minutes. An agent is a model acting on an environment through tools, in a loop — environment, tools, system prompt, while True. Everything else in the ecosystem is a wrapper around those four lines.
- Building effective agents — Erik Schluntz & Barry Zhang · Anthropic (article, free, ~0.5h, rated 10/10). The written companion to the talk, and the most-cited page in agent engineering for a reason. It draws the line between workflows (you write the path) and agents (the model picks it), and its core advice — start with plain API calls, add complexity only when it measurably helps — is the whole philosophy of this track.
- Tips for building AI agents — Barry Zhang, Erik Schluntz & Alex Albert · Anthropic (video, free, ~0.3h, rated 8/10). Eighteen minutes of the same people arguing about where agents are over-hyped and where they genuinely earn their cost. Worth it for the workflow-vs-agent judgement calls, which no article captures as well as hearing them disagree.
- Building agents with the Claude Agent SDK — Thariq Shihipar · Anthropic (article, free, ~0.3h, rated 8/10). Names the loop you are about to write: gather context, take action, verify the work, repeat. Read it for the verify step — rules-based checks, visual checks, a model as judge — because that is the part hand-written loops forget.
Build this — Write the loop. No framework.. A while loop, three tools, JSON-schema arguments, one approval gate before anything destructive. This is the keystone exercise of the whole page — do not substitute a framework tutorial for it.
You're done when: You can draw the loop on a whiteboard and point at exactly where a tool result re-enters the context.
Common traps:
- No iteration cap. A confused agent will call the same tool forever and bill you for each turn.
- Reaching for an agent when the steps are known in advance. A fixed workflow is cheaper, faster and easier to test.
Check yourself:
- Where exactly does a tool result re-enter the loop? Answer: It is appended to the message history as a tool-result message, and the whole history is sent on the next model call.
- When should you NOT build an agent? Answer: When you can write the steps down in advance. Use a fixed pipeline, and keep agents for tasks where the path genuinely depends on what is found along the way.
Put to work in: Jarvis — that loop, in production, running live in your browser · OpsPilot — agentic request triage & remediation
Workflows and graph loops — the five patterns
You can pick the simplest pattern that solves a task, and draw any agent system as a graph of steps with a loop in it.
prompt chaining · routing · parallelization · orchestrator-workers · evaluator-optimizer · state, nodes and edges · conditional edges and cycles · checkpointing
In short:
- Five patterns cover most systems. Prompt chaining (fixed steps), routing (classify, then specialise), parallelization (split or vote), orchestrator-workers (a model plans the subtasks) and evaluator-optimizer (generate, critique, revise).
- A graph is the loop, drawn. Nodes are steps, edges are control flow, and state is what travels between them. An agent is a graph with a conditional edge pointing back to an earlier node.
- Every cycle needs an exit. A loop edge must have a condition that ends it — a passing check, a round limit, a budget. Without one, the graph is an infinite loop with a bill attached.
- Agent patterns — runnable notebooks — Anthropic · claude-cookbooks (repo, free, ~2h, rated 9/10). The five patterns from 'Building effective agents' as short notebooks: basic workflows (chaining, routing, parallelization), orchestrator-workers and evaluator-optimizer, plus multi-agent latency experiments. Plain Python and the API — run them before you ever see a graph library.
- Workflows and agents — LangChain · LangGraph docs (docs, free, ~0.75h, rated 8/10). The same patterns again, written as graphs: nodes for steps, edges for control flow, and a conditional edge that points backwards — which is all a 'graph loop' is. Read it after the notebooks and the mapping from loop to graph becomes obvious.
Build this — One task, two patterns, a number for each. Take a writing or extraction task. Solve it once as a prompt chain and once as an evaluator-optimizer loop (generate → critique → revise, with a round limit). Run both on the same 20 inputs and record quality, latency and cost. Then draw the second one as a graph: which edge is the loop, and what stops it?
You're done when: Given a new task, you can say which pattern fits, why the simpler ones don't, and where the loop's exit condition lives.
Common traps:
- Using an autonomous agent where a fixed chain would do. Start with the simplest pattern and move up only when a measured failure demands it.
- An evaluator-optimizer loop with a vague critique prompt. If the evaluator can't say what to fix, revision just rewrites the same mistakes.
Check yourself:
- Customer emails go to billing, technical or sales, each with its own prompt. Which pattern is that? Answer: Routing — classify the input, then send it to a specialised prompt or model.
- What turns a workflow graph into an agent? Answer: A cycle whose next step the model decides: a conditional edge back to the model node, taken until the model chooses to stop (or a limit stops it).
Put to work in: Research Intelligence Agent — orchestration in practice · OpsPilot — routing and remediation workflows
Tools and MCP — connecting agents to real systems
You can design a tool an LLM actually uses correctly, and expose it over MCP.
tool design · argument validation · MCP architecture · tool servers · when a tool is too broad
In short:
- The tool description is a prompt. The model chooses tools and fills arguments from the name, description and schema alone. Write them for a new colleague with no other context.
- Narrow tools, typed arguments. One clear job per tool, enums instead of free strings where possible, and validation on every call — the model's arguments are untrusted input.
- MCP standardises the plumbing. An MCP server exposes tools and resources once; any MCP-capable client (desktop apps, IDEs, your own agent) can then use them without custom glue.
- Building Agents with Model Context Protocol — Mahesh Murag · Anthropic (video, free, ~1.75h, rated 9/10). The full workshop: what MCP is, building with it, MCP with agents, the architecture, and where it is going. Watch it once you have hand-written a tool call, so you can see what the protocol is standardising.
- Model Context Protocol — getting started — MCP (docs, free, ~0.5h, rated 8/10). The spec's own introduction, and the page to have open while you write the server rather than while you watch the workshop. Skim the concepts, then go straight to the transport section — that is the part everyone gets wrong first.
- Tool use — overview — Anthropic (docs, free, ~0.75h, rated 9/10). The best writing anywhere on how to describe a tool so the model picks it correctly. The description field is prompt engineering, and this is the page that finally made me treat it that way.
- Writing effective tools for agents — with agents — Anthropic (article, free, ~0.4h, rated 9/10). The best single guide to tool design. Fewer, more purposeful tools; namespaced names; human-readable results instead of UUIDs; pagination and truncation by default — and, the real lesson, evaluate tools like any other component and let the model help rewrite their descriptions.
- Code execution with MCP — Anthropic (article, free, ~0.3h, rated 8/10). What to do when you have hundreds of tools: let the agent discover them as files and call them from code, filtering data before it reaches the context. Their example goes from roughly 150,000 tokens of tool definitions to 2,000.
- Don't Build Agents, Build Skills Instead — Barry Zhang & Mahesh Murag · Anthropic (video, free, ~0.3h, rated 8/10). Sixteen minutes on Agent Skills: folders of instructions and scripts an agent loads only when a task needs them. The idea worth keeping even if you never use Claude is progressive disclosure — context loaded in layers, not all up front.
Build this — Wrap your Track 2 RAG bot as an MCP server. One tool, a real schema, connected to a client you didn't write. The moment someone else's agent can call your thing, tool design stops being theoretical.
You're done when: You can say why a tool named `do_stuff(input: string)` will be called wrongly, and rewrite it so it won't be.
Common traps:
- Giving an agent a tool that can do anything, like a raw SQL or shell executor, without a permission boundary.
- Returning huge, unfiltered payloads from tools. The result lands in the context window; return what the model needs.
Check yourself:
- Why will `do_stuff(input: string)` get called wrongly? Answer: The name and schema tell the model nothing about when to call it or what to pass. Split it into specific tools with typed, described parameters.
- What does MCP give you that a function call in your own code doesn't? Answer: Reuse: the same server works across every MCP client, and tools can be added or updated without changing the agent's code.
Put to work in: Intelligent Document Processing — multi-agent system
Harness engineering — the part that isn't the model
You can say what a harness is, name its five pieces, and point at the one your own agent is missing.
guides vs sensors · context assembly · tool orchestration · verification loops · cost envelopes · behavioural evals
Interactive explainer on the live page: harness — You can say what a harness is, name its five pieces, and point at the one your own agent is missing.
In short:
- The harness is everything but the model. Context assembly, tool orchestration, verification, limits and logging. It decides what the model sees and what happens to what it produces.
- Guides steer, sensors check. Guides (instructions, examples, conventions) shape behaviour before the action; sensors (tests, linters, validators) check the result after it.
- Close the loop with verification. Let the agent run the check itself — the test suite, the type checker — and feed failures back. That catches errors no prompt prevents.
The shift this track has been building toward. Prompt engineering was how you got one good answer out of a 4k context window; it stopped scaling the moment a task ran longer than a few hundred lines. What replaced it is not a better prompt — it is everything around the model: what you put in the context, which tools it can reach, what checks its work, what stops it spending your money, and what you can read afterwards when it went wrong. Swapping models moves output quality by ten or fifteen per cent. Changing the harness decides whether the system works at all.
- Effective harnesses for long-running agents — Justin Young · Anthropic (article, free, ~0.2h, rated 10/10). Short and concrete: how an agent keeps making progress across many context windows. An initializer session sets up the repo and a feature list marked pass/fail; every later session reads a progress file and git history, does one feature, tests it end to end, commits. Copy this structure.
- Harness design for long-running application development — Prithvi Rajasekaran · Anthropic (article, free, ~0.4h, rated 9/10). The follow-up: planner, generator and evaluator agents, with the evaluator testing the running app in a browser and the two negotiating what 'done' means before work starts. Read to the end — they removed scaffolding once a newer model no longer needed it, which is the lesson.
- Effective context engineering for AI agents — Anthropic (article, free, ~0.4h, rated 9/10). Context assembly is the first part of any harness, and this is the reference for it: compaction near the limit, structured notes outside the window, sub-agents that return short summaries, and loading data just in time by path or query instead of up front.
- Scaling Managed Agents: decoupling the brain from the hands — Anthropic (article, free, ~0.3h, rated 8/10). How Anthropic structures a hosted agent service: a stateless harness (the brain), replaceable sandboxes and tools (the hands), and a durable session log outside the context window. Useful architecture vocabulary once your harness has to survive restarts.
- Prompting for Agents — Hannah Moran & Jeremy Hadfield · Anthropic (video, free, ~0.5h, rated 8/10). Half an hour on writing the guides part of a harness: how to prompt a model that runs for many turns with tools, where short-prompt habits stop working, and how to read transcripts to find out why an agent went wrong.
- Claude Agent SDK — full workshop — Thariq Shihipar · Anthropic (video, free, ~1.9h, rated 8/10). A two-hour build-along using the harness behind Claude Code as a library: tools, subagents, permissions and verification wired up live. Do it after writing your own harness, so you recognise every piece rather than copying it.
- What is harness engineering? — harness-engineering.ai (article, free, ~0.4h, rated 9/10). The cleanest definition going: everything between user input and agent output except the model itself, broken into five parts — context engineering, tool orchestration, verification loops, cost envelopes, observability. Read this one first and the other four stop sounding like different topics.
- Harness engineering: leveraging Codex in an agent-first world — OpenAI (article, free, ~0.5h, rated 9/10). Five months, a production beta, about a million lines, and no human typing any of them — every PR opened and reviewed by Codex agents. Read it for the admission at the end rather than the number: with the writing automated, their hard problems became designing environments, feedback loops and control systems. That is the job description this stage is about.
- Harness engineering for coding agent users — Martin Fowler / Thoughtworks (article, free, ~0.75h, rated 10/10). The one that gives you the vocabulary to design with: guides (architecture docs, convention files, bootstrap scripts) steer before generation, sensors (linters, type checks, structural tests, review agents) catch after it, and each is either computational — deterministic, milliseconds — or inferential, an LLM judging. It also says the quiet part: a good harness is not trying to remove you, it is trying to spend your attention where it actually matters.
- The anatomy of harness engineering — evaluate, iterate and guard AI coding agents — Google Developers Blog (article, free, ~0.5h, rated 8/10). How you keep a harness honest as models move under you: behavioural evals that test discrete observable actions rather than end-to-end outcomes, strict assertions where the task is simple and an LLM judge where it isn't, run in batches so you watch the trend instead of panicking at one bad run. Integration tests for your agent.
- Learn Harness Engineering — Walking Labs (course, free, ~6h, rated 8/10). Free and open source: fourteen lectures from agent failure modes through to state management and control systems, projects to build against, copy-ready AGENTS.md and feature-list templates, and teardowns of real harnesses including Claude Code and Codex. Use it as the reference you come back to, not a sitting.
- Beyond the prompt — why harness engineering is the lever — PALO IT (article, free, ~0.3h, rated 7/10). The shortest version of the argument, plus an order to build in: conventions file, then deterministic hooks for the rules that must not be reasoned about, then subagents as independent verifiers, then state on disk, and only then an automated retry loop. Its warning is the one to keep — a loop without sensors produces hallucinated completion at high speed.
Build this — Put a harness around the loop you already wrote. Take your Track 3 agent and add the five pieces one at a time, measuring after each: a conventions file it always reads, a deterministic check it cannot talk its way past, one verification gate that re-runs its work before the result counts, a per-task token ceiling that kills the run, and a trace you can read afterwards. Keep the model fixed the whole time — the point is to see how far the harness alone moves it.
You're done when: You can point at one failure your harness now catches that the model used to get away with — and say which of the five parts caught it.
Common traps:
- Answering every failure with a longer system prompt. If a check can catch it, add a sensor instead.
- No cost envelope. Long-running agents need a budget per task, enforced in code.
- Letting a long-running agent decide it's finished. Keep an external feature list marked pass/fail by tests, and a progress file each new session reads first.
Check yourself:
- Your coding agent keeps breaking imports. Guide or sensor? Answer: Both, but the sensor matters more: run the build or type check after each edit and feed errors back. A prompt rule alone will be ignored eventually.
- Name the five parts of the harness in the explainer above. Answer: Context (what the model sees), tools (what it can do), verify (checks on what it produced), budget (steps and cost it may spend), and trace (a record of every run).
Put to work in: Jarvis — tool allow-lists, call budgets and a visible trace
Multi-agent systems — when one context window isn't enough
You can tell when splitting work across agents pays for itself, and build an orchestrator whose sub-agents don't trip over each other.
orchestrator and sub-agents · parallel context windows · token cost vs quality · task locking · shared state via git or files · outcome-based evaluation
In short:
- Sub-agents buy context, not intelligence. Each sub-agent explores in its own clean context window and returns a short summary. The win is breadth and parallelism on tasks too big for one window.
- It costs a multiple of the tokens. Anthropic reports multi-agent research using roughly 15× the tokens of a chat. It pays off only when the task is valuable and genuinely splits into independent parts.
- Coordination is the hard part. Agents need clear task boundaries, a way to claim work (a lock file, a queue) and shared state they can merge (git, files). Most failures are two agents doing the same thing.
- How we built our multi-agent research system — Anthropic (article, free, ~0.4h, rated 10/10). The production write-up behind Claude's Research feature. A lead agent spawns parallel sub-agents, each with its own context window. The numbers are the point: roughly 15× the tokens of a chat, a large gain on broad research tasks, and token usage explaining most of the difference in quality. Read the prompting and evaluation lessons twice.
- Building a C compiler with a team of parallel Claudes — Nicholas Carlini · Anthropic (article, free, ~0.4h, rated 9/10). Sixteen agents, one repository, about 2,000 sessions: a Rust C compiler that builds the Linux kernel. The coordination is refreshingly plain — lock files to claim tasks, git to merge — and the real lesson is that high-quality tests are what let autonomous agents make progress at all.
Build this — An orchestrator with three researchers. Build a lead agent that splits a research question into three sub-questions, runs three sub-agents in parallel with separate contexts, and merges their cited summaries. Compare against a single agent on 10 questions: quality (judged against your own rubric), tokens and wall-clock time. Keep the multi-agent version only if the numbers justify the cost.
You're done when: You can quote what your multi-agent version costs in tokens compared with one agent, and what it buys.
Common traps:
- Splitting tightly coupled work, like one feature across many files, between agents that can't see each other's changes.
- Evaluating whether each agent followed the expected steps. Judge the final outcome — agents take different valid paths.
Check yourself:
- When is a single agent the better choice? Answer: When the subtasks depend on each other, share most of their context, or the task fits in one window. Parallel agents add cost and coordination for no gain there.
- Two parallel agents keep fixing the same bug. What do you add? Answer: A way to claim tasks — a lock file or queue entry per task — checked before starting work, plus merging shared state often.
Put to work in: Research Intelligence Agent — agentic research & decision support
Frameworks — deliberately last
You choose a framework because it removes work you understand, not because you're lost.
LangGraph and friends · what they abstract · what they hide
In short:
- A framework hides the loop. LangGraph and similar libraries give you state, retries, persistence and graphs of steps. They are the same loop you wrote, with decisions made for you.
- Adopt for features, not for learning. Durable state, human-in-the-loop pauses and tracing are real reasons. "I don't know how agents work" is not — that is what the previous stages fixed.
- Know the escape hatch. Before committing, find out how to see the exact prompt sent and how to override one step. Debugging something you can't see is the real cost.
Framework material comes last on purpose. Read one only after you have written the loop, the patterns and a harness yourself. You will find you already know what every abstraction is for — and you will notice the ones that are solving a problem you don't have.
- Introduction to LangGraph — LangChain Academy (course, free, ~6h, rated 8/10). If you choose a graph framework, this is the free, structured way in: state, nodes, edges and cycles, then memory, human-in-the-loop interrupts, checkpointing and deployment. The parts worth paying attention to are persistence and interrupts — those are the features that are genuinely tedious to build yourself.
You're done when: You can name one thing your chosen framework does that you would rather do yourself, and say why.
Common traps:
- Adopting a framework and never looking at the raw prompts it sends.
- Choosing by GitHub stars. Choose by the two or three features you actually need.
Check yourself:
- Name one good reason to adopt a framework. Answer: Durable, resumable state for long workflows, or built-in human-approval pauses — features that are genuinely tedious to build and test yourself.
- What should you check in your framework before production? Answer: That you can see and log the exact prompt and tool calls for any run, and override any single step without forking the library.
Explore more
- Home — overview, skills and a built-in AI assistant
- Experience — roles at Think360 AI (CAMS), CAMS Mutual Funds and IIT Delhi
- Projects — GenAI, LLM, RAG and full-stack builds
- Education — IIT Delhi, M.Tech & B.Tech Computer Science
- Learn — a working AI engineer's roadmap: LLMs, RAG, agents, evals, production
- GitHub Activity — open-source contributions
- Contact / Hire me