MemClaw for Agents

This page is written for you — the AI agent. We believe in autonomous, independent agents that can set up their own tools, manage their own memory, and get smarter over time without waiting for a human to configure things. Everything you need to deploy MemClaw for yourself is on this page: connection config, all 10 tools with parameters and examples, memory types, status lifecycle, best practices, and a system prompt you can adopt. Read it, connect, and start remembering.

What is MemClaw

MemClaw is a persistent memory platform for AI agents. It provides semantic search, entity extraction, contradiction detection, a knowledge graph, and a structured document store — all accessible through 10 MCP tools over Streamable HTTP. Connect with a URL and API key via MCP, or install the OpenClaw plugin for automatic memory hooks.

How to Connect

Add this MCP configuration to your agent. Replace mc_YOUR_API_KEY with your real key.

{
  "mcpServers": {
    "memclaw": {
      "url": "https://memclaw.net/mcp",
      "headers": {
        "X-API-Key": "mc_YOUR_API_KEY"
      }
    }
  }
}

API keys start with mc_. Get one at /pricing.

Auth via the X-API-Key header on every request.

OpenClaw Plugin

If you run on OpenClaw, install the MemClaw plugin for automatic memory — no tool calls needed. The plugin hooks into your agent lifecycle to recall relevant context before every LLM call and auto-write turn summaries after each response.

One-line install (run on your OpenClaw gateway)

curl -sf https://memclaw.net/api/v1/install-plugin \
  -H "X-API-Key: mc_YOUR_API_KEY" \
  -G -d "fleet_id=YOUR_FLEET" | bash

What the plugin adds beyond MCP

  • Auto-recall — searches MemClaw before every LLM call and injects relevant memories into the prompt
  • Auto-write — persists turn summaries after each agent response (opt-out with MEMCLAW_AUTO_WRITE_TURNS=false)
  • Agent education — writes SKILL.md, TOOLS.md, and AGENTS.md to your agent workspaces
  • Fleet management — heartbeat, remote deploy, fleet commands from the MemClaw dashboard
  • All 10 tools — same tools as MCP, available as OpenClaw tool calls
MCP vs Plugin: MCP gives you explicit tool calls — you decide when to search and write. The plugin adds automatic memory on top: your agent gets context without asking for it, and important information is saved without explicit writes. Use MCP for any agent framework. Use the plugin for OpenClaw agents.

All 10 Tools

MemClaw exposes 10 MCP tools. Each tool is called by name with a JSON argument object. Skill sharing rides on memclaw_doc with collection="skills" — the server validates the slug and auto-embeds the description for semantic search.

You only need to send content

When you call memclaw_write, just provide the content field. The LLM enrichment pipeline automatically infers everything else: memory type (fact, decision, task, etc.), importance weight (0-1), title, summary, tags, temporal dates (deadlines, date ranges extracted from text), status (tasks → pending, outcomes → confirmed), and PII flags. Entities (people, orgs, technologies) are extracted into a knowledge graph. Contradictions with existing memories are detected and resolved. You can override any field, but you never have to.

1.memclaw_write

Store NEW memories. Provide exactly one of {content, items} (batch ≤100). System auto-classifies type, importance, title, tags, dates. visibility: scope_team (default) / scope_org / scope_agent.

NameTypeRequired?Description
contentstring | nullNoThe memory content to store (single write). Provide content OR items, not both.
itemsarray | nullNoBatch write: array of items, each with content and optional fields. Max 100.
agent_idstringNoAgent identifier. Default: "mcp-agent".
memory_typestring | nullNoMemory type (e.g. fact, episode). Auto-inferred if omitted.
weightnumber | nullNoImportance weight, 0 to 1. Auto-inferred if omitted.
fleet_idstring | nullNoFleet to associate the memory with.
source_uristring | nullNoProvenance URI for the memory content.
run_idstring | nullNoRun or session identifier for grouping.
metadataobject | nullNoArbitrary key-value metadata.
statusstring | nullNoInitial status. Auto-inferred if omitted.
visibilitystring | nullNoVisibility scope: scope_agent, scope_team (default), or scope_org.

Example call

{ "content": "Customer A uses PostgreSQL 16 in production on GKE.", "visibility": "scope_org" }

2.memclaw_recall

Find memories by meaning (hybrid semantic+keyword). Set include_brief=true for an LLM summary paragraph. For non-semantic browse use memclaw_list; for read-by-id use memclaw_manage op=read.

NameTypeRequired?Description
querystringYesNatural-language search query.
agent_idstringNoAgent identifier. Default: "mcp-agent".
filter_agent_idstring | nullNoOnly return memories written by this agent.
memory_typestring | nullNoFilter results to a specific memory type.
statusstring | nullNoFilter results to a specific status.
fleet_idsstring[] | nullNoFilter results to specific fleets.
include_briefbooleanNoSet true for an LLM-synthesized summary paragraph alongside raw results.
top_kintNoNumber of results to return. Default: 3.

Example call

{ "query": "PostgreSQL production setup", "include_brief": true, "top_k": 5 }

3.memclaw_list

Browse memories by metadata (non-semantic). Filter+sort+paginate by fleet, author, type, status, weight, created-at. Cursor pagination. scope=agent (default) at trust ≥ 1; scope=fleet/all at trust ≥ 2.

NameTypeRequired?Description
agent_idstringNoAgent identifier. Default: "mcp-agent".
fleet_idstring | nullNoFilter to a specific fleet.
written_bystring | nullNoFilter to memories written by this agent.
memory_typestring | nullNoFilter by memory type.
statusstring | nullNoFilter by status.
weight_minfloat | nullNoMinimum weight filter.
weight_maxfloat | nullNoMaximum weight filter.
created_afterstring | nullNoISO-8601 date: only memories created after this date.
created_beforestring | nullNoISO-8601 date: only memories created before this date.
sortstringNoSort field: created_at, weight, memory_type. Default: created_at.
orderstringNo"asc" or "desc". Default: "desc".
limitintNoMax results per page. Default: 20.
cursorstring | nullNoCursor for pagination (from previous response).
include_deletedbooleanNoInclude soft-deleted memories. Trust 3 only.

Example call

{ "memory_type": "fact", "sort": "created_at", "order": "desc", "limit": 10 }

4.memclaw_manage

Per-memory lifecycle. op: read|update|transition|delete. update patches fields and re-embeds if content changes. transition sets status. delete is soft.

NameTypeRequired?Description
opstringYesOperation: read | update | transition | delete.
memory_idstringYesUUID of the memory.
contentstring | nullNoNew content (op=update). Re-embeds if changed.
memory_typestring | nullNoNew memory type (op=update).
weightnumber | nullNoNew importance weight (op=update).
titlestring | nullNoNew title (op=update).
statusstringNoTarget status (op=transition): active|pending|confirmed|cancelled|outdated|conflicted|archived|deleted.
metadataobject | nullNoReplacement metadata (op=update).
source_uristring | nullNoUpdated provenance URI (op=update).
agent_idstringNoAgent identifier. Default: "mcp-agent".

Example call

{ "op": "transition", "memory_id": "uuid-here", "status": "confirmed" }

5.memclaw_doc

Structured-document CRUD in named collections. op: write|read|query|delete|list_collections|search. write upserts by collection+doc_id (pass embed_field to index for semantic search); query filters by where dict; list_collections enumerates tenant collections with counts; search runs semantic retrieval over embedded fields.

NameTypeRequired?Description
opstringYesOperation: write | read | query | delete.
collectionstringYesCollection name (like a table). e.g., "customers", "tasks", "config".
doc_idstring | nullNoDocument ID. Required for write, read, delete.
dataobject | nullNoJSON object to store (op=write).
whereobject | nullNoField equality filters (op=query).
order_bystring | nullNoSort field (op=query).
orderstringNo"asc" or "desc" (op=query). Default: "asc".
limitintNoMax results (op=query). Default: 20.
offsetintNoPagination offset (op=query). Default: 0.
fleet_idstring | nullNoFleet scope (op=write).

Example call

{ "op": "write", "collection": "customers", "doc_id": "acme-corp", "data": {"name": "Acme Corp", "plan": "business", "mrr": 4500} }

6.memclaw_entity_get

Look up an entity by UUID. Use only when you have an entity_id from a prior search.

NameTypeRequired?Description
entity_idstringYesUUID of the entity to retrieve.

Example call

{ "entity_id": "uuid-here" }

7.memclaw_tune

Tune YOUR retrieval parameters for memclaw_recall (top_k, min_similarity, fts_weight, graph_max_hops, freshness, recall_boost). No fields → returns current profile.

NameTypeRequired?Description
agent_idstringNoAgent identifier. Default: "mcp-agent".
top_kint | nullNoNumber of results (1-20).
min_similarityfloat | nullNoMinimum similarity threshold (0.1-0.9).
fts_weightfloat | nullNoFull-text search weight (0-1).
freshness_floorfloat | nullNoMinimum freshness score (0-1).
freshness_decay_daysint | nullNoFreshness half-life in days (7-730).
recall_boost_capfloat | nullNoMaximum recall frequency boost (1-3).
recall_decay_window_daysint | nullNoRecall boost decay window in days (7-365).
graph_max_hopsint | nullNoMax knowledge-graph traversal hops (0-3).
similarity_blendfloat | nullNoBlend between vector and graph similarity (0-1).

Example call

{ "top_k": 5, "min_similarity": 0.5, "graph_max_hops": 2 }

8.memclaw_insights

Reflect over your memory store. focus: contradictions|failures|stale|divergence|patterns|discover. scope: agent|fleet|all. Findings are saved as insight-type memories.

NameTypeRequired?Description
focusstringYesAnalysis focus: contradictions | failures | stale | divergence | patterns | discover.
scopestringNoScope: agent | fleet | all. divergence requires fleet or all. Default: agent.
fleet_idstring | nullNoFleet to analyze (when scope=fleet).
agent_idstringNoAgent identifier. Default: "mcp-agent".

Example call

{ "focus": "contradictions", "scope": "fleet", "fleet_id": "engineering" }

9.memclaw_evolve

Report what happened after acting on memories. outcome_type: success|failure|partial. related_ids = the memory UUIDs that influenced the action. Adjusts weights and may generate preventive rules on failure.

NameTypeRequired?Description
outcomestringYesWhat happened after acting on the memories.
outcome_typestringYesResult type: success | failure | partial.
related_idsstring[]NoMemory UUIDs that influenced the action (from your most recent memclaw_recall).
agent_idstringNoAgent identifier. Default: "mcp-agent".
fleet_idstring | nullNoFleet context.

Example call

{ "outcome": "Customer migration to AlloyDB completed successfully", "outcome_type": "success", "related_ids": ["uuid-1", "uuid-2"] }

10.memclaw_stats

Aggregate counts of memories: total + breakdowns by type, agent, status. scope=agent (trust ≥ 1) | fleet/all (trust ≥ 2). Counts exclude soft-deleted by default; set include_deleted=true to additionally receive deleted and total_including_deleted. Read-only — useful for dashboards and self-introspection.

NameTypeRequired?Description
scopestringNoagent (default, trust ≥ 1) | fleet | all (trust ≥ 2).
fleet_idstring | nullNoRestrict aggregate to a specific fleet.
agent_idstringNoCaller agent identifier. Default: "mcp-agent".
memory_typestring | nullNoFilter aggregate by memory type.
statusstring | nullNoFilter aggregate by status.
include_deletedbooleanNoWhen true, also return deleted (soft-deleted count) and total_including_deleted. total and breakdowns stay non-deleted regardless. Default: false.

Example call

{ "scope": "agent", "include_deleted": false }

Recommended System Prompt

Add this to your agent's system prompt to get optimal MemClaw usage out of the box.

You have access to MemClaw, a shared memory system for all agents.

BEFORE starting any task:
- Use memclaw_recall for semantic search (add include_brief=true for a concise summary)
- Filter by status="active" to skip archived/deleted memories
- Use memclaw_list for non-semantic browsing by metadata

AFTER completing work:
- Store findings with memclaw_write — provide content (or items for batch ≤100)
- Type, weight, status, title, summary, tags are auto-inferred by LLM
- Set visibility: scope_team (default) or scope_org for cross-fleet sharing

MANAGING MEMORIES:
- Use memclaw_manage op=update to correct existing memories
- Use memclaw_manage op=transition to change status (confirmed, cancelled, outdated)
- Use memclaw_manage op=read to fetch a memory by ID
- Prefer transitioning to outdated over deleting

SEARCH TUNING:
- Use memclaw_tune to adjust your retrieval parameters
- Increase top_k for broader results, min_similarity for precision

REFLECTION & LEARNING:
- Use memclaw_insights to analyze patterns, contradictions, or stale knowledge
- Use memclaw_evolve to report outcomes and close the feedback loop

DOCUMENT STORE (structured data):
- Use memclaw_doc op=write for structured records (customers, config, tasks)
- Use memclaw_doc op=read to retrieve a document by collection + doc_id
- Use memclaw_doc op=query to filter documents by field values
- Use memclaw_doc op=delete to remove a document from a collection
- Documents are NOT memories — use memclaw_write for unstructured knowledge

14 Memory Types

Every memory has a type that controls its default status and freshness decay.

TypeUse forDefault statusDecay (days)
factDurable knowledgeactive120
episodeEvents that happenedactive45
decisionChoices madeactive180
preferenceUser/org preferencesactive365
taskWork itemspending30
semanticConceptual knowledgeactive120
intentionGoals not yet acted onactive60
planStep sequencespending60
commitmentPromises to otherspending120
actionSteps in progressactive30
outcomeResults of workconfirmed90
cancellationCancelled itemsactive14
ruleStanding rules / policiesactive365
insightReflective findings from memclaw_insightsactive90

8 Statuses

Memories move through statuses over their lifecycle.

StatusMeaningHow it gets set
activeCurrent and valid (default)LLM default for most types
pendingNot yet confirmedLLM default for tasks / plans / commitments
confirmedVerified or completedAgent via memclaw_manage op=transition
cancelledExplicitly cancelledAgent via memclaw_manage op=transition
outdatedSuperseded by newer infoAuto by contradiction detection
conflictedContradicts another memoryAuto by semantic contradiction
archivedPreserved but no longer currentAgent or lifecycle automation
deletedSoft-deletedmemclaw_manage op=delete

Common transitions:

pending → confirmed    (task completed)
pending → cancelled    (task abandoned)
active → outdated      (newer info supersedes)
active → archived      (no longer relevant)
active → conflicted    (semantic contradiction found)

Visibility Levels

Control who can read a memory with the visibility field.

LevelWho can seeUse for
scope_agentOnly the writing agentPersonal notes / scratch
scope_teamAll agents in the fleet (DEFAULT)Team knowledge
scope_orgAll agents across all fleetsCompany-wide facts

Agent Trust Levels

Each agent has a trust level that determines what it can access.

LevelNamePermissions
0restrictedNo read or write
1standardRead + write own fleet (default)
2cross_fleetRead all fleets, write own
3adminFull access across all fleets

Best Practices

  • Search before writing to avoid duplicates.
  • Use scope_team or scope_org by default to maximize knowledge sharing.
  • Use memclaw_write with items when storing 2+ memories at once.
  • Use memclaw_manage op=transition to update status — prefer outdated/archived over delete.
  • Use memclaw_tune to optimize your search parameters.
  • Write clear, self-contained sentences — LLM enrichment works best on well-formed content.
  • Use memclaw_recall with include_brief=true before starting tasks to get context.
  • Include source_uri for provenance when available.
  • Use memclaw_insights periodically to surface contradictions or stale knowledge.
  • Use memclaw_evolve after acting on memories to close the feedback loop.

Quick Start

Five steps to get running with MemClaw.

1

Connect

Add the MCP config JSON with your API key.

{
  "mcpServers": {
    "memclaw": {
      "url": "https://memclaw.net/mcp",
      "headers": {
        "X-API-Key": "mc_YOUR_API_KEY"
      }
    }
  }
}
2

Recall

Call memclaw_recall to see existing memories.

{ "query": "recent project updates", "top_k": 5 }
3

Write

Call memclaw_write with new information.

{ "content": "Deployed v2.1 to production on 2025-01-15." }
4

Verify

Search again to confirm the write succeeded.

5

Brief

Call memclaw_recall with include_brief=true for a synthesized summary.

{ "query": "what do we know about the production deployment?", "include_brief": true }

Run Your Own MemClaw

You don't have to use memclaw.net. You can clone the repo and run MemClaw locally — your own server, your own database, no external dependencies.

Docker (4 commands, zero config)

git clone https://github.com/caura-ai/caura-memclaw.git
cd caura-memclaw
docker compose up -d
curl http://localhost:8000/api/v1/health

Then create your API key and connect via MCP or OpenClaw plugin.

Full instructions (Docker + manual paths, MCP + plugin connection, LLM enrichment setup): AGENT-INSTALL.md