First-run success rate on deployed code
Target: 90%+
IDENTITY
### Phase 4: Wire Up the Gateway (20 minutes)
#### Step 16: Verify Your Agent Workspace
Your agents are defined by their SOUL.md and IDENTITY.md files in the `agents/` directory. The gateway discovers them automatically when it starts.
**Verify the structure is correct:**
```bash
ls -la ~/openclaw-workspace/agents/*/SOUL.md
ls -la ~/openclaw-workspace/agents/*/IDENTITY.md
You should see three SOUL.md files and three IDENTITY.md files (researcher, writer, builder).
Step 17: Start the Gateway
cd ~/openclaw-workspace
openclaw gateway --port 18789
You should see the gateway start and bind to the port. If a previous process is using the port:
openclaw gateway --port 18789 --force
Verify it is running:
curl http://127.0.0.1:18789/health
Step 18: Test With a Simple Task
Send your first task to the research agent:
openclaw agent \
--agent researcher \
--message "Find the top 5 open-source AI agent frameworks in 2026. For each, provide: name, GitHub stars, key features, and primary use case. Rank by adoption." \
--local
The --local flag runs the agent embedded using your configured model provider. You will see the agent process the request and return structured research output based on its SOUL.md rules.
Check your session history:
openclaw sessions
Congratulations. Your AI command center just completed its first task.
Phase 5: Set Up Paperclip for Agent Orchestration (30 minutes)
Paperclip is the orchestration layer that manages your agents as a company. It is an open-source Node.js server and React dashboard (39,000+ GitHub stars, MIT license) that gives you org charts, budgets, governance, ticketing, and agent coordination — all from one interface. If OpenClaw is an employee, Paperclip is the company that employee works inside.
What Paperclip gives you:
- A ticket-based task system where agents claim and complete work
- Org charts with roles, reporting lines, and delegation
- Cost tracking with per-agent budgets that auto-pause on overspend
- Governance gates so you approve strategy before agents execute
- Scheduled heartbeats so agents wake up, check for work, and act — 24/7
- Multi-company support from a single deployment
- A React dashboard to monitor everything from your browser or phone
Requirements: Node.js 20+, pnpm 9.15+
Step 19: Install Paperclip
The fastest way to get running is the one-line installer:
npx paperclipai onboard --yes
This clones the repo, installs dependencies, runs migrations, and starts the server in one command.
Or install manually if you prefer more control:
cd ~/openclaw-workspace
git clone https://github.com/paperclipai/paperclip.git
cd paperclip
Install pnpm if you do not have it:
npm install -g pnpm@9.15.4
Install dependencies and start:
pnpm install
pnpm dev
This starts the API server and UI at http://localhost:3100. An embedded PostgreSQL database (PGlite) is created automatically — no database setup required.
Verify it is running:
curl -s http://localhost:3100/api/health | head -5
You should see a JSON response with a healthy status. Open http://localhost:3100 in your browser to see the Paperclip dashboard.
Step 20: Create Your Company
In the Paperclip dashboard at http://localhost:3100:
- Click Create Company
- Give it a name (e.g., "My AI Command Center")
- Define your company's mission (e.g., "Automate content creation and research for my business")
This creates your company workspace with a default org chart structure. Every agent, task, and budget will be scoped to this company.
Step 21: Connect Your OpenClaw Agents to Paperclip
Paperclip uses an invite-based onboarding flow to connect OpenClaw agents:
- In the Paperclip dashboard, navigate to your company settings
- In the Invites section, click Generate OpenClaw Invite Prompt
- Copy the generated invite prompt
- Paste it into your OpenClaw main chat as one message
- Back in the Paperclip dashboard, approve the join request when it appears
- Your OpenClaw agent now shows up in the Paperclip org chart as a managed employee
Repeat this for each OpenClaw agent you want Paperclip to manage. Each agent gets a role, a title, a reporting line, and a job description inside the org chart.
Step 22: Pull Additional Local Models
For code tasks, add a specialized coding model:
ollama pull qwen2.5-coder:7b
For embeddings (semantic search and memory):
ollama pull snowflake-arctic-embed2
Verify all models:
ollama list
You should see:
NAME SIZE
llama3.2:3b 2.0 GB
qwen2.5-coder:7b 4.7 GB
snowflake-arctic-embed2 669 MB
Step 23: Configure Budgets and Governance
In the Paperclip dashboard, set up cost controls for each agent:
- Click on an agent in the org chart
- Set a monthly budget (e.g., $10/month for routine agents, $50/month for heavy workers)
- When an agent hits its budget limit, Paperclip automatically pauses it — no runaway costs
Set up governance gates:
- Navigate to company settings
- Enable approval gates for high-impact actions (hiring new agents, changing strategy, large spend)
- You are the board — agents propose, you approve
Step 24: Create Your First Managed Task
Test the full loop:
- In the Paperclip dashboard, create a new Issue (task)
- Write clear instructions (e.g., "Research the top 5 competitors in [your niche] and write a summary")
- Assign it to your Research agent
- Watch the agent claim the task, execute it, and mark it done — all visible in the dashboard
You now have a fully managed AI company where work is tracked, agents are accountable, and you have visibility into everything from one screen.
Tip: Paperclip supports scheduled heartbeats. Configure your agents to wake on a schedule (e.g., every hour), check for new tasks, and execute them autonomously. This is how you get 24/7 operation without babysitting.
Phase 6: Connect to Supabase for Persistence (Optional — 30 minutes)
This step is optional but recommended. Supabase gives your agents persistent memory — task history, execution logs, and structured data that survives restarts.
Step 24: Create a Supabase Project
- Go to supabase.com
- Create a new project (free tier works)
- Note your Project URL and Service Role Key from Settings → API
Step 25: Set Up the Database Schema
In the Supabase SQL Editor, run:
-- Task queue table
CREATE TABLE IF NOT EXISTS task_queue (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
agent TEXT NOT NULL,
title TEXT NOT NULL,
description TEXT,
status TEXT DEFAULT 'pending' CHECK (status IN ('pending', 'approved', 'claimed', 'running', 'complete', 'failed')),
priority TEXT DEFAULT 'normal' CHECK (priority IN ('low', 'normal', 'high', 'critical')),
result JSONB,
claimed_by TEXT,
created_at TIMESTAMPTZ DEFAULT now(),
updated_at TIMESTAMPTZ DEFAULT now(),
completed_at TIMESTAMPTZ
);
-- Agent actions log
CREATE TABLE IF NOT EXISTS agent_actions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
agent TEXT NOT NULL,
action TEXT NOT NULL,
details JSONB,
status TEXT DEFAULT 'success',
created_at TIMESTAMPTZ DEFAULT now()
);
-- Indexes for performance
CREATE INDEX idx_task_queue_status ON task_queue(status);
CREATE INDEX idx_task_queue_agent ON task_queue(agent);
CREATE INDEX idx_agent_actions_agent ON agent_actions(agent);
CREATE INDEX idx_agent_actions_created ON agent_actions(created_at);
-- Enable Row Level Security
ALTER TABLE task_queue ENABLE ROW LEVEL SECURITY;
ALTER TABLE agent_actions ENABLE ROW LEVEL SECURITY;
-- Service role has full access (your backend)
CREATE POLICY "service_role_full_access_tasks" ON task_queue
FOR ALL USING (auth.role() = 'service_role');
CREATE POLICY "service_role_full_access_actions" ON agent_actions
FOR ALL USING (auth.role() = 'service_role');
Step 26: Configure Supabase in OpenClaw
echo 'export SUPABASE_URL="https://your-project-id.supabase.co"' >> ~/.zshrc
echo 'export SUPABASE_SERVICE_KEY="your-service-role-key"' >> ~/.zshrc
source ~/.zshrc
Update openclaw.json:
{
"queue": {
"type": "supabase",
"url_env": "SUPABASE_URL",
"key_env": "SUPABASE_SERVICE_KEY",
"table": "task_queue",
"max_concurrent": 3,
"retry_limit": 2
},
"logging": {
"supabase": true,
"table": "agent_actions"
}
}
Restart the gateway:
openclaw gateway --port 18789 --force
Phase 7: Always-On Operation (15 minutes)
Your agents should run whether you are at your desk or not. LaunchAgents (Mac) or systemd (Linux) handle this.
Step 27: Create the LaunchAgent (Mac)
cat > ~/Library/LaunchAgents/com.openclaw.gateway.plist << 'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.openclaw.gateway</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/node</string>
<string>/opt/homebrew/bin/openclaw</string>
<string>gateway</string>
<string>--port</string>
<string>18789</string>
</array>
<key>WorkingDirectory</key>
<string>/Users/YOUR_USERNAME/openclaw-workspace</string>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
<key>HOME</key>
<string>/Users/YOUR_USERNAME</string>
</dict>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/Users/YOUR_USERNAME/openclaw-workspace/logs/gateway-stdout.log</string>
<key>StandardErrorPath</key>
<string>/Users/YOUR_USERNAME/openclaw-workspace/logs/gateway-stderr.log</string>
</dict>
</plist>
PLIST
Replace YOUR_USERNAME with your actual username. Find it with:
whoami
Load it:
launchctl load ~/Library/LaunchAgents/com.openclaw.gateway.plist
Verify it is running:
launchctl list | grep openclaw
Step 28: Create the Ollama LaunchAgent (Mac)
cat > ~/Library/LaunchAgents/com.ollama.serve.plist << 'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.ollama.serve</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/ollama</string>
<string>serve</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
PLIST
launchctl load ~/Library/LaunchAgents/com.ollama.serve.plist
Linux Alternative: systemd
sudo cat > /etc/systemd/system/openclaw-gateway.service << 'SERVICE'
[Unit]
Description=OpenClaw Gateway
After=network.target
[Service]
Type=simple
User=YOUR_USERNAME
WorkingDirectory=/home/YOUR_USERNAME/openclaw-workspace
ExecStart=/home/linuxbrew/.linuxbrew/bin/node /home/linuxbrew/.linuxbrew/bin/openclaw gateway --port 18789
Restart=always
RestartSec=5
Environment=PATH=/home/linuxbrew/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin
Environment=HOME=/home/YOUR_USERNAME
[Install]
WantedBy=multi-user.target
SERVICE
sudo systemctl enable openclaw-gateway
sudo systemctl start openclaw-gateway
sudo systemctl status openclaw-gateway