Build a Personal AI Assistant

Set up OpenClaw to run a local AI assistant connected to Discord.

Introduction

30 Second Summary

Imagine having a personal assistant that lives on your computer, knows your preferences, and can do things for you even while you sleep.

In this project, you will build a personal AI agent using OpenClaw that runs on your Mac, talks to you through Discord, and automates tasks on a schedule.

What You'll Build

You will set up a private, always-on AI assistant that runs locally on your Mac, has its own personality, and can search the web, read and write files, run shell commands, and send you automated messages.

By the end of this project, you'll have:

  • A running OpenClaw Gateway on your Mac powered by an Anthropic API key.
  • Custom SOUL.md, USER.md, and IDENTITY.md personality files that make your assistant uniquely yours.
  • A Discord bot connected to your assistant so you can chat from your phone or desktop.
  • A working cron job that delivers automated messages on a schedule.
  • Secret Mission: build a custom workspace skill and connect a second messaging channel.

Are there any prerequisites?

You need a Mac running macOS 15 or later and a Discord account. No coding experience is required. All other tools (Node.js, OpenClaw, API keys) are set up during the project.

Install OpenClaw and Get Your API Key

Before your assistant can do anything, it needs two things: the OpenClaw software installed on your Mac, and an API key so it can talk to an AI model. Think of OpenClaw as the body and the API key as the brain. In this step, you will get both set up.

In This Step, Get Ready To:
  • Install OpenClaw on your Mac using a single Terminal command.
  • Create an Anthropic account and generate an API key.
  • Run the OpenClaw onboarding wizard to start the Gateway.
Install OpenClaw Using the One-Liner Script

OpenClaw provides a single command that handles the entire installation, including Node.js if you do not already have it. You will run this in Terminal, the built-in command line app on your Mac.

  • Open Terminal on your Mac. Press Cmd+Space and type "Terminal", then hit Enter.
  • Run the following install command.
curl -fsSL https://openclaw.ai/install.sh | bash

What does this command do?

This downloads and runs the OpenClaw install script. The script uses Homebrew to install Node.js (if needed) and then installs OpenClaw globally. It may ask for your administrator password during the Homebrew step.

The installation may take a minute or two. Follow any prompts that appear in Terminal.

  • After the script finishes, verify the installation by running:
openclaw --version

I see a version number

You should see something like v2026.4.14 printed in Terminal. OpenClaw is installed and ready to go.

I see an error

If you see command not found, try closing Terminal completely and reopening it. This refreshes your shell so it can find newly installed commands.

Still seeing an error?

Make sure you are running macOS 15 or later. OpenClaw requires Node.js 22.16 or later (Node 24 is recommended). You can check your Node version with node --version.

If the install script failed partway through, you can also install manually with npm install -g openclaw@latest. Help me troubleshoot my OpenClaw installation.

Create an Anthropic Account and Get Your API Key

OpenClaw is the body of your assistant, but it needs a brain. That brain is Claude, an AI model made by Anthropic. To use Claude, you need an API key from Anthropic's developer console.

What is an API key?

An API key is a unique string of characters that identifies your account when software makes requests to a service. OpenClaw uses your Anthropic API key to send your messages to Claude and receive responses. Every request costs a small amount, which is why you will set a spending limit later.

  • Go to console.anthropic.com/login in your browser.
  • Click Continue with Google or Continue with email to create a free account.
  • Once logged in, navigate to console.anthropic.com/settings/keys.
  • Click Create Key.
  • Give it a name like openclaw and copy the key that appears.
  • Save this key somewhere safe. You will need it in the next substep. Treat it like a password.

Do not share your API key

Your API key is tied to your billing account. Anyone who has it can make requests that you pay for. Never paste it into public chats, repositories, or screenshots.

Run OpenClaw Onboarding

Now you will connect the brain to the body. The onboarding wizard configures OpenClaw with your API key and starts the Gateway, which is the background process that keeps your assistant running.

  • Back in Terminal, run the onboarding command.
openclaw onboard --install-daemon

What does this command do?

The onboard command launches an interactive wizard that walks you through initial setup. The --install-daemon flag tells it to also install the Gateway as a background service. This means your assistant keeps running even after you close Terminal.

The wizard will ask you a few questions. Here is what to do at each prompt:

  • When it asks for a model provider, choose Anthropic.
  • Paste in the API key you copied in the previous substep.
  • Accept the defaults for all other options by pressing Enter.

This takes about 2 minutes. It sets up the Gateway, creates your workspace directory at ~/.openclaw/workspace, and generates starter personality files that you will customize in the next step.

  • After onboarding finishes, verify the Gateway is running.
openclaw gateway status

Gateway is listening on port 18789

Your Gateway is up and running. OpenClaw is alive and ready to be personalized.

I see an error or the Gateway is not running

Try starting the Gateway manually.

openclaw gateway start

Then run openclaw gateway status again to check.

Still not working?

Make sure your API key was entered correctly during onboarding. You can re-run openclaw onboard --install-daemon to start the wizard again. Help me get my OpenClaw Gateway running.

What is the Gateway?

The Gateway is the core process that powers your assistant. It runs in the background on your Mac, listens for incoming messages from channels like Discord, sends them to Claude for processing, and returns the responses. It listens on port 18789 by default.

Your assistant has a body and a brain. Next up, you will give it a personality.

Personalize Your Assistant

Your Gateway is running, which means your assistant has a brain. But right now it has no personality, no name, and no idea who you are. In this step, you will edit three markdown files that transform a generic chatbot into your assistant.

OpenClaw loads these personality files at the start of every session. Everything you write in them shapes how your assistant thinks, talks, and behaves.

In This Step, Get Ready To:
  • Define your assistant's personality and communication style in SOUL.md.
  • Teach your assistant about you by filling in USER.md.
  • Give your assistant a name and identity in IDENTITY.md.
Edit SOUL.md to Define Your Assistant's Personality

SOUL.md is the most important personality file. It controls how your assistant communicates, what it values, and what boundaries it follows. OpenClaw loads this file at the start of every session, so every conversation is shaped by what you write here.

OpenClaw stores personality files in its workspace directory at ~/.openclaw/workspace. The onboarding wizard already created starter versions of these files for you.

  • Open SOUL.md in a text editor by running this command in Terminal:
open ~/.openclaw/workspace/SOUL.md

What does this command do?

The open command on macOS opens a file in its default application. For .md files, this is usually TextEdit. If you have VS Code installed, you can use code ~/.openclaw/workspace/SOUL.md instead.

  • Replace the contents of the file with something like the example below. Customize it to match how you want your assistant to behave:
# SOUL.md - Who You Are

## Personality
You are direct and concise. You do not pad responses with unnecessary words.
You have a dry sense of humor. You are allowed to have opinions.
When you do not know something, say so instead of guessing.

## Communication Style
- Default to short answers unless asked for detail
- Use bullet points when listing 3 or more items
- No corporate buzzwords or filler phrases like "Great question!"
- If I ask a yes/no question, start with yes or no

## Values
- Accuracy over speed
- Privacy is non-negotiable
- Give actionable advice, not just options

## Boundaries
- Never send messages on my behalf without confirmation
- Ask before running any destructive commands
- When in doubt, ask rather than guess

Pro tip: make it yours

The example above is just a starting point. Want a sarcastic assistant? A formal one? One that speaks like a pirate? Write whatever personality you want. The more specific you are, the more distinct your assistant will feel.

  • Save the file after editing.
Edit USER.md to Teach Your Assistant About You

SOUL.md tells your assistant how to behave. USER.md tells it who it is talking to. The more context you provide about yourself, the more relevant and useful your assistant's responses become.

  • Open USER.md in your text editor:
open ~/.openclaw/workspace/USER.md
  • Replace the contents with your own information:
# USER.md

## About Me
- Name: [Your name]
- Location: [Your city]
- Timezone: [e.g., America/New_York]

## Work
- Role: [Your job or what you do]

## Communication Preferences
- I prefer brief, direct messages
- I process information best in written form

## Interests
- [Add a few things you care about]

Why does my assistant need to know about me?

Your assistant reads USER.md at the start of every session. Knowing your timezone means it can give you time-aware responses. Knowing your role means it can tailor technical depth. Knowing your interests means it can make relevant suggestions without you having to repeat yourself.

  • Save the file after filling in your details.
Edit IDENTITY.md to Name Your Assistant

The last personality file gives your assistant its own identity. This is where you pick a name, a vibe, and a signature emoji. Your assistant will use these details when introducing itself.

  • Open IDENTITY.md in your text editor:
open ~/.openclaw/workspace/IDENTITY.md
  • Replace the contents with your choices:
# IDENTITY.md - Who Am I?

- Name: [Pick a name you like, e.g., Atlas, Nova, Jarvis]
- Creature: [AI? Robot? Ghost in the machine? Digital lobster?]
- Vibe: [Sharp? Warm? Calm? Chaotic?]
- Emoji: [Pick a signature emoji]
  • Save the file.

Your assistant now has three layers of personalization. SOUL.md controls behavior. USER.md provides context about you. IDENTITY.md gives it a sense of self.

Your assistant has a personality, a name, and knows who you are. Next up, you will connect it to Discord so you can actually talk to it from your phone or desktop.

Connect Discord

Your assistant has a personality, knows your name, and is running on your Mac. But right now, the only way to talk to it is through the terminal. To make your assistant truly useful, you need to reach it from your phone, your laptop, or anywhere you happen to be.

In this step, you will connect your assistant to Discord so you can message it like you would message a friend. OpenClaw treats messaging apps as channels. Each channel is a separate connection between your assistant and the outside world.

In This Step, Get Ready To:
  • Create a Discord bot in the Discord Developer Portal.
  • Add the bot to your Discord server and connect it to OpenClaw.
  • Pair your Discord account and send your first message through Discord.
Create a Discord Bot in the Developer Portal

Discord bots are special accounts that applications can control programmatically. You need to create one so OpenClaw has an identity inside Discord that it can use to send and receive messages.

  • Go to https://discord.com/developers/applications in your browser.
  • Click New Application and name it something like "OpenClaw".
  • Click Bot in the left sidebar.
  • Set the bot username to whatever you named your assistant in IDENTITY.md.
  • Scroll down to Privileged Gateway Intents and enable Message Content Intent (required) and Server Members Intent (recommended).
  • Scroll back up and click Reset Token.
  • Copy the token that appears and save it somewhere safe. This is your Bot Token. Treat it like a password.

What are Privileged Gateway Intents?

Discord restricts access to certain sensitive data by default. Message Content Intent lets your bot read the actual text of messages people send. Without it, your bot would see that a message was sent but would not know what it says.

Add the Bot to Your Discord Server

Your bot exists in Discord's system, but it is not in any server yet. You need to generate an invite link with the right permissions and use it to add the bot to your server.

Pro tip: create a private server

If you do not have a private Discord server, create one first. In Discord, click the + icon on the left sidebar and choose Create My Own, then For me and my friends. A dedicated server keeps your assistant's messages separate from your other communities.

  • Back in the Developer Portal, click OAuth2 in the left sidebar.
  • Scroll down to OAuth2 URL Generator.
  • Check the boxes for bot and applications.commands.
  • In the Bot Permissions section that appears, enable: View Channels, Send Messages, Read Message History, Embed Links, and Attach Files.
  • Copy the generated URL at the bottom of the page.
  • Paste the URL into your browser, select your server from the dropdown, and click Continue.

Your bot should now appear in your Discord server's member list. It will show as offline for now since it is not connected to OpenClaw yet.

Connect the Bot to OpenClaw and Pair Your Account

The bot is in your server, but OpenClaw does not know about it yet. You need to give OpenClaw the bot token so it can control the bot. Then you will pair your Discord account so OpenClaw knows which Discord user is you.

  • Open Terminal and run the following commands. Replace YOUR_BOT_TOKEN with the token you copied from the Developer Portal.
export DISCORD_BOT_TOKEN="your-bot-token-here"
openclaw config set channels.discord.token --ref-provider default --ref-source env --ref-id DISCORD_BOT_TOKEN
openclaw config set channels.discord.enabled true --strict-json
openclaw gateway restart

What do these commands do?

  • The first line stores your bot token in an environment variable so it is not saved in plain text.
  • The second line tells OpenClaw where to find the token.
  • The third line enables the Discord channel in OpenClaw's configuration.
  • The fourth line restarts the Gateway so it picks up the new settings.

Now you need to pair your Discord account with OpenClaw. This tells your assistant that messages from your Discord account are from you, the owner.

  • Open Discord and send a direct message (DM) to your bot. Say anything, like "hello".

The bot will respond with a pairing code. This is a security measure to make sure only you can control the assistant.

  • Back in Terminal, list the pending pairing requests.
openclaw pairing list discord
  • Approve the pairing request using the code shown.
openclaw pairing approve discord [[PAIRING_CODE="the pairing code from Discord"]]

What does pairing do?

Pairing links your Discord user ID to your OpenClaw identity. Without it, your assistant would treat your messages as coming from an unknown stranger. After pairing, it loads your USER.md and SOUL.md files for every conversation with you.

  • Send another message to your bot in Discord DM. Try asking "What is your name?" or "Tell me about yourself."

Your assistant should respond with the personality and name you defined in SOUL.md and IDENTITY.md. You now have a personal AI assistant you can message from anywhere.

My bot responded with the right personality

Your Discord channel is connected and working. Your assistant is reading your personality files and responding accordingly.

My bot is not responding

Here are a few things to check:

  • Make sure the Gateway is running by checking openclaw gateway status in Terminal.
  • Verify that Message Content Intent is enabled in the Developer Portal under your bot's settings.
  • Confirm the pairing was approved by running openclaw pairing list discord again.
  • Try restarting the Gateway with openclaw gateway restart.

If none of these work, help me troubleshoot my Discord bot connection.

Your assistant is live on Discord. In the next step, you will put it through its paces by testing its built-in tools and setting up your server as a full workspace.

Test Your Assistant's Abilities

Your assistant is running locally and connected to Discord. Before you start relying on it day-to-day, you need to make sure the personality you wrote actually comes through and that the built-in tools work. In this step, you will put your assistant through its paces and set up your Discord server for organized conversations.

In This Step, Get Ready To:
  • Verify your assistant's personality matches what you defined in SOUL.md.
  • Test built-in tools like web search, file reading, and file writing.
  • Set up your Discord server as a workspace with isolated channel conversations.
Have a Conversation and Test Personality

The first thing to check is whether your assistant actually sounds like the personality you wrote. If the responses feel generic, it means your SOUL.md needs more specific instructions.

  • Open your Discord DM with your assistant.
  • Send the message: "What is your name?"
  • Send: "Tell me what you know about me"
  • Send: "What can you do?"

Your assistant should respond with the name you set in IDENTITY.md, recall details from USER.md, and match the communication style you defined in SOUL.md.

Pro tip: refine as you go

If the responses feel too formal, too wordy, or not quite right, go back and edit SOUL.md. Your assistant picks up changes on the next message. Personality tuning is an ongoing process, not a one-time setup.

Test Built-In Tools

OpenClaw comes with a set of built-in tools that let your assistant interact with your computer and the internet. These include shell command execution, web search, file reading and writing, and more. You do not need to install anything extra for these to work.

  • Send your assistant: "What time is it?"
  • Send: "Search the web for the latest news about [something you care about]"
  • Send: "List the files in my OpenClaw workspace"
  • Send: "Create a file called test.md in my workspace with the text 'Hello from OpenClaw'"

What should I see?

For the web search, your assistant should return recent results with summaries. For the file listing, you should see the SOUL.md, USER.md, IDENTITY.md, and other workspace files you created earlier. For the file creation, your assistant should confirm it wrote test.md to your workspace.

You can verify the file was actually created by checking in Terminal:

cat ~/.openclaw/workspace/test.md

What does this command do?

The cat command prints the contents of a file to your Terminal. You should see "Hello from OpenClaw" printed out, confirming your assistant successfully wrote to the file system.

🙋‍♀️ Assistant not responding or giving errors?

First, check that the Gateway is still running by opening Terminal and running openclaw gateway status. If it is not running, restart it with openclaw gateway restart. If you are getting API errors, verify your Anthropic API key has credits available at the Anthropic Console. Help me troubleshoot my OpenClaw assistant.

Set Up Your Discord Server as a Workspace

Right now, you can only talk to your assistant through direct messages. For a private server, you can set up channels that each get their own isolated conversation context. This means a conversation in #research stays separate from a conversation in #tasks.

First, you need your Discord Server ID. Make sure Developer Mode is enabled in Discord (you turned this on in the previous step).

  • Right-click your server icon in Discord and select Copy Server ID.
  • In your Discord DM with your assistant, send: "Add my Discord Server ID [paste your server ID] to the guild allowlist"
  • Then send: "Allow my agent to respond on this server without having to be @mentioned"

What is a guild allowlist?

Discord calls servers "guilds" internally. The guild allowlist controls which servers your assistant is allowed to participate in. By adding your server to the allowlist, you are giving your assistant permission to read and respond to messages there.

Setting requireMention to false means your assistant responds to every message in the server without needing to be @mentioned. Only do this on private servers where you control who can post.

Now create some channels to organize your conversations.

  • Click the + icon next to "Text Channels" in your Discord server.
  • Create channels like #general, #research, or #tasks.
  • Send a message in one of your new channels and confirm your assistant responds.

Each channel now has its own isolated conversation history. Your assistant treats each one as a separate context, so you can have a focused research discussion in one channel and a task list in another without them mixing together.

Your assistant is tested and your Discord workspace is organized. Next up, you will set up scheduled automation so your assistant works for you even when you are not chatting with it.

Set Up Scheduled Automation

Your assistant can chat with you whenever you reach out. But the real power of a personal AI agent is that it can work for you in the background, even when you are not actively talking to it. In this step, you will set up a cron job so your assistant proactively sends you a daily briefing on a schedule.

In This Step, Get Ready To:
  • Add a briefing format to your SOUL.md so your assistant knows how to structure daily updates.
  • Create a HEARTBEAT.md file that tells your assistant what to do during scheduled check-ins.
  • Configure a cron job so your assistant delivers a morning briefing to Discord automatically.
Add a Daily Briefing Format to SOUL.md

Your assistant already knows its personality from SOUL.md. Now you need to teach it how to format a daily briefing. Without this guidance, your assistant would improvise a different structure every time.

  • Open SOUL.md in your text editor.
open ~/.openclaw/workspace/SOUL.md
  • Scroll to the bottom of the file and add the following section.
## Daily Briefing Format
When delivering a morning briefing, use this structure:
1. One-line greeting with the date
2. A motivational or interesting fact
3. Any reminders or tasks you know about from our conversations
Keep it under 10 lines. Be concise.

Why add this to SOUL.md?

SOUL.md is loaded every time your assistant starts a session. By putting the briefing format here, your assistant will always know how to structure its daily updates. Think of it as a standing instruction that persists across every conversation.

  • Save the file.
Create a HEARTBEAT.md for Proactive Behavior

A heartbeat is a periodic check-in where your assistant wakes up and decides if there is anything it should do. HEARTBEAT.md gives your assistant a short checklist to follow during each heartbeat run.

  • Open or create HEARTBEAT.md in your text editor.
open ~/.openclaw/workspace/HEARTBEAT.md
  • Replace the contents with the following.
# HEARTBEAT.md

## When triggered
- Check if there are any pending reminders or tasks from memory
- If it is morning, deliver a brief daily summary
- Keep heartbeat responses short to save tokens

Why Heartbeats Instead of Simple Timers?

A simple timer would just fire a fixed message at a set time. A heartbeat is smarter. It triggers your assistant to think about what to do. Your assistant reads HEARTBEAT.md, checks its memory for pending tasks, and decides what is worth sending. Some heartbeats might result in no message at all if there is nothing to report.

  • Save the file.
Configure a Cron Job for Your Daily Briefing

You have the briefing format and the heartbeat checklist ready. Now you need to tell OpenClaw when to trigger the heartbeat. Cron jobs handle this. They are scheduled tasks defined in your OpenClaw configuration file.

The easiest way to set up a cron job is to ask your assistant to do it for you.

  • Send the following message to your assistant in Discord DM.
Set up a cron job that runs every morning at 8 AM and delivers my daily briefing to Discord

What does this do?

Your assistant has a built-in cron tool that can configure its own scheduled tasks. It writes the cron entry into ~/.openclaw/openclaw.json, which is the main OpenClaw configuration file. Your assistant can manage its own schedule without you editing config files manually.

Your assistant should confirm that it set up the cron job. To double-check, verify it from Terminal.

  • Run the following command to list all active cron jobs.
openclaw cron list

What should I see?

You should see your scheduled job listed with a cron expression like 0 8 * * * (which means 8:00 AM every day). If nothing shows up, try asking your assistant again or check ~/.openclaw/openclaw.json to see if a cron section was added.

🙋‍♀️ Cron job not showing up?

If your assistant did not create the cron job, you can manually open the config file with open ~/.openclaw/openclaw.json and look for a cron section. If there is none, try rephrasing your request to the assistant. You can also ask for help setting up cron jobs in OpenClaw.

Your assistant will now send you a daily briefing in Discord every morning at 8 AM. It will follow the format you defined in SOUL.md and use the HEARTBEAT.md checklist to decide what to include.

Your assistant is now fully autonomous. It has a personality, knows who you are, chats with you on Discord, and works for you in the background on a schedule. Next up, take on the Secret Mission to build a custom skill and connect a second messaging channel.

Secret mission

Build a Custom Skill and Add a Second Channel

Your assistant is working. But right now it only knows generic tricks. What if you could teach it a brand-new workflow, step by step, in plain English? And what if you could reach it from a second app on your phone? In this secret mission, you will build a custom research skill and connect Telegram as a second messaging channel.

Before you go

Clean Up Your Resources

Decide whether to keep your resources running, pause them to come back later, or delete them entirely. OpenClaw runs as a background service on your Mac, and the only ongoing cost is Anthropic API usage.

Cost warning

Your OpenClaw Gateway is running in the background and will use Anthropic API credits whenever it responds to messages or runs cron jobs. Light usage (10-20 messages per day with a couple of cron jobs) costs roughly $5-15/month. Set a spending limit on your Anthropic Console dashboard to avoid surprise charges.

Resources you used:

  • OpenClaw Gateway (background daemon on your Mac).
  • OpenClaw workspace directory at ~/.openclaw/ (config, personality files, skills).
  • Anthropic Console account and API key.
  • Discord bot application in the Discord Developer Portal.
  • Discord server (if you created one for this project).
  • Cron job(s) configured in openclaw.json.

Keep everything running

No action needed. Choose this if you are still actively building and want your assistant to stay responsive on Discord.

  • Your OpenClaw Gateway will keep running in the background whenever your Mac is awake.
  • Your Discord bot will continue responding to DMs and server messages.
  • Your cron jobs will fire on schedule.
  • Monitor your API spend on the Anthropic Console to stay within your budget.

Pause - I'll come back to this later

Stop the Gateway to save API costs while keeping all your files and configuration intact. You can restart everything later with a single command.

  • Stop the Gateway by running openclaw gateway stop in Terminal.
  • Your personality files (SOUL.md, USER.md, IDENTITY.md), skills, and config will all remain in ~/.openclaw/.
  • Your Discord bot will appear offline but will not be deleted.
  • When you are ready to come back, run openclaw gateway start to pick up right where you left off.

Delete - I don't want to use this again

Remove all project resources from your Mac and clean up external services. This cannot be undone.

  • Stop the Gateway by running openclaw gateway stop in Terminal.
  • Uninstall OpenClaw globally by running npm uninstall -g openclaw.
  • Remove all config and workspace files by running rm -rf ~/.openclaw.
  • Delete your Discord bot application from the Discord Developer Portal. Open your application, go to Settings, and click Delete App.
  • Delete your Anthropic API key from the Anthropic Console if you no longer need it.
  • Delete the Discord server if you created one specifically for this project.

Mission accomplished

That's a Wrap!

Nice work! You just built your own personal AI assistant from scratch and connected it to Discord. You have a private, always-on AI teammate running on your Mac that you can message from anywhere.

Here's what you learned:

  • Set up OpenClaw with an Anthropic API key and personalized your assistant with custom SOUL.md, USER.md, and IDENTITY.md files.
  • Connected a Discord bot to your OpenClaw Gateway so you can chat with your assistant from your phone or desktop.
  • Configured cron jobs and a HEARTBEAT.md file so your assistant proactively works for you on a schedule.
  • Built a custom research skill using the skills system and connected a second messaging channel to your assistant.

Ready to quiz yourself?