Open app

Quickstart: first memory in 5 minutes.

Give one user of your application a permanent, isolated memory. Plain HTTPS, no SDK, no new dependencies.

Want your AI to remember you, personally? That takes no code at all. See Connect Claude. This guide is for developers.
Get your API key
Sign up as a developer account, then create a key. Each key is shown once, when you create it.

Sign up at app.leapmemory.com and choose For my app. Then open API Keys in the dashboard and generate a key with the admin role for this guide. The key is shown once, when you create it, so copy it then. Keys have three roles: admin (everything), ingest (saves and deletes memories, and adds, edits and deletes rules, but cannot read them), and recall (read only).

Every request authenticates with the same header:

HTTP
Authorization: Bearer lm_sk_your_key_here

Create a tenant
One tenant per end user. Each gets physically separate databases: no shared tables, no shared credentials.
Shell
curl -X POST https://api.leapmemory.com/v1/tenants \
  -H "Authorization: Bearer $LM_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tenant_id": "user_482"}'
Response · 201
{
  "success": true,
  "http_status": 201,
  "code": "created",
  "data": {
    "tenant_id": "user_482",
    "label": "",
    "status": "ready",
    "created_at": "2026-07-10T09:39:11.548594+00:00"
  }
}

Every response uses this envelope: success, http_status, code, and either data or message. This call requires an admin key, and the tenant is ready the moment it returns. You can also send an optional label of up to 200 characters.


Save a memory
Send conversation turns as they happen. One turn in, one memory out.
Saving costs $0.05 per turn, drawn from your prepaid credit balance. A new developer account starts at $0, so first add credits in the dashboard under Credits (minimum $5). Without them this call answers 402 payment_required: "Insufficient credits. Add credits to continue ingesting." Recall and the briefing are free.
Shell
curl -X POST https://api.leapmemory.com/v1/tenants/user_482/turns \
  -H "Authorization: Bearer $LM_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "role": "user",
    "content": "Sam works at Beacon. He owns the auth service and pairs with Aisha."
  }'
Response · 201
{
  "success": true,
  "http_status": 201,
  "code": "accepted",
  "data": {
    "turn_id": "6a7892b0-46e9-454f-a225-fe321d006fb5",
    "role": "user",
    "speaker_id": "user",
    "status": "pending",
    "ts": "2026-07-10T09:39:14.949785Z",
    "source": "",
    "container": ""
  }
}
Note "code": "accepted" and "status": "pending". Ingest is asynchronous: your exact words are stored the moment the call returns, and extraction (the entities, relationships, and meaning) runs in the background, typically completing within seconds. Nothing is lost while it forms.

Recall it
Ask in natural language. Recall is free and never consumes credits.
Shell
curl -X POST https://api.leapmemory.com/v1/tenants/user_482/recall \
  -H "Authorization: Bearer $LM_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "where does Sam work?"}'
Response · 200
{
  "success": true,
  "http_status": 200,
  "code": "ok",
  "data": {
    "facts": [
      {
        "subject": "sam",
        "verb": "works-at",
        "object": "beacon",
        "type_name": "works-at",
        "confidence": 0.99,
        "mention_count": 1,
        "last_mentioned": "2026-07-10T09:39:23.295529+00:00",
        "sentence": "Sam works at Beacon.",
        "sources": { "user": 1 },
        "turn_ids": ["6a7892b0-46e9-454f-a225-fe321d006fb5"],
        "turn_count": 1
      },
      {
        "subject": "sam",
        "verb": "owns",
        "object": "auth service",
        "type_name": "owns",
        "confidence": 0.95,
        "mention_count": 1,
        "last_mentioned": "2026-07-10T09:39:23.305236+00:00",
        "sentence": "Sam owns the auth service.",
        "sources": { "user": 1 },
        "turn_ids": ["6a7892b0-46e9-454f-a225-fe321d006fb5"],
        "turn_count": 1
      },
      {
        "subject": "sam",
        "verb": "pairs-with",
        "object": "aisha",
        "type_name": "pairs-with",
        "confidence": 0.95,
        "mention_count": 1,
        "last_mentioned": "2026-07-10T09:39:23.312420+00:00",
        "sentence": "Sam pairs with Aisha.",
        "sources": { "user": 1 },
        "turn_ids": ["6a7892b0-46e9-454f-a225-fe321d006fb5"],
        "turn_count": 1
      }
    ],
    "chunks": [
      {
        "chunk_id": "6a7892b0-46e9-454f-a225-fe321d006fb5:0",
        "turn_id": "6a7892b0-46e9-454f-a225-fe321d006fb5",
        "content": "Sam works at Beacon. He owns the auth service and pairs with Aisha.",
        "role": "user",
        "speaker_id": "user",
        "score": 0.9945,
        "importance": 0.5,
        "created_at": "2026-07-10T09:39:23.319353Z",
        "source": "",
        "container": ""
      }
    ],
    "anchors_found": [
      {
        "name": "sam",
        "type_name": "person",
        "count": 1,
        "span_start": 11,
        "span_end": 14
      }
    ]
  }
}

Three things came back. Facts are the distilled statements with confidence and provenance. Each carries sentence, a one-line restatement that can be null for older facts, and turn_ids, the turns it was drawn from: newest first, at most 5, with turn_count as the total. Read any of them with GET /v1/tenants/user_482/turns/{turn_id} to get the exact words. sources counts mentions by role; when it is present without a "user" key, the user never stated that fact. Older facts come back with sources null, which says nothing about who stated them. Chunks are the verbatim words as they were said, ranked by relevance score. Anchors are the entities detected in your query that steered retrieval.


Get the briefing
Recall answers questions. The briefing needs none: it is who this user is, before the conversation starts.
Shell
curl https://api.leapmemory.com/v1/tenants/user_482/briefing \
  -H "Authorization: Bearer $LM_KEY"
Response · 200
{
  "success": true,
  "http_status": 200,
  "code": "ok",
  "data": {
    "text": "Sam works at Beacon, where he owns the auth service and pairs with Aisha.",
    "written_at": "2026-07-10T09:40:02.118000+00:00",
    "covers_through": "2026-07-10T09:39:14.949000+00:00"
  }
}

One ready-to-inject text block: the user's standing rules first, if they have any, then a short prose summary of who they are. The summary is written in the background. The first one is written shortly after the tenant's first turn is processed, and after that a daily background pass refreshes it when new turns have arrived. It usually trails the newest turns by up to a day, and longer if a background write fails, so pass written_at to your model with it; covers_through is the time of the newest turn the summary read. Called right after your first save, it may still be empty. Load it once when a session opens and place it in your model's system context as quiet background; let recall handle everything specific from there. A brand-new tenant returns an empty text, with written_at and covers_through null: inject nothing, and the conversation starts like meeting someone new.


What you built
One isolated tenant, one permanent memory, recalled with provenance, briefed at a glance, in four calls.

When a user leaves, deletion is one call, and it is structural:

Shell
curl -X DELETE "https://api.leapmemory.com/v1/tenants/user_482?hard=true" \
  -H "Authorization: Bearer $LM_KEY"
Response · 200
{
  "success": true,
  "http_status": 200,
  "code": "ok",
  "data": { "deleted": true, "tenant_id": "user_482", "mode": "hard", "restorable": false }
}

Their databases are dropped entirely, not scanned for rows. Omit ?hard=true for a soft delete: the response says "mode": "soft" and "restorable": true. Undo it with POST /v1/tenants/user_482/restore. Until you restore it or hard-delete it, that tenant_id cannot be created again (409).