NewMCP ServerView docs
Back to Memory

Documentation

Step-by-step guide to adding persistent memory to your AI assistant.

Quick Start

Get memory working in under a minute. No signup required for local mode.

bash
npx @lakehouse42/memory-mcp

This starts the MCP server with local storage. Your memories are saved to ~/.lakehouse/memory-mcp/memories.json

Claude Code

Add memory to Claude Code by editing your config file.

Step 1: Edit config

Open ~/.claude/claude_code_config.json

~/.claude/claude_code_config.json
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["@lakehouse42/memory-mcp"]
    }
  }
}

Step 2: Restart Claude Code

Close and reopen your terminal. The memory tools will now be available.

Tip: Ask Claude to remember that I prefer TypeScript to test that memory is working.

Claude Desktop

Add memory to Claude Desktop via the settings menu.

  1. 1Open Claude Desktop Settings
  2. 2Go to Developer → Edit Config
  3. 3Add the MCP server configuration
Claude Desktop Config
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["@lakehouse42/memory-mcp"],
      "env": {
        "LAKEHOUSE_URL": "https://api.lakehouse42.com",
        "LAKEHOUSE_API_KEY": "lh_your_api_key"
      }
    }
  }
}

Cursor / Windsurf

Add memory to Cursor or Windsurf following the same pattern.

MCP Config
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["@lakehouse42/memory-mcp"]
    }
  }
}

LH42 Backend

Connect to LH42 for full semantic search, deduplication, and knowledge graph features.

Get your API key

  1. Sign up for LH42
  2. Go to Settings → API Keys
  3. Create a new API key

Add environment variables

config.json
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["@lakehouse42/memory-mcp"],
      "env": {
        "LAKEHOUSE_URL": "https://api.lakehouse42.com",
        "LAKEHOUSE_API_KEY": "lh_your_api_key"
      }
    }
  }
}
VariableDescription
LAKEHOUSE_URLLH42 API URL (enables cloud backend)
LAKEHOUSE_API_KEYAPI key for authentication
DEBUGEnable debug logging (true/false)

MCP Tools Reference

remember

Store a memory for later recall.

ParameterTypeDescription
content*stringThe information to remember
typestringMemory type (fact, preference, task, event, context, reflection)
importancenumber0.0 to 1.0 (default: 0.5)

recall

Search memories by semantic similarity.

ParameterTypeDescription
query*stringWhat to search for
limitnumberMax results (default: 5)
typesstring[]Filter by memory types

forget

Delete a memory by ID.

ParameterTypeDescription
memoryId*stringID of memory to delete
reasonstringReason for deletion (audit trail)

list_memories

List recent memories.

ParameterTypeDescription
limitnumberMax results (default: 10)

memory_status

Get memory system status including backend type and available features.

Memory Types

TypeDescriptionExample
factFactual information (default)"The API uses REST endpoints"
preferenceUser preferences"User prefers dark mode"
taskTasks and todos"Need to refactor the auth module"
eventEvents and occurrences"Deployed v2.0 on March 15"
contextConversation context"Working on the payment flow"
reflectionInsights and learnings"The old approach was too slow"

REST API

Access memory directly via the LH42 REST API.

bash
# Store a memory
curl -X POST https://api.lakehouse42.com/api/v1/memory \
  -H "X-API-Key: lh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"content": "User prefers TypeScript", "memory_type": "preference"}'
bash
# Search memories
curl "https://api.lakehouse42.com/api/v1/memory/search?query=preferences" \
  -H "X-API-Key: lh_your_api_key"

Programmatic Usage

Use the package in your own TypeScript/JavaScript code.

typescript
import { createMemoryServer, LakehouseBackend } from "@lakehouse42/memory-mcp";

// Create server with custom config
const server = await createMemoryServer({
  lakehouseUrl: "https://api.lakehouse42.com",
  apiKey: "lh_xxx",
  debug: true,
});

// Or use backends directly
const backend = new LakehouseBackend({
  url: "https://api.lakehouse42.com",
  apiKey: "lh_xxx",
});

await backend.initialize();
await backend.remember({ content: "User likes TypeScript" });
const results = await backend.recall({ query: "programming preferences" });

Ready to upgrade?

Get full semantic search, deduplication, and knowledge graph features with LH42.