build-your-own-openclaw
AI agent building tutorial — step-by-step guide to create a custom agent with tools, skills, and multi-agent capabilities
This AI agent building tutorial provides 18 progressive steps to construct a custom AI agent from scratch. It guides developers through implementing core features like tools, skills, persistence, and web access, culminating in an event-driven, autonomous, and multi-agent system. Each step includes a detailed README and runnable codebase, offering a practical path to understanding advanced agent architectures.
- 18 progressive steps for agent development
- Implement tools, skills, and persistent memory
- Integrate slash commands for user control
- Refactor to event-driven architecture
- Build multi-agent routing and collaboration
README
View on GitHub ↗Build Your Own OpenClaw
A step-by-step tutorial to build your own AI agent, from a simple chat loop to a lightweight version of OpenClaw.

Overview
18 progressive steps that teach you how to build an minimal version of OpenClaw. Each step includes:
- A
README.mdgoing through key components and design decision. - A Runnable codebase.
Example Project: pickle-bot - our reference implementation
Tutorial Structure
Phase 1: Capable Single Agent (Steps 0-6)
Build a fully-functional agent that can chat, use tools, learn skills, remember conversations, and access the internet.
- 00-chat-loop - Just a Chat Loop
- 01-tools - Give your agent a tool.
- 02-skills - Extend your agent with
SKILL.md - 03-persistence - Save your conversations.
- 04-slash-commands - Direct user control over sessions.
- 05-compaction - Pack you history and carry on...
- 06-web-tools - Your Agent want to see the bigger world.
Phase 2: Event-Driven Architecture (Steps 7-10)
Refactor to event-driven architecture for scalability and multi-platform support.
- 07-event-driven - Expose you agent beyond CLI.
- 08-config-hot-reload - Edit without restart.
- 09-channels - Talk to your agent from on your phone.
- 10-websocket - Want to interact with you agent programatically?
Phase 3: Autonomous & Multi-Agent (Steps 11-15)
Add scheduled tasks, agent collaboration, and intelligent routing.
- 11-multi-agent-routing - Route right job to right agent.
- 12-cron-heartbeat - An Agent work while you are sleeping.
- 13-multi-layer-prompts - More Context, More Context, More Context.
- 14-post-message-back - Your Agent want to Speak to you.
- 15-agent-dispatch - Your Agent want friends to work with!
Phase 4: Production & Scale (Steps 16-17)
Features for reliability and long-term memory.
- 16-concurrency-control - Too many Pickle are running at the same time?
- 17-memory - Remember me!
How to Use This Tutorial
Configure API Keys
Before running any step, you need to configure your API keys:
Copy the example config:
cp default_workspace/config.example.yaml default_workspace/config.user.yamlEdit
config.user.yamlwith your API keys:- See LiteLLM providers for the full list of supported providers
- Check out Provider Examples for some examples
Just follow each steps, read and try it out.
Contributing
Each step is implemented in a separate session. Feel free to suggest improvements!
Similar templates
learn-claude-code
Agent harness engineering tutorial — build the environment and tools for real LLM agents, inspired by Claude Code
claude-code-templates
Claude Code template manager — CLI to browse, install, and monitor agents, commands, and MCPs
claude-code-infrastructure-showcase
Claude Code infrastructure showcase for auto-activating skills, modular patterns, and specialized agents
claude-code-system-prompts
Claude Code system prompts — up-to-date collection of all internal prompts for subagents, tools, and utilities