Build your own AI assistant in Python, one short file at a time
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.
Still deciding? Ask first.
Message a mentor about fit, prerequisites, or where to start. Replies come on WhatsApp, usually within a day.
- Curriculum fit, prerequisites, or where to start
- Honest answer, no pressure to enroll
Taught by an engineer who has shipped this
ISO 27001
Led the engineering work behind the certification of a regulated EU platform.
Series A platform
Architected the case-management product that became the business a €11.6M round was raised on.
3x faster deploys
Cut time-to-deploy by migrating to Kubernetes on GCP with deploy-on-merge.
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
Real projects, not toy demos.
- A stateless OpenRouter REPL that fits in one screen of code
- Crash-safe JSONL sessions that survive restarts
- An identity layer (SOUL) that defines the agent without bloating context
- A working agent loop with file, shell, and search tools
- A three-tier permission system that blocks dangerous commands by pattern
- A channel-agnostic gateway running over CLI, HTTP, and Telegram at once
- Automatic context compaction so the agent never hits a token limit
- Long-term memory the agent writes and searches for itself
- Per-session locking and scheduled cron heartbeats
- A two-agent system with prefix routing and shared memory
What you'll learn
You finish able to:
- Wire up an OpenRouter call and understand exactly which bytes go in and out
- Design a crash-safe session format that you can debug with cat and grep
- Build the agent loop with OpenAI-style tool_calls and recover the assistant + tool messages cleanly
- Apply a permission model so the agent can run real shell commands without nuking your laptop
- Architect the agent so the same brain runs over CLI, HTTP, and Telegram
- Implement split-summarize-merge compaction so the agent survives very long conversations
- Give the agent long-term memory it writes and searches itself
- Route prompts to specialised sub-agents that share memory but keep their own histories
Curriculum
From a single API call to your own multi-agent assistant.
- 014 lessons
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.
- 023 lessons
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.
- 033 lessons
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.
- 043 lessons
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).
- 053 lessons
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
Is this for you?
Backend engineers
You ship AI features through a framework. You want the raw, no-framework version so you actually understand what's happening.
AI-curious developers
Tutorials stop at "hello, world from GPT". You want to see how a real personal assistant remembers, runs commands, and stays safe.
Tech leads
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
Common questions.
Do I need an Anthropic key?
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.
Do I need a Telegram bot?
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.
Is this an intro to AI agents?
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.
How is this different from Building Your Own Claude Code?
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.
Pricing
Practice what you read with Pro.
Every lesson is free to read. Pro adds quizzes, flashcards, coding practice, certificates, notes and review on every course.
Unlock with Pro
Cancel anytime.
- Quizzes and practice for this course
- Practice, notes and certificates on every course
- New releases the day they ship
Still deciding?
Confidence comes from rebuilding it yourself.
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.