Build an AI agent, and test it

Building AI Agents. Tool use, retrieval, memory, the agent loop — and how to test them.

19 lessons · 1 hr 1 min of video · 11 quiz questions

AI Agent Building Blocks: Tool Calling, RAG, Memory & the Agent Loop | AI Agents from Scratch #2, by AI World 4 U

Try a question from this course

What ends the agent loop?

What you'll be able to do

  • Explain an agent as a model, tools and a loop
  • Write tool schemas and a loop that runs tool calls and handles errors
  • Build a persistent retriever over your own data
  • Add memory to an agent and guard it in code
  • Evaluate an agent on its final answers and its trajectory

What's in it

  1. What an agent is

    The three parts of every agent, and the vocabulary for the rest of the course.

    1. The building blocks at a glance
    2. An agent is a model, tools and a loop
    3. Recap
  2. Tool use and the agent loop

    Describe tools with schemas, run the calls yourself, and loop until the model is done.

    1. How tool calling works
    2. Writing schemas and handling errors
    3. The loop: run until there are no tool calls
    4. Messages as context, and MCP tools
    5. Recap
  3. Retrieval (RAG)

    Give the model data it doesn't have: embed it, store it, and fetch the closest pieces per question.

    1. Why retrieval, and how embeddings fit
    2. Build a persistent retriever
    3. Recap
  4. Memory

    Make an agent remember across sessions — simply first, then safely.

    1. Context is not memory
    2. The simplest persistent memory
    3. Memory as tools, with guards
    4. Recap
  5. Evaluating agents

    Test the final answer and the path the agent took, and re-run after every change.

    1. Why agents need trajectory evaluation
    2. LLM-as-judge and ordered trajectories
    3. A first eval with DeepEval
    4. Recap

Made from these videos

More courses