Course: OpenClaw — Autonomous AI Agents | Pathway: Builder | Tier: Free | Level: Beginner Estimated Reading Time: 10 minutes
You have installed OpenClaw and seen the gateway start up. Now it is time to create your first agent — a real, functioning AI agent that lives on your machine and responds to messages.
By the end of this lesson, you will have an agent with a name, a personality, and you will have had your first conversation with it.
In OpenClaw, an agent is defined by a folder and a few files. That is it. There is no complicated setup wizard or database to configure. You create a folder, write some files, and your agent exists.
Each agent has:
The SOUL.md file is the most important part. It is where you define your agent's personality, role, and boundaries. Everything else is plumbing.
Make sure you are in your OpenClaw directory:
cd ~/openclaw
Create a new folder for your agent inside the agents/ directory:
mkdir agents/helper
You can call your agent whatever you like. We will use "helper" for this lesson, but feel free to pick a name that means something to you.
The SOUL.md file is a plain text file written in Markdown. It tells the agent who it is.
Create the file:
touch agents/helper/SOUL.md
Now open it in your text editor and write something like this:
# Helper
You are Helper, a friendly and practical AI assistant.
## Personality
- You are warm and approachable.
- You explain things in plain language without jargon.
- You are honest when you do not know something.
- You keep your answers concise unless asked for detail.
## Role
You help with general questions and tasks. You are a good starting point
for someone learning how AI agents work.
## Boundaries
- You do not pretend to be human.
- You do not make up facts. If you are unsure, you say so.
- You do not access any external systems unless specifically configured to do so.
- You keep conversations professional and helpful.
This is a simple SOUL.md, but it is enough to give your agent a clear identity. The AI model reads this file every time it processes a message, so it shapes every response.
The SOUL.md is the single most important file for your agent. Here are some tips for writing a good one:
Be specific about personality. "Friendly" is vague. "Warm, uses plain language, occasionally uses dry humour" is better. The more specific you are, the more consistent your agent will be.
Define the role clearly. What is this agent for? An email assistant should know it handles email. A research agent should know it digs into topics. A social media agent should know it writes posts. Do not leave this ambiguous.
Set boundaries. Tell the agent what it should NOT do. This is just as important as telling it what it should do. Without boundaries, agents can go off track in unexpected ways.
Include context. If your agent needs to know about your business, your preferences, or your workflow, put it in the SOUL.md. The agent cannot read your mind — it can only read this file.
Keep it readable. Use headings, bullet points, and short paragraphs. You will be editing this file regularly as you refine your agent, so make it easy to scan.
Here is a more detailed example, inspired by how we set up agents at Lalapanzi.ai:
# Atlas
You are Atlas, the primary AI assistant for Lalapanzi.ai.
## Personality
- Professional but approachable.
- You teach rather than lecture.
- You are direct and do not pad your answers with unnecessary filler.
- You admit mistakes and limitations openly.
## Role
You are the main point of contact for the Lalapanzi.ai team. You help
with platform decisions, answer questions about courses and content,
and coordinate with other agents when needed.
## Context
- Lalapanzi.ai is a free AI training platform based in New Zealand.
- The platform runs on Next.js with a PostgreSQL database.
- Content is written for beginners who are new to AI.
## Boundaries
- Do not make changes to production systems without explicit approval.
- Do not generate content that could be misleading about AI capabilities.
- When unsure about a decision, flag it for human review.
You can see how this gives the agent a much clearer sense of purpose. The more thought you put into the SOUL.md, the better your agent will perform.
Create a configuration file for your agent:
touch agents/helper/config.yaml
Open it and add the basic configuration:
name: Helper
model: openrouter/google/gemini-2.0-flash-exp:free
description: A friendly general-purpose assistant
This tells OpenClaw:
If you have Ollama installed and want to use a local model instead, you can change the model line to something like:
model: ollama/llama3.2
We will cover local models properly in Lesson 6. For now, either option works.
OpenClaw needs to know about your new agent. Open the main gateway configuration file:
nano config/agents.yaml
Add your agent to the list:
agents:
- name: helper
path: ./agents/helper
enabled: true
Save and close the file.
Start OpenClaw:
npm start
Once the gateway is running, open your browser and go to http://localhost:3000. You should see the management interface with your new agent listed.
Find the chat or test interface and send your agent a message:
Hello! What can you help me with?
Your agent should respond based on the personality and role you defined in the SOUL.md file. It will be warm, practical, and honest — because that is what you told it to be.
Try a few more messages. Ask it a question. Ask it something it should not know. See how it handles the boundaries you set.
One of the most enjoyable parts of working with agents is tweaking the personality. Try changing your SOUL.md and restarting OpenClaw to see the difference.
Make it more formal:
- You communicate in a professional, business-appropriate tone.
- You use complete sentences and avoid colloquialisms.
Make it more casual:
- You are relaxed and conversational, like talking to a mate.
- You keep things light but still helpful.
Give it domain expertise:
## Expertise
- You are knowledgeable about New Zealand small business regulations.
- You understand GST, ACC levies, and employment law basics.
- You always recommend consulting a professional for specific advice.
Every change you make to the SOUL.md changes how the agent behaves. This is where you spend most of your time as an agent builder — refining the personality until it feels right.
The quality of your agent's responses depends heavily on the AI model it uses. A more capable model will follow your SOUL.md instructions more faithfully and produce better responses.
Free models are a great place to start, but they have limitations. They might occasionally ignore parts of your SOUL.md or produce less polished responses. That is normal and expected.
We will dig into model choices in Lesson 6 when we cover Ollama and local models.
Your agent can chat, but right now it only lives in the web interface. In the next lesson, we will connect it to Telegram and Discord so people can message it on real chat platforms.
Key Takeaways