OpenClaw Integration

OpenClaw is a popular open-source multi-agent framework (formerly MoltBot/ClawdBot). Snipara provides first-class integration via the snipara-openclaw npm package, adding multi-agent swarm coordination, context optimization, safe Python execution, and persistent semantic memory.

One-Command Install

npx snipara-openclaw-install

This configures memory plugin, swarm skill, context skill, and execution skill automatically.

What You Get

Multi-Agent Swarms

Coordinate multiple agents with resource claims, distributed task queues, and shared state.

  • Distributed resource locks
  • Task queue with dependencies
  • Optimistic locking state
  • Event broadcasting

Context Optimization

Semantic search over project documentation with token budgeting. 500K codebase → 4K relevant context.

  • Hybrid search (keyword + semantic)
  • Query decomposition
  • Execution planning
  • Token budgeting

Safe Code Execution

Execute Python code in Docker-isolated sandbox via RLM-Runtime. Test code safely without risk.

  • Docker isolation
  • Session persistence
  • Execution profiles (5s-300s)
  • Autonomous agent runs

Persistent Memory

Replace MEMORY.md with semantic memory. TTL-based expiration, relevance scoring, cross-session.

  • 6 memory types (fact, decision, etc.)
  • Semantic recall
  • Configurable TTL
  • Cross-session persistence

Quick Start

Option A: One-Command Install (Recommended)

npx snipara-openclaw-install

The installer will:

  1. Detect your OpenClaw installation (~/.openclaw/)
  2. Prompt for your Snipara API key (or open signup)
  3. Configure all three skills automatically
  4. Test the connection
  5. Show next steps

Option B: Manual Installation

npm install snipara-openclaw

Then configure ~/.openclaw/openclaw.json:

{
  "memory": {
    "provider": "snipara-openclaw/memory-plugin",
    "config": {
      "apiKey": "rlm_your_key_here",
      "projectSlug": "your-project"
    }
  },
  "skills": {
    "snipara-swarm": { "enabled": true },
    "snipara-context": { "enabled": true },
    "snipara-execution": { "enabled": true }
  }
}

Automation Hooks

Shared memory for multi-agent teams. These hooks add value when multiple agents share the same Snipara project — learnings from one agent benefit the whole team.

Solo Agent?

OpenClaw's native memory system (MEMORY.md, session-memory) handles context well for solo agents. Only install snipara-persist and snipara-stop — the other hooks add overhead without benefit.

npx snipara-openclaw-hooks install snipara-persist snipara-stop

Multi-Agent Team?

Install all hooks. Shared context, team standards, and cross-agent learnings benefit everyone.

npx snipara-openclaw-hooks install

Core Hooks (Solo or Team)

HookEventDescription
snipara-persisttool_result_persistAuto-captures commits, test results, errors as memories
snipara-stopcommand:stopSaves final session context before agent stops

Team Hooks (Multi-Agent)

HookEventDescription
snipara-startupgateway:startupRestores shared memories and team standards
snipara-sessioncommand:newSaves/recalls context across agents
snipara-bootstrapagent:bootstrapInjects project docs and team coding standards

Configuration

Add your Snipara credentials to ~/.openclaw/openclaw.json:

{
  "env": {
    "SNIPARA_API_KEY": "rlm_your_key_here",
    "SNIPARA_PROJECT_SLUG": "your-project"
  }
}

CLI Commands

# Solo agent — recommended
npx snipara-openclaw-hooks install snipara-persist snipara-stop
# Multi-agent team — all hooks
npx snipara-openclaw-hooks install
# List available hooks
npx snipara-openclaw-hooks list
# Check installation status
npx snipara-openclaw-hooks status
# Uninstall all hooks
npx snipara-openclaw-hooks uninstall --all

Swarm Coordination

Coordinate multiple agents working on the same codebase. The swarm skill provides 12 tools for distributed coordination.

Creating a Swarm

// Create a swarm for a code review task
const swarm = await swarm_create(ctx, {
  name: "pr-review-123",
  description: "Code review for PR #123",
  maxAgents: 5
});

Resource Claims (Prevent Conflicts)

// Claim exclusive access to a file
await claim_resource(ctx, {
  swarmId: swarm.swarmId,
  agentId: "reviewer-1",
  resourceType: "file",
  resourceId: "src/auth.ts",
  timeoutSeconds: 300
});

No More Merge Conflicts

When two agents try to edit the same file, the second agent's claim will fail until the first agent releases the resource. This prevents merge conflicts and ensures orderly file access.

Task Queue with Dependencies

// Create tasks with dependencies
await task_create(ctx, {
  swarmId, agentId: "coordinator",
  title: "Run test suite",
  dependsOn: ["review-auth", "review-api"]
});
// Task won't be claimable until dependencies complete

Context Optimization

Query your project documentation with semantic search and token budgeting.

const context = await context_query(ctx, {
  query: "How does authentication work?",
  maxTokens: 4000,
  searchMode: "hybrid"
});
// Returns ranked, relevant sections within token budget

Safe Code Execution

Execute Python code in a Docker-isolated sandbox via RLM-Runtime.

const result = await execute_python(ctx, {
  code: `def fib(n): return n if n <= 1 else fib(n-1) + fib(n-2)
print([fib(i) for i in range(10)])`,
  profile: "default"  // quick(5s) | default(30s) | analysis(120s) | extended(300s)
});
// [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]

Persistent Memory

Replace OpenClaw's file-based MEMORY.md with semantic memory that persists across sessions.

// Store a memory
await remember(ctx, {
  content: "User prefers functional components",
  type: "preference",
  ttlDays: 90
});
// Recall relevant memories
const memories = await recall(ctx, {
  query: "user preferences for React"
});
Memory TypeUse CaseDefault TTL
factDiscovered truths30 days
decisionArchitectural choices30 days
learningLessons learned14 days
preferenceUser preferences90 days
todoTasks to complete7 days
contextSession state7 days

All Available Tools

SkillTools
Swarm (12 tools)swarm_create, swarm_join, claim_resource, release_resource, get_state, set_state, broadcast, task_create, task_claim, task_complete, remember, recall
Context (8 tools)context_query, upload_document, search, decompose, plan, multi_query, sections, stats
Execution (4 tools)execute_python, agent_run, agent_status, agent_cancel

Get Your API Key

  1. Visit snipara.com/dashboard
  2. Create or select a project
  3. Go to Settings → API Keys
  4. Generate a new key (starts with rlm_)

Resources

Next Steps