M
MeshWorld.
OpenClaw Tutorial AI Agent LLM Claude Beginners Hands-On Telegram 6 min read

OpenClaw Tutorial: Build Your First AI Agent in 15 Minutes

Vishnu
By Vishnu
| Updated: Mar 12, 2026

Building your first AI agent usually feels like assembling a 1,000-piece puzzle where half the pieces are missing. You spend more time fighting with YAML files and API endpoints than actually seeing results. It’s a mess, and it’s why most people stick to basic chatbots. But OpenClaw is different. It’s designed to be fast and local, so you can go from a blank terminal to a working agent in about fifteen minutes. This tutorial skips the fluff and gets straight to the code. We’re going to build a “Morning Briefing” bot that handles your Telegram noise while you’re still drinking coffee.

How do I create my first agent?

If you’ve already run the install, creating a new agent is just one command. OpenClaw keeps every agent in its own little sandbox, so you don’t have to worry about one project breaking another. Run the create command and give it a name. I usually go with something simple like morningbot.

openclaw agent create --name morningbot

This sets up a folder structure in your home directory. It’s all plain text and Markdown. No hidden databases or proprietary formats. You can see everything it creates right there on your disk.

The Scenario: You’re starting a new side project and need an agent to help with research. Instead of cluttering your main config, you spin up a fresh agent in seconds. It has its own memory and its own rules, keeping your work life separate from your hobby life.

Where is the configuration file located?

Your agent’s brain is controlled by a config.yaml file. This is where you tell it which AI model to use and where to find your API keys. It’s also where you’ll set up your messaging platforms later. Navigate to the agent’s folder and open the file in your favorite editor.

nano ~/.openclaw/agents/morningbot/config.yaml

The file is organized logically. You’ll see sections for the LLM, messaging, and the heartbeat scheduler. It’s easy to read, but one missing space will break the whole thing, so be careful with your indentation.

The Scenario: You decide to switch from Claude to GPT-4o because it’s faster for a specific task. You open the config, swap one line, and hit save. Your agent is now running on a completely different model without you rewriting a single line of logic.

How do I connect my agent to Telegram?

Connecting to Telegram is the fastest way to actually “talk” to your agent. You’ll need a bot token from @BotFather. Once you have that, just drop it into the messaging section of your config. Make sure to add your username to the allowedUsers list, or else anyone on the internet can use your API credits.

messaging:
  - platform: telegram
    botToken: "your_token_here"
    allowedUsers: ["your_username"]

Remember, Telegram won’t let the bot message you first. You have to find your bot in the app and send it a /start message to open the line of communication.

The Scenario: You’re out at lunch and remember you need to check a project status. You send a quick text to your bot on Telegram. It checks your local files and replies in seconds. It feels like you have a personal assistant in your pocket.

Can I set the agent to run on a schedule?

This is the “heartbeat” feature. It’s what makes OpenClaw an actual agent instead of just a chatbot. You can use standard cron syntax to tell it when to wake up and what to do. For a morning briefing, set it to run about fifteen minutes before you usually start work.

heartbeat:
  enabled: true
  schedule: "45 8 * * *" # Every day at 8:45 AM
  task: "Summarize my unread messages and highlight urgent tasks."

The agent will wake up, run the task, and save the results to its memory. It’s like having someone read your emails for you while you’re still asleep.

The Scenario: It’s 8:45 AM. Your agent wakes up, scans your project folders, and sees that a deadline is coming up today. By the time you sit down at 9:00, there’s a neat summary waiting for you. You didn’t even have to ask.

How do I write a system prompt that actually works?

The system prompt is the “personality” of your agent. If it’s too vague, the agent will give you generic, boring answers. Be specific. Tell it exactly what its job is, what tone to use, and what it should never do. Create a file called system.md in the prompts folder.

You are a concise project manager.
- Use bullet points.
- Never use marketing fluff.
- Prioritize bugs over features.

The more constraints you give it, the more useful it becomes. A good prompt is the difference between a tool and a toy.

The Scenario: You’re tired of AI being “too helpful” and writing long, polite paragraphs. You update your prompt to “be blunt and only answer the question.” Suddenly, your agent stops apologizing and starts actually helping.

Where does the agent store its memory?

OpenClaw stores everything in Markdown files in a memory folder. There are no complex databases to manage. If you want to see what the agent “knows,” you just open the files and read them. You can even edit them manually if the agent gets something wrong.

ls ~/.openclaw/agents/morningbot/memory/

It’s transparent and private. Your data never leaves your machine unless you want it to. You can back it up to a thumb drive or sync it with Dropbox if you need to.

The Scenario: Your agent starts misremembering a project deadline. Instead of fighting with it in the chat, you just open the memory file, fix the date, and save. The next time you ask, the agent has the right info. It’s that simple.