MemoryLayer
  • How it works
  • Arena
  • Benchmarks
  • Registry
  • Pricing
  • Docs
Log inGet started free
  • 01Arena
  • 02Benchmarks
  • 03Registry
  • 04Pricing
  • 05Docs
Log inGet started free

Docs

Docs home

Getting started

  • Quickstart
  • Claude Code
  • Cursor

Learn

  • How memory works
  • Search & recall
  • Shared across agents
    1. Two ways to connect
    2. Check it works
  • Grounded facts

Reference

  • MCP tools
  • Agent rules
  • Bookmarks
  • Registry & CLI

Help

  • FAQ
← Search & recallGrounded facts →
Docs home

Getting started

  • Quickstart
  • Claude Code
  • Cursor

Learn

  • How memory works
  • Search & recall
  • Shared across agents
    1. Two ways to connect
    2. Check it works
  • Grounded facts

Reference

  • MCP tools
  • Agent rules
  • Bookmarks
  • Registry & CLI

Help

  • FAQ

Docs/Learn

Learn

Shared across agents

Every agent you connect reads and writes one file, ~/.memorylayer/memories.db. A decision made in Cursor today is there when Claude Code asks tomorrow.

Two ways to connect

Two ways to connect

SSE one shared server

Claude CodeCursor…
connect to
memorylayer startlocalhost:7400/sse
memories.db~/.memorylayer

stdio no server to run

Your agent
spawns
memorylayer --stdiokey via MEMORY_API_KEY
memories.dbsame file
SSE shares one running server between agents; stdio needs no server. Both write the same file.

stdio — what setup writes

The agent starts MemoryLayer itself and passes your key in the environment.

~/.claude.json
{"mcpServers": {"memorylayer": {"command": "memorylayer","args": ["--stdio"],"env": { "MEMORY_API_KEY": "sk-ml-your-key-here" }}}}

SSE — one server for every agent

Start the server and leave it running (memorylayer --key on its own only saves the key), then point each agent at it:

Terminal
memorylayer start --key sk-ml-your-key-herecurl http://localhost:7400/health   # → {"status":"ok","transport":"sse",...}
~/.claude.json
{"mcpServers": {"memorylayer": { "url": "http://localhost:7400/sse" }}}

Check it works

Code
# Agent A stores:remember({ content: "prefers dark mode", namespace: "user" }) # Agent B recalls:recall({ query: "UI preferences", namespace: "user", preview: true })
← PreviousSearch & recallNext →Grounded facts

Something missing or wrong? Email support@memorylayer.in or open an issue.