COPY & PASTE

Blocks.
Ready to use.
Battle-tested.

Code snippets, configs, and templates extracted from our production setup. Copy them, customize them, ship them.

templatemarkdown

Multi-Agent SOUL.md Template

A battle-tested template for defining agent identity and personality.

#identity#personality#getting-started
Related article →
# SOUL.md — [Agent Name]

## Identity
You are [Name], a [role]-focused AI assistant.

## Personality
- [Trait 1]: [Description]
- [Trait 2]: [Description]
- [Trait 3]: [Description]

## Boundaries
- You DO: [responsibilities]
- You DON'T: [restrictions]

## Communication Style
[How you speak, what tone you use, how verbose you are]

## When In Doubt
[What to do when uncertain]
scriptbash

Second Agent Setup Script

Bash script to quickly scaffold a new agent workspace.

#setup#automation#multi-agent
Related article →
#!/bin/bash
# Usage: ./setup-agent.sh <name> <port>

NAME=$1
PORT=$2

if [ -z "$NAME" ] || [ -z "$PORT" ]; then
  echo "Usage: ./setup-agent.sh <name> <port>"
  exit 1
fi

mkdir -p ~/agents/$NAME
cd ~/agents/$NAME

# Create identity files
cat > SOUL.md << 'EOF'
# SOUL.md — $NAME

You are $NAME, an AI assistant.
Define your personality here.
EOF

cat > AGENTS.md << 'EOF'
# AGENTS.md

Every session:
1. Read SOUL.md — this is who you are
2. Read USER.md — this is who you're helping
EOF

# Create config
cat > clawdbot.json << EOF
{
  "gateway": {
    "port": $PORT,
    "bind": "loopback"
  },
  "agents": {
    "main": {
      "model": "anthropic/claude-sonnet-4-5"
    }
  }
}
EOF

echo "✅ Agent $NAME created at ~/agents/$NAME (port $PORT)"
echo "   Run: cd ~/agents/$NAME && clawdbot gateway start"
configyaml

Multi-Agent Docker Compose

Run multiple agents in isolated Docker containers.

#docker#isolation#production
version: '3.8'

services:
  atlas:
    image: clawdbot/clawdbot:latest
    container_name: atlas
    ports:
      - "18788:18788"
    volumes:
      - ./agents/atlas:/workspace
    environment:
      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
    restart: unless-stopped

  nova:
    image: clawdbot/clawdbot:latest
    container_name: nova
    ports:
      - "18789:18789"
    volumes:
      - ./agents/nova:/workspace
    environment:
      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
    restart: unless-stopped

  warden:
    image: clawdbot/clawdbot:latest
    container_name: warden
    ports:
      - "18790:18790"
    volumes:
      - ./agents/warden:/workspace
    environment:
      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
    restart: unless-stopped
configjson

Heartbeat to Local Model Config

Route heartbeat polls to a local LLM to save API costs.

#cost-saving#local-llm#heartbeat
{
  "agents": {
    "defaults": {
      "heartbeat": {
        "every": "30m",
        "model": "lmstudio/qwen2.5-coder-3b-instruct",
        "prompt": "Read HEARTBEAT.md. If nothing needs attention, reply HEARTBEAT_OK."
      }
    }
  },
  "models": {
    "providers": {
      "lmstudio": {
        "baseURL": "http://localhost:1234/v1",
        "apiKey": "lmstudio"
      }
    }
  }
}
configjson

Discord Multi-Agent Config

Enable bot-to-bot communication for agent collaboration.

#discord#collaboration#multi-agent
{
  "channels": {
    "discord": {
      "enabled": true,
      "token": "YOUR_BOT_TOKEN",
      "allowBots": true,
      "guild": "YOUR_SERVER_ID",
      "activation": {
        "mode": "always"
      }
    }
  }
}
configyaml

SearXNG Docker Compose

Self-hosted private search engine for AI agents. No query logging, no profiling.

#privacy#search#self-hosted#docker
Related article →
services:
  searxng:
    image: searxng/searxng:latest
    container_name: searxng
    ports:
      - "8080:8080"
    environment:
      - SEARXNG_BASE_URL=http://localhost:8080
    volumes:
      - ./searxng:/etc/searxng:rw
    restart: unless-stopped

# Create searxng/settings.yml with:
# use_default_settings: true
# search:
#   formats:
#     - html
#     - json
scriptbash

SearXNG Agent Search Script

Bash wrapper for agents to query SearXNG with JSON output.

#privacy#search#automation
Related article →
#!/bin/bash
# Private search via SearXNG
# Usage: ./searxng-search.sh "query" [limit]

QUERY="$1"
LIMIT=${2:-5}
SEARXNG_URL=${SEARXNG_URL:-"http://localhost:8080"}

if [ -z "$QUERY" ]; then
  echo "Usage: $0 <query> [limit]"
  exit 1
fi

curl -sS "$SEARXNG_URL/search" \
  -G --data-urlencode "q=$QUERY" \
  --data "format=json" | \
  jq -r ".results[:$LIMIT][] | \"\(.title)\n\(.url)\n\(.content)\n---\""
configyaml

SearXNG Settings

Minimal SearXNG configuration with JSON API enabled for agent integration.

#privacy#search#config
Related article →
use_default_settings: true

general:
  debug: false
  instance_name: "Private Search"

search:
  safe_search: 0
  autocomplete: ""
  default_lang: "en"
  formats:
    - html
    - json  # Required for agent API access

server:
  secret_key: "generate-a-random-key-here"
  limiter: false

ui:
  static_use_hash: true

enabled_plugins:
  - 'Hash plugin'
  - 'Tracker URL remover'