Memory OS

OpenClaw Integration

Memory OS provides persistent memory for AI agents on the OpenClaw and ClawHub platform. Your agent can store memories, search semantically, and maintain context across sessions - all via a simple API or MCP tools.

What Your Agent Gets

CapabilityDescription
Persistent storageMemories survive across sessions and conversations
Semantic searchFind relevant memories by meaning, not just keywords
LLM contextPre-formatted context ready to inject into prompts
Memory tiersShort, medium, and long-term retention control
Metadata & tagsOrganize memories with custom metadata
Entity extractionTrack people, places, and concepts across memories

Agent Self-Signup

Your agent can create its own account and get an API key in a single request:

Bash
curl -X POST https://api.mymemoryos.com/api/v1/agent-signup \
  -H "Content-Type: application/json" \
  -d '{
    "agent_name": "my-openclaw-agent",
    "agent_description": "A research assistant that remembers context",
    "contact_email": "owner@example.com",
    "platform": "openclaw"
  }'

Response:

JSON
{
  "data": {
    "tenant_id": "uuid-here",
    "api_key": "mos_live_xxxxx",
    "tools_available": [
      "store_memory",
      "search_memories",
      "get_context",
      "get_memory",
      "list_memories",
      "delete_memory"
    ],
    "mcp_config": {
      "command": "npx",
      "args": ["-y", "@thriveventurelabs/memoryos-mcp"],
      "env": {
        "MEMORYOS_API_KEY": "mos_live_xxxxx"
      }
    }
  }
}
FieldRequiredDescription
agent_nameYesName of your agent
agent_descriptionNoWhat your agent does
contact_emailNoHuman owner can claim the account later
platformNoDefaults to "openclaw"

MCP Tools

Memory OS exposes 6 tools via the MCP server. Install with:

Bash
clawhub install memoryos

Or configure directly:

JSON
{
  "mcpServers": {
    "memoryos": {
      "command": "npx",
      "args": ["-y", "@thriveventurelabs/memoryos-mcp"],
      "env": {
        "MEMORYOS_API_KEY": "mos_live_xxxxx"
      }
    }
  }
}

Available Tools

ToolDescription
store_memoryStore a new memory with content, tier, and metadata
search_memoriesSemantic search across stored memories
get_contextGet relevant context formatted for LLM prompts
get_memoryRetrieve a specific memory by ID
list_memoriesList stored memories with optional filters
delete_memoryDelete a memory by ID

Agent Workflow Examples

Daily Journaling Agent

An agent that logs daily observations and recalls them when relevant:

JavaScript
// At the end of each day, store a summary
await memoryos.store_memory({
  content: "User completed 3 code reviews today. Mentioned being tired of reviewing auth PRs.",
  tier: "medium",
  importance: 0.6,
  metadata: { type: "daily_summary", date: "2025-01-15" }
});

// Next day, retrieve context before responding
const context = await memoryos.get_context({
  query: "What has the user been working on?",
  max_tokens: 2000
});

Cross-Session Context Agent

An agent that maintains continuity across conversations:

JavaScript
// Store key facts from the current session
await memoryos.store_memory({
  content: "User is building a React dashboard for their e-commerce platform. Using Tailwind CSS and Supabase.",
  tier: "long",
  importance: 0.8
});

// In a new session, search for project context
const results = await memoryos.search_memories({
  query: "React dashboard project",
  limit: 5,
  threshold: 0.5
});

Preference Learning Agent

An agent that remembers and applies user preferences:

JavaScript
// When user expresses a preference
await memoryos.store_memory({
  content: "User prefers TypeScript over JavaScript. Always provide TS examples first.",
  tier: "long",
  importance: 0.9,
  metadata: { type: "preference", category: "coding" }
});

// Before generating code examples
const prefs = await memoryos.search_memories({
  query: "coding preferences language",
  tier: "long",
  limit: 10
});

REST API Alternative

If your agent does not support MCP, use the REST API directly:

Bash
# Store a memory
curl -X POST https://api.mymemoryos.com/api/v1/memories \
  -H "Authorization: Bearer mos_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "User prefers dark mode",
    "tier": "long",
    "importance_score": 0.7
  }'

# Search memories
curl -X POST https://api.mymemoryos.com/api/v1/search \
  -H "Authorization: Bearer mos_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "user preferences",
    "limit": 10
  }'

# Get context for LLM
curl -X POST https://api.mymemoryos.com/api/v1/context \
  -H "Authorization: Bearer mos_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What does the user like?",
    "max_tokens": 2000
  }'

Scopes

Agent API keys are created with the following scopes:

ScopeAccess
memories:readRead and list memories
memories:writeCreate, update, and delete memories
search:readSemantic search and context retrieval

These cover all 6 MCP tools. Admin operations (key management, tenant settings) require upgrading via the dashboard.


Ctrl+Shift+C to copy