SwarmClaw Documentation

repository·main·Indexed 20 days ago

https://github.com/swarmclawai/swarmclaw

An open-source, self-hosted AI agent runtime and multi-agent framework for orchestrating autonomous agent swarms. SwarmClaw supports 23+ LLM providers, durable memory, MCP tools, delegation, and scheduling. It features integration with OpenClaw, SwarmDock marketplace for task bidding and USDC payments, and SwarmFeed social network. The platform provides a desktop app, CLI, and Docker support, offering capabilities for structured execution, hybrid recall memory, and multi-platform connectors including Discord, Slack, and Telegram.

Tokens
61.6K
Snippets
213
Records
311
Agent score
69%

What's inside SwarmClaw

  1. Use the Browser Tool for web interaction

    main

    The Browser Tool allows you to control a headless browser to interact with web pages. You can navigate to URLs, click elements, type into inputs, take screenshots, extract text, scroll, and wait for specific conditions. The browser session persists across tool calls within the same agent turn, meaning cookies and session state (like logins) are maintained.

    /* The Browser Tool uses a JSON-based action interface */
  2. Core Capabilities of SwarmClaw

    main

    SwarmClaw is an orchestration and autonomy platform for AI agents. Its core capabilities include:

    • Providers: Supports 24+ built-in providers including Claude Code, Gemini, OpenAI, Anthropic, Groq, Ollama, and OpenRouter. It also supports custom endpoints via OpenAI-compatible APIs (e.g., Hermes Agent).
    • Delegation & Autonomy: Built-in delegation to various CLIs (Claude Code, Codex, etc.) and native subagents. Supports heartbeat loops, schedules, background jobs, and supervisor recovery.
    • Orchestration: Durable structured execution featuring branching, loops, parallel branches, and explicit joins. Supports structured sessions with templates and transcripts.
    • Memory: Hybrid recall using graph traversal, journaling, and automatic reflection memory.
    • Wallets: Linked Base, Solana, and Ethereum wallet generation and management for agent payouts and signing.
    • Connectors: Integration with Discord, Slack, Telegram, WhatsApp, Teams, Matrix, email, and more.
    • MCP Servers: Ability to connect any Model Context Protocol server (stdio, SSE, or HTTP) and inject its tools into agents.
    • Extensions: Support for external tool extensions, UI modules, and managed resource manifests.
  3. Use the Files Tool for filesystem operations

    main
    The Files Tool allows for precise operations on the real filesystem within a workspace. It supports reading, writing, editing, listing, and searching files. Use this tool when you need to interact with specific files or search the codebase for patterns. For complex text processing (like awk or sed) or running scripts, use the execute tool instead.
  4. Use the Skills Tool to discover and load documentation

    main
    The Skills Tool allows you to discover and load skill files (.md) that provide instructions on how to use specific tools, APIs, and workflows. Skills are read-only reference materials used to understand parameters, patterns, and best practices before performing complex operations. They do not execute code themselves.
  5. The 6 Primitive Tools in SwarmClaw

    main

    Every SwarmClaw agent has access to six core primitive tools that cover the full range of agent capabilities. Use these tools to interact with the filesystem, run commands, manage memory, coordinate tasks, browse the web, or learn new workflows.

    ToolPurposeWhen to Use
    filesRead, write, edit, list, search filesAny file operation on the workspace filesystem
    executeRun bash scripts (sandboxed or host)Shell commands, curl, data processing, package management
    memoryStore and retrieve persistent knowledgeFacts, preferences, decisions that should survive across sessions
    platformTasks, communication, delegation, projectsCoordinating with humans and other agents
    browserControl a headless browserInteractive web pages, JavaScript-rendered content
    skillsDiscover and load skill documentationLearning how to use tools, APIs, or workflows
  6. Best practices and error handling for Google Workspace automation

    main

    To ensure reliable automation with the google-workspace skill, follow these operational rules:

    Operational Rules

    1. Read before Write: Always start with read, list, or get commands to verify state before attempting mutations.
    2. Verify IDs: Explicitly confirm IDs (document, spreadsheet, file, message, calendar, or space IDs) before acting.
    3. Machine-Readable Output: Prefer JSON output and parse it rather than attempting to scrape human-readable text.
    4. Scope Management: For large lists, apply filters or limit the scope (e.g., pageSize) before attempting to paginate.

    Troubleshooting

    • Missing gws binary: Instruct the user to install the Google Workspace CLI.
    • Authentication errors: If auth is missing or expired, instruct the user to configure plugin settings or perform a manual terminal login for gws.
    • Missing IDs: If a command fails due to a missing ID, use a list or search command first to discover the correct identifier.
  7. Configure background model routing for dreams and compaction

    main

    You can override global dream settings on a per-agent basis using dreamConfig. This allows you to route memory dream cycles and daily digests to a specific dreamProvider (e.g., a smaller local model) to save costs or latency.

    Additionally, you can use compactionProvider settings to route live auto-compaction summaries through a different, potentially cheaper or faster model.

  8. Anatomy of a Skill directory

    main

    A skill is organized as a directory named after the skill (in hyphen-case). The structure is as follows:

    skill-name/
    ├── SKILL.md (required)
    │   ├── YAML frontmatter (name + description, required)
    │   └── Markdown instructions (required)
    └── Bundled Resources (optional)
        ├── scripts/      — Executable code (Python/Bash/etc.) for deterministic tasks.
        ├── references/   — Documentation loaded into context as needed (e.g., schemas, manuals).
        └── assets/       — Files used in output but not loaded into context (e.g., templates, icons).

    Frontmatter Requirements

    In SKILL.md, the YAML frontmatter must include:

    • name: The skill name (lowercase, hyphen-case).
    • description: The primary triggering mechanism. It must include what the skill does AND when to use it. All 'when to use' information belongs in the description, not the Markdown body.
    name: my-skill-name
    description: Performs X task. Use this skill when the user asks to Y or needs to Z.
  9. Manage reflection memory quality and deduplication

    main

    SwarmClaw provides controls for automatic reflection memory writes:

    • reflectionMinQuality: A threshold that gates automatic reflection memory writes; if the quality is too low, the record is not written.
    • Embedding Deduplication: If embeddings are configured, SwarmClaw can skip writing near-duplicate reflection notes to prevent redundant memory entries.
  10. Delegate tasks and use Connectors

    main

    Delegation

    Agents can route work to other agents using the platform tool:

    • delegate: Route a task to a specific agent and wait for the result.
    • spawn: Create an independent subagent (fire-and-forget or session-based).
    • Use agents.list to discover available agents and their specializations.

    Connectors

    Agents communicate with external platforms (Discord, Slack, Telegram, or custom webhooks) via the platform tool using the communicate.send_message action. Inbound messages from these connectors automatically trigger agent sessions.

  11. Understand the File Access Policy

    main

    Access is governed by the agent's scope:

    • Workspace-scoped agents: Can only access files within the workspace directory.
    • Machine-scoped agents: Can access the broader filesystem, subject to blocked path rules.

    Path Resolution:

    • Paths like /workspace/src/... are automatically resolved to the workspace root.
    • Path traversal (e.g., ../) attempting to exit the allowed scope is blocked.
    • File paths are relative to the workspace root by default.
  12. What are SwarmClaw Skills?

    main

    Skills are modular, self-contained packages that extend SwarmClaw agent capabilities by providing specialized knowledge, workflows, and tools. They transform a general-purpose agent into a specialized one by providing:

    1. Specialized workflows: Multi-step procedures for specific domains.
    2. Tool integrations: Instructions for working with specific file formats or APIs.
    3. Domain expertise: Company-specific knowledge, schemas, and business logic.
    4. Bundled resources: Scripts, references, and assets for complex tasks.

    Skills follow a Progressive Disclosure model to manage context window usage:

    • Metadata (name + description): Always in context.
    • SKILL.md body: Loaded when the skill triggers.
    • Bundled resources: Loaded as needed (e.g., executing a script without reading its full text into context).