Loading...
Loading...
Smart AI assistants feel like magic until you write a tiny one yourself. You start with a program that asks a language model a single question. By the end, that program has a name, remembers past chats, runs shell commands behind a safety layer, talks to you on Telegram while also answering in a terminal, and quietly splits work to a small team of helper agents. No frameworks. No magic.
Engineers are learning here from
Build your own AI assistant in Python, one short file at a time. You start with a single API call that says hi back. Then you teach the program to remember the conversation, then to know who it is talking to, then to safely run shell commands on your laptop, then to chat with you on Telegram while also answering in a terminal, then to remember things long-term, then to split into a small team of specialists. By the end you have a working personal AI assistant, like a tiny Claude Code you understand line by line. The reference repo at github.com/learnwithparam/learn-to-build-openclaw walks the same path step by step.
Write your own AI assistant in Python, one short file at a time. From one API call to a multi-agent system that remembers you, runs commands safely, and keeps its own schedule.
What you'll ship
What you'll learn
Curriculum
The simplest agent
Wire OpenRouter, send a single message, get a reply. Then add JSONL sessions so the bot can hold a conversation that survives restarts.
Identity and intelligence
Give the bot a SOUL with a system prompt, then turn it from a chatbot into a real agent with tools and the OpenAI tool_calls loop.
Safety and channels
Add a real permission layer so the agent can run commands without nuking your laptop. Then prove the architecture by running the same brain over CLI, HTTP, and Telegram at once.
Long-running intelligence
Two ideas that together let the agent run for a million turns: context compaction (forget old detail, keep recent verbatim) and long-term memory (the agent writes its own notes).
Production patterns
Per-session locks, scheduled cron heartbeats, and a multi-agent split with prefix routing. The capstone is your own mini-Claude-Code with a general agent and a research agent that share memory.
Who it's for
You ship AI features through a framework. You want the raw, no-framework version so you actually understand what's happening.
Tutorials stop at "hello, world from GPT". You want to see how a real personal assistant remembers, runs commands, and stays safe.
Your team is shipping agents but no one on the team can explain the loop, the memory, or the permission model when something breaks at 2am.
FAQ
No. The course runs on OpenRouter with qwen/qwen3-coder as the default model. Swap to any OpenRouter model by changing OPENROUTER_MODEL in your .env.
Optional. Every step ships with a CLI mode by default. Telegram only kicks in when you pass the telegram flag, so you can finish the whole course in your terminal.
It assumes you have done at least one toy bot or one tool-calling tutorial. The focus here is architecture: how the pieces of a persistent assistant fit together.
That course is the production-grade, advanced reverse-engineering of Claude Code with worktrees, multi-agent buses, and graph task management. OpenClaw is the intermediate prequel: the same ideas at a smaller scale, focused on personal-assistant patterns.
Write your own AI assistant in Python, one short file at a time. From one API call to a multi-agent system that remembers you, runs commands safely, and keeps its own schedule.