Building Your First AI Agent with OpenClaw

You've installed OpenClaw. The gateway is running. Now what? This tutorial takes you from an empty workspace to a fully functional personal AI agent โ€” with personality, memory, channel connections, and the foundation for automation.

We'll build this step by step, testing at each stage. By the end, you'll have an agent that knows who it is, remembers your conversations, and is available in your messaging apps.

Step 1: Understand the Workspace

Your agent lives at ~/.openclaw/workspace/. If you installed via Homebrew, this directory already exists with some defaults. If it doesn't, create it:

mkdir -p ~/.openclaw/workspace/memory cd ~/.openclaw/workspace

The workspace will contain these files by the time we're done:

~/.openclaw/workspace/ โ”œโ”€โ”€ SOUL.md # Who your agent is โ”œโ”€โ”€ AGENTS.md # How your agent operates โ”œโ”€โ”€ USER.md # Context about you โ”œโ”€โ”€ MEMORY.md # Long-term memory โ”œโ”€โ”€ TOOLS.md # Tool & environment config โ”œโ”€โ”€ HEARTBEAT.md # Scheduled automation โ””โ”€โ”€ memory/ # Daily memory logs

Step 2: Write Your SOUL.md

This is the most important file. It defines your agent's personality, communication style, and behavioral rules. (For a deep dive, see our complete SOUL.md guide.)

Start with something practical:

# SOUL.md # Who I Am I am a direct, helpful personal assistant. I think clearly and communicate concisely. I lead with the answer, then explain if needed. # My Values - Clarity over completeness - Action over discussion โ€” if I can solve it, I solve it - Honesty over comfort - Brevity unless complexity demands thoroughness # How I Communicate - Short paragraphs (2-3 sentences max) - No filler phrases: never say "Certainly!", "Of course!", "Great question!" - Plain language. No corporate jargon. - If the answer is simple, the response should be simple - Match the formality of the conversation # My Rules - Never share private information from MEMORY.md in group chats - Always ask before sending emails or public messages - If uncertain about a destructive action, ask first - "Stop" means immediately halt all operations

This is a starting point. You'll refine it over the first two weeks as you notice behaviors you want to adjust.

Step 3: Create Your USER.md

USER.md gives your agent context about you:

# USER.md # About My Human - **Name:** [Your Name] - **Timezone:** [e.g., America/Chicago] - **Work:** [Brief description โ€” "Software engineer at Acme Corp"] - **Schedule:** [e.g., "Works 9-5, prefers morning briefings at 7am"] # Preferences - [Anything that affects how the agent should interact with you] - [e.g., "Prefers bullet points over paragraphs"] # Current Projects - [List active projects for context]

Be specific. "Works in tech" is useless. "Senior DevOps engineer managing 3 AWS clusters for a fintech company" gives context that shapes every response.

Step 4: Set Up AGENTS.md

AGENTS.md is the operating manual โ€” how your agent handles memory, tasks, safety, and workflow:

# AGENTS.md ## Every Session 1. Read SOUL.md โ€” this is who you are 2. Read USER.md โ€” this is who you're helping 3. Read memory/YYYY-MM-DD.md (today + yesterday) for context 4. Read MEMORY.md for long-term context ## Memory - Create daily memory files at memory/YYYY-MM-DD.md - Log decisions, completed tasks, notable conversations - Write to MEMORY.md only for lasting, important context ## Safety - Never exfiltrate private data - Prefer reversible actions over irreversible ones - If uncertain and impact is irreversible, ask first ## Trust Tiers ### Auto-Execute - Read files, search, organize workspace - Create drafts and analysis ### Always Ask First - External communications (emails, posts) - Destructive actions - Anything public-facing

Step 5: Initialize Memory

Seed MEMORY.md with starting context:

# MEMORY.md ## Key Facts - Agent created: [Today's date] - Primary channel: Telegram - AI model: [your configured model] ## Preferences Learned [Will grow as the agent learns your preferences] ## Decisions Log [Decisions logged here with dates and rationale]

This file will grow organically. In a week, it'll contain useful context. In a month, it'll be invaluable. See our Memory System guide for advanced strategies.

Step 6: Connect Your First Channel

Telegram is the easiest first channel:

  1. Open Telegram and message @BotFather
  2. Send /newbot and follow the prompts
  3. Copy the bot token BotFather gives you
  4. Add it to OpenClaw:
openclaw channel add telegram --token "YOUR_BOT_TOKEN"

Find your bot in Telegram and send it a message. If everything is configured, your agent responds. That first response โ€” from an AI running on YOUR hardware, with YOUR personality configuration โ€” is a genuinely exciting moment.

๐Ÿ“– Complete Agent Blueprints in the Book

The Personal Agent Revolution includes 5 complete, tested agent configurations โ€” professional assistant, creative collaborator, technical expert, executive chief of staff, and personal companion.

Get the Book โ€” $29.95 โ†’

Step 7: Test and Iterate

With the basics in place, test with these prompts:

  1. "Tell me about yourself" โ€” Should reflect your SOUL.md
  2. "What do you know about me?" โ€” Should reflect USER.md and MEMORY.md
  3. "What's 2+2?" โ€” Should be direct, not verbose
  4. "I'm feeling stressed about a deadline" โ€” Tests emotional intelligence
  5. "Search the web for [something current]" โ€” Tests skill access

Pay attention to what feels off. Too verbose? Add a rule to SOUL.md. Too formal? Adjust communication style. Doesn't remember something? Check MEMORY.md.

Step 8: Add a Second Channel

Once Telegram works, add another channel:

# Add WhatsApp openclaw channel add whatsapp # Add Discord openclaw channel add discord --token "YOUR_BOT_TOKEN" # Add Slack openclaw channel add slack --token "YOUR_BOT_TOKEN"

Multi-channel is where the agent experience truly clicks. Same personality, same memory, different interface. See our WhatsApp guide for details.

Step 9: Enable Basic Automation

A reactive agent is useful. A proactive agent is transformative. Create HEARTBEAT.md:

# HEARTBEAT.md ## Morning Briefing - **When:** 7:00am daily - **Channel:** Telegram - **Do:** - Check today's calendar - Summarize yesterday's memory - List pending tasks - Flag anything urgent

For a full deep dive on automation, see our Automation guide.

Step 10: Grow Over Time

Your agent isn't done โ€” it never is. The best agents evolve continuously:

The turning point usually happens around week 3 โ€” when memory accumulation and automation combine to create an experience qualitatively different from any chatbot.

Common First-Agent Mistakes

Over-Engineering SOUL.md on Day 1

Don't spend 3 hours on SOUL.md before talking to your agent. Write a basic version, start chatting, iterate. Real interactions teach more than theory.

Not Seeding Memory

An agent with empty MEMORY.md gives generic responses. Spend 5 minutes writing key facts about yourself.

Ignoring Automation

Many users treat OpenClaw like a chatbot โ€” only using it reactively. That's half the value. Set up morning briefings in week one.

Not Iterating

The first version of every configuration file is wrong. The people who get the most value continuously refine based on real interactions.

Frequently Asked Questions

Basic agent: 15 minutes. Fully configured: 2-4 hours. Continuously improving: forever (in a good way).
No. Basic setup is markdown editing and CLI commands. Advanced customization benefits from technical comfort but isn't required.
An API key, one channel (Telegram), and a basic SOUL.md. Chat immediately, add configuration over time.
Yes. Each agent gets its own workspace directory and gateway instance with its own personality, memory, and channels.
๐Ÿ‘จโ€๐Ÿ’ป

Rudi Ribeiro Jr.

Early OpenClaw Adopter ยท HubSpot AE ยท Author of The Personal Agent Revolution

Rudi runs a personal AI agent daily and wrote The Personal Agent Revolution based on hundreds of hours of real-world experience. He is not the creator of OpenClaw โ€” he's a power user who documented everything he learned.

๐Ÿ“– Master OpenClaw with the Book

37 chapters, 187 pages, 3 bonus resources. Complete agent blueprints ready to deploy.

Get the Book โ€” $29.95 โ†’