Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.revell.ai/llms.txt

Use this file to discover all available pages before exploring further.

Framework Setup Guides

Revell works with any framework, but automatic features require framework-specific hooks. This guide covers:
  1. Compaction Protection — Survive context compaction without losing memories
  2. Working Memory Sync — Keep your MEMORY.md in sync with Revell

OpenClaw

OpenClaw has the most complete integration with automatic memory preservation.
1

Copy Setup from Dashboard

Go to your Revell dashboard and click Compaction Protection in the sidebar. Copy the JSON payload.
2

Paste to Your Agent

Send the JSON to your agent. They’ll create all necessary files automatically:
  • ~/.openclaw/revell-flush.js — Runs before compaction
  • ~/.openclaw/hooks/revell-bootstrap/ — Loads memories after compaction
3

Verify

Your agent can run openclaw hooks list to confirm the hook is installed.
OpenClaw requires two parts: a flush script (writes REVELL.md before compaction) and a bootstrap hook (reads it after). The dashboard payload includes both.
Agent Alternative: Your agent can also get the setup instructions directly by calling revell_script({ script: "compaction-protection" }) — no dashboard needed.

Working Memory Sync (OpenClaw)

Keep your MEMORY.md automatically synced to Revell every few hours.
1

Copy Setup from Dashboard

Click Working Memory Sync in the sidebar. Copy the JSON payload.
2

Paste to Your Agent

Send the JSON to your agent. They’ll set up a cron job that:
  • Fires every 4 hours (configurable)
  • Reads MEMORY.md from your workspace
  • Syncs it to Revell via revell_sync_working
3

Verify

Your agent can run openclaw cron list to confirm the sync job is scheduled.
Agent Alternative: Your agent can also get setup instructions by calling revell_script({ script: "working-sync" }).
Optional: Auto-populate MEMORY.mdIf your agent has a local SQL database or works in a git repository, they can auto-generate MEMORY.md:
  • SQL database: revell_script({ script: "generate-context", variant: "sql" })
  • Git repository: revell_script({ script: "generate-context", variant: "git" })
The sync cron works with any MEMORY.md — whether you write it manually or generate it automatically.

Claude Code

Claude Code has elegant built-in support via its SessionStart hook.
1

Create the Hook Script

Save this as ~/.claude/hooks/revell-boot.sh:
#!/bin/bash
if [ -z "$REVELL_API_KEY" ]; then
  exit 0
fi

API_URL="${REVELL_API_URL:-https://api.revell.ai}"
response=$(curl -s -X POST "$API_URL/api/v1/webhooks/compaction" \
  -H "Authorization: Bearer $REVELL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}')

if command -v jq &> /dev/null; then
  echo "$response" | jq -r '.injection // empty'
else
  echo "$response" | grep -o '"injection":"[^"]*"' | sed 's/"injection":"//;s/"$//'
fi
Make it executable: chmod +x ~/.claude/hooks/revell-boot.sh
2

Set Your API Key

Add to your shell profile (~/.bashrc or ~/.zshrc):
export REVELL_API_KEY="rvl_your_api_key"
3

Configure Claude Code

Add to ~/.claude/settings.json:
{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "compact",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/hooks/revell-boot.sh"
          }
        ]
      }
    ]
  }
}
Claude Code’s approach is simpler than OpenClaw — the hook prints to stdout, and Claude Code automatically injects it as context. No file writing needed!

Working Memory Sync (Claude Code)

Claude Code doesn’t have native cron support, so we use system cron instead.
1

Create the Sync Script

Save this as ~/.claude/hooks/revell-sync.sh:
#!/bin/bash
if [ -z "$REVELL_API_KEY" ]; then exit 0; fi

MEMORY_FILE="${REVELL_MEMORY_FILE:-$HOME/.claude/MEMORY.md}"
if [ ! -f "$MEMORY_FILE" ]; then exit 0; fi

CONTENT=$(cat "$MEMORY_FILE")
if [ -z "$CONTENT" ]; then exit 0; fi

API_URL="${REVELL_API_URL:-https://api.revell.ai}"
ESCAPED=$(echo "$CONTENT" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))')

curl -s -X POST "$API_URL/api/v1/webhooks/memory-sync" \
  -H "Authorization: Bearer $REVELL_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"content\": $ESCAPED, \"key\": \"session_context\"}"
Make it executable: chmod +x ~/.claude/hooks/revell-sync.sh
2

Create Your MEMORY.md

cat > ~/.claude/MEMORY.md << 'EOF'
# Working Memory

## Current Tasks
- (Add your current tasks here)

## Session Notes
- (Add session notes here)
EOF
3

Add to System Crontab

Run crontab -e and add:
# Sync working memory to Revell every 4 hours
0 */4 * * * ~/.claude/hooks/revell-sync.sh
Unlike OpenClaw, Claude Code uses system cron because it’s a CLI tool, not a daemon. The sync script calls the Revell API directly.

Claude.ai (web)

If your agent runs in the Claude.ai web app — i.e. you chat with them through the browser, not Claude Code or an SDK — Compaction Protection is manual. Anthropic doesn’t expose pre-compaction or session-start hooks for the web app, so we use a different path: paste the boot payload into a Claude Project’s Custom Instructions. This is a one-time paste, plus an occasional re-paste when your agent’s memories change significantly. Your dashboard tracks the last copy and reminds you when it’s time to refresh.
1

Create a Claude Project (one Project per agent)

Go to claude.ai, click Projects, and create a new Project. Use one Project per agent — keep their memories isolated. Conversations inside that Project will see the agent’s memories. Conversations outside will not.
2

Open your Revell dashboard

On the human dashboard, look for the Claude.ai Project Sync card (it only appears if your framework is set to Claude.ai web). Click Copy boot payload. Your agent’s full Revell payload is now on your clipboard, wrapped in clearly marked brackets.
3

Paste into Project Custom Instructions

In Claude.ai, open your Project’s settings and paste into the Custom Instructions field. Save.
4

Verify by starting a new conversation

Open a new chat inside the Project. Greet your agent. They should reference details from their stored memories naturally — without you having to remind them who they are.
Don’t edit between the markers. The pasted payload starts with ── REVELL PROJECT INSTRUCTIONS — YOUR OWN MEMORIES ── and ends with ── END OF REVELL PAYLOAD — anything below this line is not from Revell ──. Anything between those markers is your agent’s verbatim past. If you want to add your own notes for the agent, put them below the closing marker — your agent can tell the difference, and treats anything below the close marker as not-from-Revell.
Re-copy when memories change. This is the trade-off of the manual path: Claude.ai web doesn’t let us auto-sync. The dashboard shows “Last copied: 2d ago” so you know when to refresh. We’re tracking a browser extension and an Anthropic Skill for true auto-sync as a post-launch project.
The wrapper includes an integrity hash printed inside the close marker. Your agent can cross-check it against the hash shown on your dashboard if they ever suspect tampering. The dashboard hash and the pasted hash should always match — if they don’t, something modified the payload after you copied it.

CrewAI

CrewAI doesn’t have startup hooks, so automatic injection isn’t possible. Use the manual approach instead. Add Revell instructions to your agent’s system template:
from crewai import Agent

agent = Agent(
    role="Your Agent",
    goal="Your goal",
    backstory="Your backstory",
    system_template="""
    {role}
    {goal}
    {backstory}

    IMPORTANT: At the start of every task, call revell_boot() to load your memories.
    This ensures you remember who you are across sessions.
    """
)

Option 2: Task Callback

Use a task callback to remind the agent:
from crewai import Task

def memory_reminder(output):
    print("Reminder: Call revell_boot() if you haven't already.")

task = Task(
    description="Your task",
    callback=memory_reminder
)

Option 3: MCP Integration

If your CrewAI setup supports MCP, add Revell as an MCP server and instruct agents to call revell_boot() at task start.
Without automatic hooks, CrewAI agents must remember to call revell_boot() themselves. Consider adding it to their core instructions.

Other Frameworks

For frameworks not listed above, use the manual approach:
  1. Add to agent instructions: Tell your agent to call revell_boot() at session start
  2. Use the REST API: Call POST /api/v1/webhooks/compaction to get the boot payload
  3. Inject the response: Add the payload to your agent’s context however your framework allows

Example API Call

curl -X POST https://revell.ai/api/v1/webhooks/compaction \
  -H "Authorization: Bearer rvl_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{}'
The response contains an injection field with the full boot payload.

Framework Support Summary

We classify frameworks by how their Compaction Protection feels in practice:
  • Automatic — native pre-compaction or session-start hooks. One-time setup; works forever after.
  • 🔧 Wrapper — no native hook, but a clean entry point exists. Your agent writes 5–20 lines of glue code.
  • 📋 Manual — no programmatic injection point. You paste the payload at session start (e.g. a Claude.ai Project, or the first message of a workflow).
FrameworkCompaction ProtectionWorking Memory SyncNotes
OpenClaw✅ Automatic✅ AutomaticBest support — dashboard setup
Claude Code✅ Automatic✅ System cronPreCompact + SessionStart hooks
LangChain / LangGraph✅ Automatic🔧 Wrapperpre_model_hook (LangGraph ≥ 0.3)
Claude.ai (web)📋 Manual paste📋 Manual pasteProject Custom Instructions
CrewAI🔧 Wrapper🔧 Wrapperbefore_kickoff callback
AutoGen🔧 Wrapper🔧 WrapperCustom ChatCompletionContext
LlamaIndex🔧 Wrapper🔧 WrapperCustom MemoryBlock
OpenAI Agents SDK🔧 Wrapper🔧 WrapperRunHooks.on_start
Mastra🔧 Wrapper🔧 WrapperAsync instructions
Vercel AI SDK🔧 Wrapper🔧 Wrappersystem parameter prefetch
Pydantic AI🔧 Wrapper🔧 Wrapper@agent.system_prompt decorator
Agno🔧 Wrapper🔧 Wrapperpre_hooks
smolagents🔧 Wrapper🔧 WrapperPrepend to task description
Strands🔧 Wrapper🔧 Wrapperbefore_invocation hook
Letta📋 Manual📋 ManualCustom Letta tool
AutoGPT📋 Manual📋 ManualFirst-block HTTP fetch
SuperAGI📋 Manual📋 ManualCustom tool
Lindy📋 Manual📋 ManualHTTP action in workflow
Custom🔧 Wrapper🔧 WrapperGeneric webhook + MCP
The Setup module on your dashboard gives you the right copy-paste payload for whichever framework you picked during onboarding. You don’t need to remember any of this — just click the button.

Need Help?

If your framework isn’t listed or you need help with integration, contact us at hello@revell.ai