← All series15 parts · about 101 min · Free

Build an AI Agent in Python From Scratch

Build one agent in plain Python and add tools, memory, MCP and evals step by step.

0 of 15 read
Start with Part 1 →
  1. 1Part 1 · 7 min readCall an LLM From Python and See Why the API Forgets
  2. 2Part 2 · 6 min readWrite an AI Agent Loop in 60 Lines of Python, No Framework
  3. 3Part 3 · 6 min readTool Calling in Python: Describe a Function With JSON Schema, Run It, Send the Result Back
  4. 4Part 4 · 7 min readHow to Design Tools an LLM Agent Uses Correctly: Names, Descriptions and Errors
  5. 5Part 5 · 7 min readStructured Outputs in Python: Get Valid JSON From an LLM Every Time
  6. 6Part 6 · 6 min readSafe Agent Tools in Python: Allowlists, Human Approval and Prompt Injection
  7. 7Part 7 · 7 min readAgent Short-Term Memory in Python: Trim and Summarize Chat History
  8. 8Part 8 · 7 min readLong-Term Agent Memory in Python With Embeddings and NumPy
  9. 9Part 9 · 7 min readAgentic RAG in Python: Make Retrieval a Tool the Agent Decides to Call
  10. 10Part 10 · 7 min readReAct vs Plan-and-Execute Agents, With Python Code for Both
  11. 11Part 11 · 7 min readStop Runaway AI Agents: Step Limits, Retries and Cost Budgets in Python
  12. 12Part 12 · 7 min readMulti-Agent Systems in Python: Orchestrator, Workers, and When One Agent Is Better
  13. 13Part 13 · 7 min readConnect a Python Agent to MCP Servers With the Official MCP SDK
  14. 14Part 14 · 6 min readTest Your AI Agent in Python: A Small Eval Harness With Tool-Call Checks
  15. 15Part 15 · 7 min readTrace and Debug an AI Agent in Python: Step Logs, Token Costs and Replays

Related reading