Agent fundamentals: loops, tools, memory and planning

An agent is an LLM in a loop with tools and a stopping rule. Build one by hand, then learn what makes it dependable instead of impressive in a demo.

Before any framework, you will write the agent loop yourself, design tools the model can use well, give it memory, add planning and reflection, and connect it to the outside world with the Model Context Protocol. The recurring theme: constrain autonomy to what you can verify.

By the end: You can build a tool-using agent with budgets, tracing and memory, and say honestly when a plain workflow would be better.

6 topics · about 28 hours

Stage progress0 / 6

Do these first

LLM apps

The most useful sentence in this stage comes from Anthropic's guide to building effective agents: find the simplest solution possible, and only increase complexity when needed. Agents trade latency and cost for flexibility. Make sure you need the flexibility.

  1. 01

    What is an agent? Workflows versus agents

    3 h

  2. 02

    Build the agent loop from scratch (ReAct)

    6 h

  3. 03

    Designing tools for agents

    4 h

  4. 04

    Agent memory: short-term, long-term and episodic

    5 h

  5. 05

    Planning, reflection and search over reasoning

    5 h

  6. 06

    Model Context Protocol (MCP)

    5 h

Build this to prove it

A research agent with a hard budget

Build an agent that answers multi-step questions using a search tool, a page-reader and a calculator. Give it a step and cost budget, a scratchpad, structured traces, and a final answer that cites what it read. Compare it with a fixed workflow on the same 20 questions.

  • Agent loop written without a framework, with step and token budgets
  • Three well-described tools with validated arguments and useful error messages
  • JSONL traces of every thought, tool call and result
  • A comparison table: agent versus workflow on accuracy, cost and latency