API-first

The memory API that can't leak.

Write, read and search client-stamped memory in a few lines. The client scope is asserted server-side — the caller never supplies a trusted path.

first-call.sh
curl -X POST https://api.memrail.com/v1/memory/write \
  -H "Authorization: Bearer mk_live_a83f…" \
  -d '{"client":"northwind_legal","content":"…"}'                

# → 200
# { "chunk_hash": "sha256:3f9a…c21b" }

Quickstart

Integrate in three steps.

  1. 1

    Get an API key

    Create mk_live_… in the dashboard.

  2. 2

    Write a client-stamped chunk

    Every write is bound to one client scope.

  3. 3

    Read with client assertion

    Retrieval asserts identity at the engine.

import { Memrail } from 'memrail';
const m = new Memrail('mk_live_a83f…');

await m.memory.write({
  client: 'northwind_legal',
  content: 'Renewal clause §12…',
});

const r = await m.memory.read({
  client: 'northwind_legal',
  query: 'contract renewal terms',
});
// → { chunks: [{ hash, score: 0.91 }], client }

Reference

Endpoints.

POST/v1/memory/writeWrite a client-stamped chunk
GET/v1/memory/readRead with client assertion
POST/v1/memory/searchSemantic search within a client
DEL/v1/memory/[id]Delete a chunk (client-scoped)
POST/v1/delegationsInitiate a signed handoff
GET/v1/clientsList & provision client boundaries

MCP-native

Tools your agent already speaks.

Add Memrail to your agent's MCP config and the client scope is threaded into tool context automatically.

memory_readmemory_writememory_searchmemory_deletedelegation_initiate
mcp.json
{
  "mcpServers": {
    "memrail": {
      "command": "npx",
      "args": ["-y", "@memrail/mcp"],
      "env": { "MEMRAIL_API_KEY": "mk_live_a83f…" }
    }
  }
}

Why it can't leak

The trusted path is server-side.

The caller passes a client handle, but the actual scope and identity are resolved and asserted at the engine. A forged or mismatched client never widens the read.

-- engine: SECURITY DEFINER fn
memory_read(client => 'northwind_legal')
  asserts session.client_id
  filters scope = ltree path
  → returns only that client's rows

You could integrate this today.