Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
AI Agents From Scratch: Tools, Memory, MCP and Multi-Agent
Rating: 1.0 out of 5(1 rating)
4 students

AI Agents From Scratch: Tools, Memory, MCP and Multi-Agent

Build agents from scratch with Python: tool calling, memory and RAG, MCP servers, multi-agent systems, production
Last updated 11/2026
English
English

What you'll learn

  • Build a production AI agent from scratch: the tool-calling loop, schema design, argument validation, and error handling that survives a real run.
  • Give agents real memory with file-based persistence, RAG and chunking, plus retrieval that stays fresh instead of quietly going stale across sessions.
  • Write your own MCP server from scratch: expose tools and schemas, handle auth, connect it to Claude Code, and debug connection and schema failures.
  • Run agents unattended for 24 hours with self-scheduling, state files and recovery, then add guardrails, cost kill switches and monitoring that catches failures.

Course content

10 sections • 68 lectures • 5h 50m total length
  • 1.1 Agent vs Chatbot2:41
  • 1.2 The Agent Loop, Mechanically2:37
  • 1.3 Roadmap and Capstone2:16
  • 1.4 Course Assets and Setup5:16

Requirements

  • Comfortable writing basic Python. If you can write a function and run a script from the terminal, you have everything you need to follow along.
  • No API key required. The course builds the agent loop against a mock model, so every demo runs on your own machine for free.
  • No prior experience with AI agents, MCP or LLM tooling. The course starts at what separates an agent from a chatbot and builds up from there.

Description

This course contains the use of artificial intelligence.


Most AI agent tutorials stop at the demo. You build a loop, call a tool, and it works once. Then the model returns an unexpected argument, a tool fails, or the agent retries forever.

This course focuses on everything that comes after the demo works.

You will build a real tool-calling AI agent from an empty file and turn it into a system that can use tools, maintain memory, connect through MCP, coordinate multiple agents, run unattended, and fail safely.

What You’ll Build

You’ll build the actual agent loop yourself, including:

  • Tool dispatch and structured schemas

  • Argument validation

  • Error handling and retries

  • Permission boundaries

  • Max-turn governors

  • State management

  • Cost and safety controls

You’ll deliberately break the agent, inspect the failure, and fix the real problem instead of hiding it.

Tool Calling and Safety

Learn how to design reliable tools and control what an agent is allowed to do.

Topics include:

  • Good and bad tool schemas

  • Hallucinated arguments

  • Infinite retry prevention

  • Sandboxing

  • Permission boundaries

  • Execution limits

Memory and RAG

Learn why context is not the same as memory.

You’ll work with:

  • File-based persistence

  • Agent state

  • RAG

  • Document chunking

  • Retrieval pipelines

  • Detecting stale or incorrect memory

Build an MCP Server

You’ll build your own MCP server from scratch and learn how to:

  • Expose tools through MCP

  • Define schemas

  • Handle authentication

  • Connect to Claude Code

  • Debug connection and schema failures

Multi-Agent Systems

Build systems with multiple cooperating agents using:

  • Supervisor and subagent patterns

  • Parallel and sequential pipelines

  • Context isolation

  • Task delegation

  • Failure handling

You’ll also learn why adding more agents does not automatically make a system better.

Run Agents Unattended

You’ll build an agent that can keep running without constant supervision using:

  • Self-scheduling

  • Dynamic pacing

  • Persistent state

  • Checkpointing

  • Controlled retries

  • Recovery after restarts

Guardrails and Monitoring

A working agent is not necessarily a trustworthy agent.

You’ll add:

  • Human approval boundaries

  • Cost kill switches

  • Runtime monitoring

  • Logging

  • Failure detection

  • Protection against silent failures

You’ll learn how to detect an agent that reports success even when the task actually failed.

Capstone Project

Finally, you’ll build a complete agent end to end.

You will design its architecture, give it tools and memory, define its boundaries, deploy it, monitor it live, analyze failures, and write a postmortem on what should be hardened.

No API Key Required

The core agent loop uses a deterministic mock model, so you can follow the course without an API key or API costs.

Once the architecture is clear, you’ll see exactly what changes when switching to the live Messages API, and why the rest of the agent loop can stay almost the same.

Who This Course Is For

This course is for developers who have already called an LLM API and want to build agents that can:

  • Use real tools

  • Remember information

  • Work with other agents

  • Connect through MCP

  • Run unattended

  • Recover from failures

  • Operate within clear safety boundaries

If you want to move from “I built an AI agent demo” to “I can build an agent I actually trust to run,” this course is for you.

Who this course is for:

  • Python developers who have called an LLM API and now want to build agents that actually do things: use tools, remember, and run without supervision.
  • Engineers whose demo agent worked once and broke in production, and who want the guardrails, monitoring and recovery patterns that make it hold up.
  • Developers who want to learn MCP properly by writing a server from scratch rather than only consuming other people's.