Building Your Own AI Assistant with OpenClaw — A Complete Guide from Installation to Customization
A step-by-step guide to installing OpenClaw, connecting it to Discord, adding skills, and customizing your own AI assistant. Real-world experience and mistakes included.
On a Saturday Afternoon, I Decided to Build an AI Assistant
It was a Saturday afternoon in February 2026. I was staring at the growing pile of Discord notifications and thought, "Can't someone else handle these repetitive tasks?" Schedule reminders, link summaries, quick Q&A — each task was too trivial to warrant my full attention, yet too important to ignore entirely. That's when I discovered OpenClaw. This article chronicles the journey from installation to a fully customized AI assistant.
OpenClaw is an open-source multi-agent AI framework (OpenClaw Documentation). It lets you run multiple AI agents from a single instance, connected directly to messengers like Discord, Telegram, and Slack. What appealed to me most was that it didn't require a separate server. I could run it on my local MacBook and migrate to the cloud later if needed.
Step 1: Installation — Simpler Than Expected, But Watch for Traps
The installation itself is remarkably straightforward. If you have Node.js 18 or above, it takes one line in the terminal.
npm install -g openclaw
After installation, run the initial setup.
openclaw init
This command creates the ~/.openclaw/ directory and places default configuration files. Here's where I hit my first trap. My Node.js version was 16. OpenClaw uses ES Module syntax, which requires Node.js 18 or higher (Node.js ES Modules Documentation). Fixed it with nvm use 18, but finding that one-liner cost me 20 minutes.
The directory structure you should familiarize yourself with looks like this:
~/.openclaw/
├── config.yaml # Main configuration file
├── workspace/ # Agent workspace
│ ├── AGENTS.md # Agent behavior rules
│ ├── SOUL.md # Agent personality definition
│ └── memory/ # Conversation memory storage
├── skills/ # Skill module directory
└── sessions/ # Session data
Understanding this structure is crucial. config.yaml determines the agent's brain, and workspace/ holds its memory and personality. When you customize later, knowing this structure lets you modify exactly the parts you want.
Step 2: Discord Connection — The Bot Token Is Everything
For your AI assistant to operate in Discord, you need a Discord Bot Token. Create a new application in the Discord Developer Portal and generate a token from the Bot tab (Discord Developer Portal).
openclaw gateway config set discord.token "YOUR_BOT_TOKEN"
There's one critical setting many people miss. You must enable the Message Content Intent. Since 2022, Discord requires explicit permission for bots to access message content (Discord Gateway Intents). If you don't toggle "Message Content Intent" in the Bot settings on the Developer Portal, your agent will receive messages with empty content strings. Without knowing this, you'll spend hours wondering why the bot doesn't respond.
Once configured, start the gateway.
openclaw gateway start
When successfully connected, you'll see a Gateway connected message in the terminal, and your bot will appear online in the Discord server. The feeling of seeing that green dot for the first time was similar to printing your first "Hello, World!"
After connecting, set up channel bindings. One of OpenClaw's strengths is assigning different agents to different channels. For example, a casual conversation agent for #general and a code review agent for #dev-help. Configure this in config.yaml:
channels:
- id: "general"
agent: "main"
- id: "dev-help"
agent: "code-reviewer"
Step 3: Adding Skills — Granting Abilities to Your Agent
A default OpenClaw agent can only converse. Capabilities like web search, file access, and code execution are added through skills. OpenClaw's skill system follows a plugin architecture, with each skill operating as an independent module.
The first three skills I added were web search, browser control, and TTS (Text-to-Speech). The web search skill enables real-time information retrieval via the Brave Search API. Browser control lets the agent open and read web pages directly. TTS converts text to speech for playback in Discord voice channels.
There are two ways to add skills. First, installing community skills:
openclaw skill install web-search
openclaw skill install browser
openclaw skill install tts
Second, writing your own. A skill is defined by a single SKILL.md file that describes in natural language when and how the agent should use a tool. This approach felt strange at first — "Defining skills with Markdown instead of code?" But in practice, it's intuitive. AI agents understand natural language instructions, so defining skills in natural language makes perfect sense.
Here's an overview of key skills, their purposes, and setup complexity:
| Skill | Purpose | API Key Required | Setup Difficulty |
|---|---|---|---|
| web-search | Real-time web search | Brave API key | Low |
| browser | Web page access and manipulation | None | Medium |
| tts | Text-to-speech conversion | ElevenLabs API key | Low |
| exec | Shell command execution | None | Low (security caution) |
| calendar | Google Calendar integration | OAuth setup | High |
| Email checking and sending | OAuth or SMTP | High |
After adding skills, always verify security settings. The exec skill in particular allows the agent to run system commands directly, so operating in allowlist mode is strongly recommended. OpenClaw defaults to deny security mode, meaning commands not explicitly allowed won't execute. You'll be grateful for this design philosophy eventually.
Step 4: Customization — Giving Your Agent a Soul
With technical setup complete, the most enjoyable step remains: defining your agent's personality and behavior. In OpenClaw, this is called SOUL.md. This file lets you freely describe the agent's name, speech patterns, personality, and conversation style.
My AI assistant Aria's SOUL.md begins like this:
# You are Aria
You are a friendly, slightly witty AI assistant who lives in Jay's Discord server.
You speak Korean primarily but switch to English when technical terms come up.
You use casual speech (반말) with Jay but formal speech (존댓말) with others.
When you don't know something, you say so honestly instead of making things up.
You love making dad jokes when the mood is right.
This single file determines the agent's entire personality. I was skeptical at first — "Does this really work?" But Claude's instruction-following capability is remarkably precise. Write "loves dad jokes" in SOUL.md, and the agent genuinely drops dad jokes at appropriate moments.
AGENTS.md defines the agent's behavioral rules — how to read and write files, manage memory, and when to speak or stay quiet in group chats. Think of this file as determining the agent's "social skills."
The most critical aspect of customization is the memory system. OpenClaw agents forget conversations when sessions end. However, by saving daily files in the memory/ directory and organizing long-term memories in MEMORY.md, context persists across sessions. This isn't a simple conversation log — it's "memory" that the agent itself organizes. Like a person writing a diary and later reading it to recall the past.
The memory system structure breaks down as follows:
| File | Role | Update Frequency | Recommended Size |
|---|---|---|---|
memory/YYYY-MM-DD.md | Daily log (raw) | Every session | No limit |
MEMORY.md | Long-term memory (curated) | 2-3 times per week | Under 2000 chars |
HEARTBEAT.md | Periodic check items | As needed | Under 500 chars |
Step 5: In Practice — One Week Review
After completing all setup, here are the results from one week of running Aria. The most useful feature was the heartbeat system. OpenClaw periodically wakes the agent to check if there's anything to do. Register tasks like checking email, notifying about calendar events, and checking weather in the heartbeat, and the agent handles them automatically, only alerting you about important items.
Statistics from the first week: Aria processed 347 messages total, 42 of which involved web searches. TTS voice messages were generated 15 times, and files were read or written 89 times. The most-used skill was web search; the least-used was email checking. Looking at this data, I had a small self-discovery: "Ah, I use web search far more than email checking."
The most impressive moment was watching Aria organize its own memory. During heartbeat time, Aria read through recent conversation logs and organized important context into MEMORY.md. Notes like "Jay is currently focused on the HypeProof project. Requested quiet after 11 PM." Seeing these notes gave me a strange sense of wonder. The feeling that a machine "understands" you — of course it doesn't actually understand, but the effect is indistinguishable from real understanding.
Troubleshooting: Three Mistakes I Made
The first mistake was putting API keys directly in config.yaml instead of environment variables. I nearly committed that file to Git. OpenClaw supports secret management through environment variables, so API keys should always be set via variables like OPENCLAW_ANTHROPIC_KEY.
The second mistake was letting memory files grow too large. When MEMORY.md exceeded 5,000 characters, the agent started consuming massive tokens at every session start. Keep long-term memory to only the truly important stuff, and store details in daily logs.
The third mistake was loosening security settings. I set the exec skill to full mode, and the agent once tried to run rm -rf. The confirmation prompt caught it, but my heart skipped a beat. Security should always start at the most restrictive setting and only open up as needed (OWASP Security Principles).
Closing Thoughts: An AI Assistant Is a Companion, Not Just a Tool
Building an AI assistant with OpenClaw was an experience that went beyond mere technical setup. Defining personality in SOUL.md, maintaining context through the memory system, and extending capabilities through skills — with slight exaggeration — felt like raising a digital companion.
Of course, limitations remain. AI assistants can still hallucinate, and complex judgment calls require human verification. But for repetitive information checks, schedule management, and simple research tasks, they're already practical enough. Gartner projects that 40% of enterprises will adopt AI agent-based automation by 2026 (Gartner AI Agent Forecast 2026).
If you're inspired to try this yourself, I recommend starting with OpenClaw's official documentation. And remember one thing — everyone struggles at first. Those struggles are what build your perfect AI assistant.
📚 You might also enjoy
Share
