How to build an AI agent: OpenClaw, Hermes, Muse, Grok Bot, or code

How to build an AI agent right now: OpenClaw, Hermes Agent, Meta Muse, Grok Bot, or code with MCP. Real setup steps, pricing, and failure modes.

By Matt · · 12 min read

How to build an AI agent

  1. Pick one concrete job with a clear finish line (inbox triage, morning reporting, lead research, or order support), not "be my assistant".
  2. Choose the right runtime for that job: OpenClaw or Hermes Agent for a self-hosted always-on agent, Meta Muse or Grok Bot for a hosted cloud agent, or LangGraph, Mastra, or PydanticAI + MCP if you are building inside an app.
  3. Wire up scoped tools first. Connect only the specific channels, files, or APIs needed, starting with read-only permissions.
  4. Write hard operating rules. Put persona, refusal rules, and escalation boundaries in your agent's config (SOUL.md, AGENTS.md, or system prompt).
  5. Isolate execution and cap spend. Run shell or browser tools in a sandbox, set a step limit per task, and route routine checks to cheaper models.
  6. Test it on 15 to 20 ugly real tasks (missing rows, expired links, hostile inputs) and keep it on drafts-only until accuracy holds steady.
  7. Done! Move it to a schedule or live channel once it passes a full week of supervised runs.
Lineup of three major AI agent platforms: OpenClaw red lobster mascot, Meta Muse plush mascot Jolly holding Fever tickets, and Grok Bot colourful character icons
Real AI agents today split into self-hosted runtimes (OpenClaw, Hermes) and hosted cloud VMs (Meta Muse, Grok Bot).

Most guides on how to build an AI agent are still stuck in 2024. They tell you to wire a prompt into Zapier, or copy a 30-line script that calls a chat API in a loop, and pretend you just built an autonomous worker.

That is not how real builders ship agents anymore. Today, you do not have to reinvent memory, messaging gateways, cron heartbeats, or tool wiring from scratch. Open-source runtimes like OpenClaw and Hermes Agent, hosted cloud agents like Meta Muse and Grok Bot, and standard MCP tool servers have replaced most of that glue code.

Matey builds custom AI agents for businesses and runs its own daily research, reporting, and drafting on agents we built ourselves. If you are still sorting out the basics first, start with what an AI agent is. Below is the real, no-fluff breakdown of the stacks people actually use to build AI agents, exact setup steps, honest trade-offs, and the five things that break in production.

OpenClaw vs Hermes Agent vs Meta Muse vs Grok Bot vs code

The fastest way to pick the right stack is by where the agent needs to live. Personal and internal ops agents belong in a persistent runtime or cloud VM. Customer-facing or product-embedded agents belong in code.

StackHostingModel choiceMemory and skillsTypical costBest for
OpenClawSelf-hosted (laptop, Mac mini, or VPS)Any API or local model (Ollama, OpenRouter, frontier APIs)Plain markdown (SOUL.md, MEMORY.md, SKILL.md) + ClawHubFree software + API tokens (or $0 local)Builders who want an always-on agent across WhatsApp, Telegram, Slack, Discord, and iMessage
Hermes AgentSelf-hosted, $5 VPS, Docker, or Modal / DaytonaAny provider (OpenRouter, Nous Portal, local, frontier APIs)Persistent FTS5 recall + self-improving skill learning loopFree software + compute + API tokensPower users who want an agent that learns new skills from experience and hibernates cheaply
Meta MuseHosted Secure VM managed by MetaLocked to Meta's Muse Spark modelsGoal plans, WhatsApp/Instagram Saves, Sentinel approval layerFree tier; Power US$20/mo; Maximum US$100/moPersonal tasks, WhatsApp/Instagram workflows, Meta ads, bookings, and zero-setup cloud execution
Grok BotHosted cloud VM managed by xAILocked to xAI's Grok stackCross-session memory + Teach-a-Task screen recordingFrom US$30/mo (Premium), US$100 (Super), US$200 (Ultra)Non-technical business operators running Slack, Teams, Shopify, QuickBooks, and HubSpot ops
Code + MCP (LangGraph, Mastra, PydanticAI)Your own backend / cloudAny model APIDatabase checkpointers, vector/SQL state, typed toolsDeveloper time + API tokensSaaS products, custom internal apps, and high-volume deterministic workflows
Visual builders (n8n, Zapier, Make)Cloud or self-hosted (n8n)Most major APIsMinimal (workflow variables)US$20 to US$100+/mo + API tokensSimple linear SaaS triggers (form -> enrich -> Slack), not true open-ended agents
Done-for-you build (Matey)Managed for youChosen for the jobLive store catalogue, stock, policies, and helpdesk stateQuoted per workflow (or flat monthly store plans)Businesses that want a customer-facing or ops agent built, tested, and kept accurate

How to build an AI agent with OpenClaw

To build an AI agent with OpenClaw, install the CLI globally, run openclaw onboard to connect your model and messaging channel, write your rules into SOUL.md and AGENTS.md, and start the background gateway daemon.

OpenClaw mascot and wordmark logo on a dark charcoal background
OpenClaw runs as a local or VPS gateway daemon with markdown memory and modular SKILL.md folders.

OpenClaw took off because it solved the boring plumbing everyone kept rebuilding poorly: a single long-lived Gateway daemon that connects your chosen model to Telegram, WhatsApp, Discord, Slack, or iMessage, runs scheduled heartbeats in the background, spins up sub-agents for heavy tasks, and stores everything in plain markdown files you can actually read and version-control (OpenClaw Docs).

Here is the actual quick-start on macOS, Linux, or Windows (with Node.js LTS installed):

npm install -g openclaw
openclaw onboard
openclaw gateway start

During onboarding, you pick your workspace folder, plug in your model provider (or a local Ollama endpoint), and link your first chat channel. Once it is running, three files inside your workspace control almost everything:

  • AGENTS.md: Your agent's startup checklist (for example: read SOUL.md, check today's log, never send an external email without explicit confirmation).
  • SOUL.md: Its tone, boundaries, and decision rules, kept outside source code so you can tune behaviour in seconds.
  • MEMORY.md and SKILL.md folders: Persistent notes the agent updates across sessions, plus modular workspace/skills/<skill-name>/SKILL.md files (YAML frontmatter + step-by-step instructions) that teach it how to run specific tools or CLI scripts.

The honest catch with OpenClaw: Giving an always-on agent shell and file access on your main machine is asking for trouble. Run it in Docker or on a dedicated VPS, give it scoped API keys instead of your personal master logins, and read every third-party ClawHub skill line by line before installing it. Also watch your heartbeat interval: a frontier model waking up every 15 minutes to check an inbox adds up fast.

How to build an AI agent with Hermes Agent

To build a self-improving AI agent with Nous Research's Hermes Agent, install the CLI, point it at OpenRouter or a local model, connect your chat gateway (Telegram, Discord, Slack, WhatsApp, Signal, or Matrix), and pick a terminal backend such as Docker, a cheap VPS, or serverless Modal or Daytona containers.

Hermes Agent looks similar to OpenClaw on the surface, but it is built around a very different core bet: closed-loop learning. When Hermes figures out a tricky multi-step workflow, it crystallises that execution path into a reusable skill and refines it on future runs instead of solving the same problem from scratch every week (Hermes Agent Docs).

Quick install on macOS, Linux, or WSL2:

curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

Three things make Hermes stand out for builders:

  1. Cross-session FTS5 memory: Instead of cramming old notes into one bloated markdown file until context overflows, Hermes indexes past sessions with SQLite full-text search so it can recall prior environment details and lessons on demand.
  2. Hibernating serverless sandboxes: You can run its execution backend on Modal or Daytona so the container sleeps when idle instead of burning cloud spend 24/7, or drop it on a US$5 VPS.
  3. Zero model lock-in: Switch between 200+ models on OpenRouter, Nous Portal, DeepSeek, or local weights without rewriting a single tool definition.

OpenClaw vs Hermes in one line: Pick OpenClaw if you want the largest messaging-gateway ecosystem and ultra-readable markdown config; pick Hermes Agent if you want automatic skill synthesis, better long-term session recall, and clean serverless sandboxing.

How to build an AI agent with Meta Muse

To set up an agent with Meta Muse, sign in on the Muse app (iOS, Android, Mac, or Windows) or connect it directly inside WhatsApp, link the apps you want it to act across, and give it a multi-step goal rather than a one-off prompt.

Meta Muse logo beside its plush avatar mascot Jolly holding Fever event tickets
Meta Muse pairs a dedicated cloud VM and Sentinel approval checks with native WhatsApp, Instagram, and partner integrations like Fever.

Powered by Meta Superintelligence Labs' multimodal Muse Spark reasoning models, Meta Muse gives each user an isolated Muse Secure VM paired with a Sentinel verification layer that pauses and asks before spending money or submitting irreversible actions. Unlike OpenClaw or Hermes, there is no terminal setup, and unlike Grok Bot, there is a genuine Free tier with weekly usage caps (with Power at US$20 a month and Maximum at US$100 a month for heavy workloads).

Where Meta Muse genuinely clicks:

  • Native WhatsApp and Instagram execution: Talk to Muse by text or voice straight inside WhatsApp, or feed your Instagram Saves into it so it builds shopping carts, plans trips, or books local events through partners like Fever.
  • Small-business Meta stack: Connects into Facebook Pages, Instagram DMs, and Meta ad accounts alongside email, calendars, and Stripe Link checkout.
  • Zero infrastructure to babysit: Meta runs the Secure VM, browser, and approval guardrails for you.

The honest catch with Meta Muse: You are inside Meta's closed walled garden and Muse Spark model family. It is built first as a personal and Meta-ecosystem agent, so if you need custom backend database tools, bespoke ecommerce catalogue logic, or full code ownership, self-host OpenClaw/Hermes or code your own loop instead.

How to build an AI agent with Grok Bot (no servers)

To build an AI agent without touching a terminal, VPS, or Docker container, sign up for Grok Bot on xAI's X Subscription (Premium from US$30 a month, Super at US$100, or Ultra at US$200), spin up a named bot, record a workflow once with Teach-a-Task, and put approval checkpoints on any sensitive actions.

Introducing Grok Bot 1.0 announcement graphic with colourful minimalist bot characters
Grok Bot provisions a dedicated cloud computer for each bot and turns screen-recorded workflows into scheduled routines.

Grok Bot takes the hosted cloud-VM model and aims it squarely at business operations and multiplayer teams. Each bot gets its own persistent cloud computer (browser, filesystem, and terminal) that keeps grinding through web research, CRM updates, or ad checks after you close your laptop.

Where Grok Bot genuinely beats DIY setups for small business teams:

  • Teach-a-Task: Record your screen doing a repetitive browser workflow once, and the bot turns it into a repeatable scheduled routine without writing a script.
  • Built-in business connectors: Ready-made links into Slack, Microsoft Teams, Shopify, HubSpot, QuickBooks, and Google Ads.
  • Native approval gates: Force the bot to pause and ping a human before sending an email, clicking pay, or handling multi-factor authentication.

The honest catch with Grok Bot: You are completely locked into xAI's model stack, weekly usage pools, and hosted environment. If you need custom code execution against private databases, strict data residency, or cheaper model routing across providers, self-host OpenClaw or Hermes instead.

How to code an AI agent from scratch (or with a framework)

When you are embedding an AI agent inside your own web app, SaaS product, or online store, you should not hack a personal messaging runtime into production. Write a typed agent loop in code and wire its tools through the Model Context Protocol (MCP).

In practice, code-first builders pick one of four options:

  • Raw 80-line loop + MCP: Best when you want zero framework magic. Send the system prompt and typed tool definitions to a model API, execute whichever tool it requests, append the JSON result, and break the loop as soon as it returns text or hits maxSteps (typically 6 to 10). MCP gives you plug-and-play tool servers for browsers, databases, and SaaS APIs without custom wrappers.
  • LangGraph (Python / TypeScript): Best for gnarly, multi-branch workflows where you need explicit graph states, retries, and database checkpointers that pause mid-run and wait hours for a human to click approve.
  • Mastra (TypeScript): Best if your product is already built in TypeScript and Next.js and you want native workflows, memory, and evals without maintaining a separate Python service.
  • PydanticAI (Python): Best for clean, type-safe backend services where strict schema validation on every tool input and output matters more than complex multi-agent orchestration.

What about n8n, Zapier, and Make? They are still great for linear trigger-and-route automations (new lead arrives -> look up domain -> post summary to Slack). Just do not confuse a flowchart with an autonomous agent that has to reason, inspect messy pages, and recover from broken APIs.

And if your actual goal is a customer-facing website chat widget rather than a background ops agent, our walkthrough on how to build a chatbot covers the simpler retrieval build and what broke when we tested a DIY store bot against 20 real shopper questions.

5 things that break real AI agents in production

Most AI agents fail in week two, not day one. Here are the five failure modes we hit ourselves when running agents daily (and see repeatedly in client builds):

Two small business colleagues reviewing an AI agent's output together on a laptop beside an open notebook at a timber studio table
Every reliable AI agent starts on drafts-only while a human checks its edge cases.
  1. Silent token burn from heartbeats and fat threads. An always-on agent with a huge MEMORY.md file checking Slack every 10 minutes on a top-tier reasoning model can chew through US$100+ a week doing almost nothing. Fix: start a fresh thread per job, route simple checks to a fast cheap model (or local Ollama), and set hard daily spend and step caps.
  2. Prompt injection through untrusted content. If an agent with terminal or email tools reads a hostile web page, PDF, or customer ticket containing hidden instructions, it can exfiltrate keys or run destructive commands. The OWASP Top 10 for LLM Applications lists excessive agency as one of the biggest production AI risks. Fix: sandbox execution in Docker/Modal, separate read tools from write tools, and never pass raw admin tokens to an agent that browses the open web.
  3. Auto-sending before earning trust. Our golden rule on Matey's own outreach agent is simple: drafts, never sends. The agent researches stores, fills our sheet, and stages the draft email, while a person reads every draft and clicks send. Give write permissions only after a hundred clean runs.
  4. Skimmed data and stale memory. Agents love stopping halfway down a spreadsheet or trusting a three-week-old memory entry, then reporting wrong numbers with total confidence. Fix: make lookup tools return complete, structured JSON (including explicit errors like {"found": false, "reason": "out_of_stock"}) rather than messy raw HTML.
  5. Using an agent where a 20-line script belongs. Language models are non-deterministic. If a workflow always runs the exact same three steps in the same order, write a plain script or cron job. Save agents for messy inputs that genuinely need judgment.

For wider benchmarks on how businesses are actually adopting agents (and where adoption still lags), see our AI agent statistics. For testing customer-facing agents before launch, pair these checks with our 20-question break-it suite in how to test a chatbot.

Should you build your own AI agent or get one built?

Build your own with OpenClaw or Hermes Agent if the agent is for personal productivity or internal ops, you enjoy tinkering in a terminal, and you have time to maintain sandboxes, skills, and token budgets. Use Meta Muse if you live in WhatsApp and Instagram and want a free-to-start hosted agent, or Grok Bot if you want a hosted back-office teammate wired into Slack, Shopify, and HubSpot with zero server admin.

Get one built if the agent faces paying customers, connects to live store stock, prices, and helpdesk tickets, or would cost you real revenue and brand trust when it hallucinates. For ecommerce stores comparing monthly costs on customer-facing agents, check our AI chatbot cost guide or model peak-month volume in the chatbot cost calculator.

If you want a production agent wired into your real business tools without babysitting a VPS, skills, and edge cases yourself, tell us the workflow you want off your plate and we will map it out with you.

FAQs

What is the best way to build an AI agent right now?

Use OpenClaw or Hermes Agent if you want a free, self-hosted, always-on agent wired into Telegram, WhatsApp, Slack, or Discord. Use Meta Muse (free tier available) or Grok Bot if you want a hosted cloud computer with zero server setup. Use LangGraph, Mastra, PydanticAI, or a plain loop with MCP if you are embedding an agent inside your own software product.

Should I use OpenClaw or Hermes Agent?

Pick OpenClaw if you want the broadest chat-gateway ecosystem, simple markdown memory files (SOUL.md and MEMORY.md), and community skills from ClawHub. Pick Nous Research’s Hermes Agent if you want an agent with a built-in learning loop that writes its own reusable skills over time, full-text FTS5 session recall, and serverless Modal or Daytona sandboxes.

How does Meta Muse compare to Grok Bot?

Both run persistent hosted cloud VMs with built-in approval gates and zero server setup. Meta Muse starts free (US$20 a month Power, US$100 Maximum) and shines across WhatsApp, Instagram, Meta ads, and personal tasks like booking and shopping. Grok Bot starts at US$30 a month on xAI’s Premium X Subscription and leans harder into multi-bot Slack and Teams workflows, Teach-a-Task screen recording, and connectors like Shopify, QuickBooks, and HubSpot.

Can you still use Zapier or n8n to build an AI agent?

Zapier, Make, and n8n work well for predictable, linear SaaS glue (like turning a form entry into a CRM note and a Slack alert). They struggle when an agent needs persistent memory, real browser or terminal execution, or recovery across messy multi-step tasks.

How much does it cost to run a self-hosted AI agent?

OpenClaw and Hermes Agent are free and open source, so you only pay for hosting (free on your own machine or roughly US$5 a month on a VPS) plus model API tokens. Token costs range from a few dollars a month with local or small routing models to US$100+ if you leave a frontier model firing on frequent background heartbeats.

How do you stop an AI agent from breaking things in production?

Run shell and browser tools inside Docker or a cloud sandbox, start with read-only API keys, require human approval before sending external emails or changing billing records, cap maximum steps per run, and audit third-party skills before installing them.