lasywolf/Learn-OpenClaw

Learn agent fundamentals from scratch in one day (about 9 hours)! I wrote this tutorial to show that agents are actually very simple. 零基础一天 (9小时)学完agent!写这个教程就是想告诉大家,Agent其实非常简单!

What this project is

Learn-OpenClaw is a free, open-source tutorial that claims you can go from zero to understanding AI agents in about 9 hours of study. The author wrote it to show that AI agents are "actually very simple," and says several students have already used the tutorial to land agent-related internships.

The tutorial is hands-on: you build a working AI agent step by step, using small example code files included in the repo, and finally transform an existing open-source project (called pi-mono) into your own personal agent — which the author calls "OpenClaw." The project name seems to be a playful twist on the underlying pi-mono base.

What you learn

The tutorial is split into 9 main sections (roughly 9 hours total):

  1. Get an LLM API key (~15 min) — Set up a key from providers like DeepSeek, Kimi, or Zhipu, configure environment variables, and run a small Python file that calls the API. The author prefers the uv package manager over conda, because conda can have commercial licensing issues for organizations over 200 people, while uv is open-source.

  2. Implement Node / Workflow / Agent (~1 hr) — The core idea: workflow = node + node, chatbot = workflow + loop, agent = chatbot + tools. You build a tiny framework (under 60 lines of code) that connects nodes together in a chain, add a loop for chat, then give it tools like web search, file editing, and command-line execution. The author deliberately avoids heavyweight frameworks like LangChain, Dify, or Coze — he argues that successful agents (Claude Code, Cursor, Kimi CLI) are built on light, custom frameworks.

  3. Implement RAG (~1 hr) — Retrieval-Augmented Generation. The author's punchline: "RAG is just a VectorDB." You pick a simple vector database (Chroma) to store and search text, and that's essentially it. The full RAG concept reduces to "search first, then let the LLM answer."

  4. Implement Tool, MCP, Skill (~1 hr) — These are all just "tools" under the hood:

    • Tool = calling a function locally
    • MCP = calling a function on a remote server (like a remote procedure call)
    • Skill = calling a local function with smart loading (only load what's needed) The author explains the evolution: MCP solved tool standardization but wasted tokens by loading every tool's description into the prompt. Skills emerged as a more efficient approach. His design advice: don't over-engineer tools — the basic Linux commands (bash, edit, find, grep, read, write) handle most tasks well.
  5. Context / Memory management (~25 min) — Two kinds of memory: dialogue memory (what was just said, stored in a session.jsonl file) and long-term memory (important facts, saved in MEMORY.md). The tricky part: LLMs have limited context windows, so older messages get compressed into a summary when usage hits 90% of the context limit.

  6. Multi-Agent / Subagent / Agent Teams (~1 hr) — The original A2A (agent-to-agent) protocol idea mostly failed. But subagents (smaller agents that report results back to a main agent) work well for isolating context. The newest direction is Agent Teams — parallel agents working on different parts of a task simultaneously, which the author says is very promising.

  7. Read pi-mono (~4 hr) — pi-mono is described as "the best open-source coding agent." You're told to clone it, use an AI tool to analyze its architecture, and read the AI-generated report (rather than reading the source code by hand). Only 3 of its 7 packages need attention: pi-ai, pi-agent-core, and pi-coding-agent.

  8. Turn pi-mono into your OpenClaw (~1 hr) — Practical steps: clone pi-mono, check out a specific commit (because a later commit removed a component you need), install PM2 for background running, modify one file to allow custom model settings, set environment variables pointing to your LLM provider, then start it. Result: a personal AI agent you can chat with on Slack.

  9. The /goal command (~short) — For long-running tasks. Instead of "run once and stop," you give the agent a persistent goal (e.g., "/goal 90% test coverage"). The agent keeps working until the goal is done, and must explicitly call a goal_complete tool to signal completion.

The bonus section: getting hired

The tutorial includes ~2 extra days of content specifically for landing an agent-focused job or internship. Key advice:

  • Interviews only ask about projects — no trivia questions. Build your own OpenClaw clone (call it "YourNameClaw") and be ready to explain its architecture.
  • Suggested topics to understand: evaluating agent performance, automatic prompt optimization, sandboxing agents (using Docker), and "Harness" (a fuzzy concept from OpenAI about giving AI a better runtime environment — even the author admits it's vague).
  • One concrete tip: don't put "smart customer service" projects (LangChain + RAG) on your resume — the author calls them outdated.

Bottom line

This is a practical, opinionated, hands-on tutorial that demystifies AI agents by building minimal ones from scratch. It's clearly written by someone working in the field who has strong opinions about tooling choices (light frameworks over heavy ones, simple vector DBs over complex RAG pipelines, basic Linux commands over elaborate tool sets). Made for absolute beginners, with the explicit promise that "today, AI agents are actually simple."

Related

  • Project
  • Project
  • Project
  • Project