Building an AI Agent from Scratch — RAG · Multi-Agent · MCP

Build an AI agent from scratch using Python and a single while loop, without any frameworks. In the introductory section, you’ll add tool design, failures and costs, memory, human approval, evaluation, and a web interface one by one to complete a small coding agent. In the hands-on section, you’ll implement RAG, multi-agent systems, and an MCP server yourself using real business reports from DART, then compare them numerically with LangChain and LangGraph.

58 learners are taking this course

Level Basic

Course period Unlimited

Python
Python
FastAPI
FastAPI
LLM
LLM
openAI API
openAI API
AI Agent
AI Agent
Python
Python
FastAPI
FastAPI
LLM
LLM
openAI API
openAI API
AI Agent
AI Agent

A new section is open — Agent Search: When you have hundreds of thousands of documents, pull them in and grep.

Hello, this is Dante.

The six-part series in the new section “Practical 9 · Agent Search — When You Have Hundreds of Thousands of Documents, Fetch Them and grep” (Parts 35–40, about 78 minutes total) is now available.

Agents that dig through documents using only grep and file reading, without vector search, are attracting attention. In this section, we scale that approach to around 650,000 Korean Wikipedia articles and measure firsthand how far it can go—and where it hits its limits.

  • Practical Guide 35: We read a paper claiming that agents using grep beat vector search and examine what it actually compared.

  • Practical Series 36: Measure how search time changes as the number of documents grows to 10,000, 100,000, and about 650,000, then build a tool that distinguishes between missing results, timeouts, and command failures.

  • Practical Series Episode 37: Rebuild find and read to work with document IDs instead of file paths

  • Practical Series, Episode 38: We build a pull tool that brings only the documents selected by the search engine into the working folder for inspection.

  • Practical Series, Episode 39: Weigh and score three approaches under the same conditions: search only, searching everything at once, and pulling documents over to search them.

  • Field Guide 40: Set criteria for when to choose each approach, and add a router that starts with the cheaper option.

To give you a preview, searching all 650,000 or so documents at once didn’t produce incorrect results—it just got slow (79–95 seconds per query). Retrieving candidate documents first and then searching cut that down to 15–20 seconds while preserving nearly all the correct answers. In the lesson, we’ll look at the execution logs to see why and where it fails.

The content referred to in the video as “Agent Search Lesson” and “Path Selection Lesson” is summarized at the top of the 35-part practical course notes. You can read it first before getting started.

Instructions for obtaining the practice code and materials are in the public repository. You only need to download the 10,000-document set (about 12 MB) to follow along with all six lessons.

https://github.com/dante01yoon/embedding-rag-practice/tree/main/c3

If you get stuck or have any questions, please leave them in the questions section for each lesson, and I’ll be happy to help.

Thank you.

Comment