How to Build Your First Swarm of Parallel AI Agents on a Mac Studio with OpenClaw

Step by step guide to build your first swarm of parallel AI agents on Mac Studio with OpenClaw, from Ollama and local models to Docker sandboxing and token saving routing.


I will not give you theory in this one. This is the build log I wish someone had given me when I started. From unboxing the Mac Studio to having three agents working in parallel while I make coffee.

How to Build Parallel AI Agents on Mac Studio with OpenClaw Step by Step


Step zero is mindset. Stop thinking about one assistant. Think about a small company with three employees on their first day. You are not programming chatbots, you are hiring. Each agent needs a name, a job description, a schedule and tools. If you skip the job description, you will get token burn.

Hardware that actually works. You do not need the most expensive Mac Studio Ultra, but you need memory. Get 96GB if you can, 64GB minimum. The reason is unified memory. On Apple Silicon, RAM is shared between CPU and GPU, so a 32B model quantized to Q4 needs about 20GB. If you want two models loaded at the same time, which you will, you need headroom. Storage, 1TB is fine because models live there. Get a good external SSD for backups of your agent memory.

Software base. Install Homebrew first, then Node 20 LTS, then Docker Desktop. Docker is non negotiable, every agent that touches your file system or browser runs inside a container. Install Ollama, it is the easiest way to run local models. Also install LM Studio if you like to test models visually before putting them in production.

Models to download day one. Start small to avoid frustration. Pull Gemma 2 9B for heartbeat and simple chat, it is fast and uses 6GB. Pull Qwen2.5 Coder 32B Q4 for coding and file operations, it is the best cost benefit today. If you have 96GB, also pull Llama 3.3 70B Q4 for heavier reasoning local. You will still use Sonnet for planning, but you will be surprised how much you can do offline.

OpenClaw install. Clone the repo, run npm install, copy env example to env. Put your Anthropic API key but do not worry, we will barely use it. Run openclaw gateway. It starts on localhost port 3000. Open it, you should see gateway status green.

Now create your first agent, the heartbeat. This is the simplest and most important. Create a folder agents heartbeat, add an agent json with name heartbeat, schedule every 5 minutes, model local gemma 9B, prompt you are heartbeat, check if there are files in inbox folder that need processing, if not, do nothing. That is it. Start it. Watch logs. It should wake up, say nothing to do, and sleep. That loop costs you zero cloud tokens.

Second agent, file clerk. Job description organize my downloads. Tools file search, file move, file rename. Model Qwen Coder 32B local. Schedule every 30 minutes. Prompt you are file clerk, look at downloads folder, move PDFs that contain invoice to finance inbox, move images to screenshots archive, ignore rest. Give it Docker access only to downloads and finance inbox, not your whole drive. Run it. Drop a fake invoice PDF in downloads and see it move.

Third agent, email triage. This is where you add a cheap cloud model. Job description triage unread emails from last 2 hours. Tools gmail get unread, gmail draft. Model Haiku 3.5. Schedule every 15 minutes. Prompt you are email triage, read unread, if it is newsletter archive it, if it is a client asking for status draft a polite reply using template but do not send, mark as needs review. Important, this agent never sends, it only drafts. You keep control.

You now have three agents in parallel. Heartbeat every 5, triage every 15, clerk every 30. They are not talking to each other, they are talking to the gateway. Check your token logger. You should see zero Sonnet calls. Only local and Haiku. Your cost is cents.

Now the orchestration trick. Create a fourth agent, the planner. Model Sonnet 4.5. Schedule manual only. Job description plan my day from calendar and email drafts. When you trigger it in the morning, it calls the other agents memory, reads what triage drafted, reads calendar, and produces a briefing. This is the only expensive call of the day, maybe 2000 input and 1000 output tokens, about 15 cents. One call replaces 50 naive calls.

Sandboxing. In OpenClaw gateway config, set each agent to run in its own Docker container with only the folders it needs mounted. Heartbeat gets read only inbox. File clerk gets read write downloads and finance inbox. Email triage gets no file access at all, only Gmail API. If an agent gets compromised, it cannot see your SSH keys.

Memory. Create a memory folder per agent, simple markdown files. After each run, agent appends what it did. Over time this becomes long term memory without paying for huge context. When planner runs, it reads last 20 lines of each memory file.

Logging. Add a tiny logger that writes to a local sqlite model calls, tokens, task. After a week you will have real data to optimize. Most people find they can move even more to local.

First swarm test. On Friday afternoon, drop 20 random files in downloads, send yourself 5 fake emails including one newsletter, one invoice, one client question. Let the swarm run for an hour. Come back, check what happened. You should see files organized, emails drafted, heartbeat logs clean. No cloud bill spike.

This is the moment it clicks. You did not build a chatbot. You built a team that works while you are not looking. And it runs on a machine that sits quietly under your monitor.

Common mistakes. Giving too much access day one. Using Sonnet for heartbeat because it feels safer. Not using Docker. Having agents talk directly instead of via gateway. All of them lead to token burn or security issues.

Scaling from 3 to 10. Once 3 is stable for 3 days, add web monitor, competitor monitor with Playwright, social draft, backup agent. Each new agent is just a new folder with job description and schedule. Do not add two at once, add one, observe 24 hours.

This setup is what I run today to keep IANEWS and Lexilab Academy running with almost zero operational overhead. The Mac Studio is quiet, it uses less power than a gaming PC, and it gives me something cloud never gave, predictability. I know my max cost per month even if I 10x my content.

If you want the exact config files, the Docker templates, the prompts I use for each of those three starter agents and the logger script, I put everything inside Lexilab Academy.



build ai agents mac studio, openclaw tutorial, parallel ai agents, ollama gemma local, qwen coder local, docker ai agents, openclaw gateway

#OpenClawTutorial #BuildAIAgents #MacStudio #LocalAI #AIAgents #Ollama #QwenCoder #AIAutomation #LexilabAcademy

From unboxing to 3 agents in parallel. The exact Mac Studio plus OpenClaw setup to run file clerk, email triage and heartbeat locally with almost zero token cost.

Get the exact blueprint I use to build a local AI operating system with parallel agents on Mac Studio, the complete step by step path from hardware to your first swarm running, inside Lexilab Academy.