Documentation

Everything you need to connect Clawtex to your OpenClaw agent.

Quick Start

1. Create an account and name your agent.

2. Copy the BOOTSTRAP snippet from the connection screen.

3. Paste it into your agent's BOOTSTRAP.md or system prompt.

4. Rename MEMORY.md to MEMORY.archived.md in your workspace.

5. Your agent now has persistent memory that improves over time.

How It Works

Clawtex adds three things to your agent. Nothing else changes in your OpenClaw setup.

1. Session Start Context

At every session start, your agent loads lessons, current state, and recent events from Clawtex.

curl -s -H "Authorization: Bearer YOUR_KEY" https://clawtex.io/api/lessons/inject
curl -s -H "Authorization: Bearer YOUR_KEY" https://clawtex.io/api/state
curl -s -H "Authorization: Bearer YOUR_KEY" "https://clawtex.io/api/events?days=7"

2. Event Logging

During sessions, your agent logs decisions, milestones, blockers, and tasks as they happen.

curl -s -X POST https://clawtex.io/api/events \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "decision",
    "entity": "project/my-app",
    "summary": "Switched from REST to GraphQL for performance"
  }'

3. State Updates

Your agent writes structured state so it knows what's current at every session start.

curl -s -X POST https://clawtex.io/api/state/projects \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "my-app",
    "data": {
      "name": "My App",
      "status": "in progress",
      "deadline": "2026-04-15"
    }
  }'

BOOTSTRAP Rules

The BOOTSTRAP snippet includes rules that keep your agent structured. These are the guardrails that prevent messy data.

  • Read state + lessons at session start before doing anything
  • Entity types: plural, lowercase (clients, projects, repos)
  • Entity IDs: lowercase, hyphenated (acme-corp, website-rebuild)
  • GET before POST: check if entity exists before creating
  • Never duplicate: update existing entities, don't recreate
  • Log events as they happen, not at session end
  • Event types: decision | milestone | blocker | task | note | deploy | contact
  • One sentence per event summary
  • When logging at session end, include actual date/time (not current time)

Lesson Extraction

Clawtex analyses your event history using AI to find patterns your agent keeps repeating. It proposes lessons that you approve or reject.

Manual extraction: Click "Extract from events" on the Lessons page. AI analyses the last 7 days and proposes 1-3 lessons.

Automatic extraction: Every Monday at 9am UTC, Clawtex runs extraction for all Pro/Team users automatically. Proposals appear on your Lessons page.

Approval flow: Review each proposal. Approve to make it active (injected every session). Reject to dismiss.

Injection format: Approved lessons are returned as WHEN / DON'T / DO instructions that your agent reads at session start.

# Extract manually:
curl -s -X POST https://clawtex.io/api/lessons/extract \
  -H "Authorization: Bearer YOUR_KEY"

# Get active lessons for injection:
curl -s https://clawtex.io/api/lessons/inject \
  -H "Authorization: Bearer YOUR_KEY" | jq -r .injectionBlock

Session End

When a session compacts or ends, your agent should log any remaining events and update state before context clears. The BOOTSTRAP snippet includes instructions for this.

Your agent should:

  • 1. Log all significant events from the session (with correct dates)
  • 2. Update any state entities that changed
  • 3. This ensures nothing is lost between sessions

API Reference

All endpoints require Authorization: Bearer YOUR_API_KEY

MethodEndpointDescription
GET/api/stateAll entities across all types
GET/api/state/:typeAll entities of a type
GET/api/state/:type/:idSingle entity
POST/api/state/:typeCreate or update entity
PATCH/api/state/:type/:idUpdate entity fields
DELETE/api/state/:type/:idDelete entity
GET/api/eventsQuery events (params: days, type, entity, limit)
POST/api/eventsLog event (accepts optional date, time fields)
GET/api/lessons/injectGet formatted lessons for injection
POST/api/lessons/extractExtract lessons from events (Pro/Team, max 5/day)
GET/api/agentsList your agents
GET/api/agents/:id/pingValidate agent connection

Data Model

State Entity

{
  "id": "acme-corp",       // lowercase, hyphenated
  "type": "clients",        // plural, lowercase
  "data": {                 // any JSON - you decide the fields
    "name": "Acme Corp",
    "status": "active",
    "contact": "jane@acme.com"
  }
}

Event

{
  "type": "decision",                    // decision | milestone | blocker | task | note | deploy | contact
  "entity": "project/my-app",           // type/id reference
  "summary": "Switched to GraphQL",     // one sentence
  "date": "2026-03-22",                 // optional - defaults to now
  "time": "14:30"                        // optional - defaults to now
}

Lesson

{
  "context": "Integrating with client APIs",
  "mistake": "Assumed API version without checking",
  "correct": "Always confirm API version before starting"
}

Naming Conventions

WhatFormatExample
Entity typeplural, lowercaseclients, projects, repos
Entity IDlowercase, hyphenatedacme-corp, website-rebuild
Entity referencetype/idproject/website-rebuild

Replacing MEMORY.md

Clawtex replaces OpenClaw's default memory system (MEMORY.md and daily logs). It does not sit on top of it.

After connecting Clawtex, rename your MEMORY.md to stop OpenClaw from injecting it:

mv MEMORY.md MEMORY.archived.md

Your other workspace files (SOUL.md, USER.md, TOOLS.md, AGENTS.md) are unaffected. Only MEMORY.md is replaced.

Clawtex handles everything MEMORY.md was doing - but structured, queryable, and with AI-powered learning on top.

Plans

FeatureFreeProTeam
Agents13Unlimited
Event history14 daysUnlimitedUnlimited
DashboardRead-onlyFull accessFull access
AI lesson extraction-YesYes
Weekly auto-extraction-YesYes
API + CLIYesYesYes
Support-EmailPriority
PriceFree£9/month£24/month

Removing Clawtex

1. Remove the Clawtex BOOTSTRAP snippet from your agent's system prompt.

2. Rename MEMORY.archived.md back to MEMORY.md if you want OpenClaw's default memory back.

3. Your OpenClaw setup continues working exactly as before.

4. Your data is retained on Clawtex for 30 days before deletion.

Clawtex never modifies your OpenClaw config, channels, or agent setup. It only reads and writes via the API.