OpenClaw

Persistent cross-session memory for OpenClaw. Replaces MEMORY.md with a structured knowledge graph that actually scales.

Why Waystone + OpenClaw

OpenClaw's built-in MEMORY.md convention is a flat file that grows without bound — it gets stuffed into every session regardless of relevance, becomes expensive and noisy as it grows, and eventually gets truncated. Waystone replaces it with a graph-based memory store:

  • Retrieves only what's relevant to the current task — not everything you've ever noted
  • Scales to thousands of facts without context bloat
  • Retires superseded facts automatically — no manual cleanup when decisions change
  • Persists across projects with full export/import portability

Token savings compared to a naive MEMORY.md approach: typically 60–80% fewer context tokens per session on a well-established project — exact savings depend on project age and query specificity. Waystone's benchmark data is available under benchmarks/ in the repo.

1. Install Waystone

# CLI in early access — request at unbidden.ai

Verify the install:

waystone --version

2. Add to openclaw.json

In your OpenClaw config file (openclaw.json), add an mcpServers block:

{
  "mcpServers": {
    "waystone": {
      "command": "waystone",
      "args": ["mcp-serve"],
      "env": {
        "WAYSTONE_PROJECT": "my-project"
      }
    }
  }
}

Replace my-project with the name you want for this project's memory store. Waystone will create it automatically the first time it's accessed.

Restart OpenClaw. You should see waystone_query, waystone_extract, waystone_stats, and waystone_list_projects in the available tools.

3. Update your agent instructions

Replace your existing MEMORY.md instructions in your OpenClaw system prompt or config with:

## Memory (Waystone)
At the start of each session, call waystone_query with a brief description of
the current task. This retrieves relevant decisions, constraints, and context
from prior sessions — only what's relevant, not everything.

After completing significant work or at the end of a session, call
waystone_extract with a summary of what was built, decided, or changed.
Waystone will structure and store the facts automatically.

Do not write to MEMORY.md. Use waystone_query and waystone_extract instead.

4. Migrate existing MEMORY.md (optional)

If you have an existing MEMORY.md, import it into Waystone before your next session:

waystone init my-project
waystone extract my-project MEMORY.md

Waystone will parse the file, extract structured facts, and merge them into the project graph. After this, you can leave MEMORY.md in place as a historical artifact or delete it — Waystone won't touch it either way.

To verify the import worked:

waystone show my-project

How it works in practice

Once configured, your OpenClaw sessions follow this pattern automatically:

  1. Session start: OpenClaw calls waystone_query with the task description. Waystone returns the 10–25 most relevant facts from the project's history.
  2. During the session: You work normally. OpenClaw may call waystone_query again as the task evolves.
  3. Session end: OpenClaw calls waystone_extract with a summary. Waystone extracts structured facts, detects which supersede prior decisions, and updates the graph.

The graph grows across sessions. Each session starts with a sharp, relevant slice of accumulated project memory rather than a flat growing file.

Hosted API (optional)

By default, Waystone runs locally — the memory store is a SQLite file in ~/.waystone/. For cross-machine sync or team access, switch to the hosted API:

{
  "mcpServers": {
    "waystone": {
      "command": "waystone",
      "args": ["mcp-serve"],
      "env": {
        "WAYSTONE_PROJECT": "my-project",
        "WAYSTONE_API_KEY": "your-api-key",
        "WAYSTONE_REMOTE_URL": "https://api.waystone.unbidden.ai"
      }
    }
  }
}

Get an API key from the Pro or Team plan. Local mode is free and has no rate limits.

Troubleshooting

Tools don't appear in OpenClaw after adding config

Make sure waystone is on your PATH. Run which waystone in a terminal. If not found, reinstall with # CLI in early access — request at unbidden.ai and confirm your Python bin directory is in PATH. Restart OpenClaw after saving the config.

waystone_query returns empty results

The project may not exist yet or may be empty. Run waystone list to see current projects and node counts. If empty, run waystone extract my-project MEMORY.md or waystone onboard my-project to seed it from existing session history.

How do I switch projects mid-session?

Pass the project parameter explicitly to waystone_query or waystone_extract to override the default. Or update the WAYSTONE_PROJECT env var in your config and restart the MCP server.