1. Project Scoping: Search Bot

Defining the MVP. We will build an agent that takes a topic, searches the web, reads pages, and writes a comprehensive summary report automatically.

It is finally time to write some code. In this module, we will build a complete, end-to-end autonomous agent. The biggest mistake beginners make is trying to build a general-purpose “AGI” that can do everything. That will fail.

Instead, we will build a highly constrained, highly useful Minimum Viable Product (MVP): The Autonomous Research Bot.

The Goal

We want to be able to type a single command into our terminal:

python run_agent.py "What are the latest developments in solid-state batteries?"

The agent should then wake up, realize it needs to search the internet, execute a Google search, click on the top 3 links, read the text on those websites, synthesize the information into a 500-word markdown report, and save that report to our hard drive.

🎯 Defining the Boundaries

  • LLM Engine: We will use Llama-3-8B-Instruct running locally via Ollama to keep things free and private.
  • Framework: We will use a lightweight custom ReAct loop instead of a heavy framework so you can see exactly how the mechanics work under the hood.
  • Tools: The agent will have exactly three tools: search_web, read_url, and save_file.

Why this specific project?

This project touches every fundamental pillar of agent development.

  • It requires the LLM to make a plan (Search first, Read second, Save third).
  • It requires the LLM to format JSON correctly to call the external API (Google Search).
  • It requires the system to manage a context window (HTML from websites is massive, so we have to parse it before feeding it to the LLM).
  • It requires the agent to handle errors (What if a website blocks the scraper? The agent must realize this and try the next link).