---
title: Quickstart
description: Connect to a memory in your account, store a fact, and read it back, using curl or MCP.
---

This takes about a minute. You need `curl` and a memlane account (you can create one in step 1). Examples use a POSIX shell. In PowerShell, set the variable with `$env:MEMLANE_KEY = "om_..."`.

## 1. Get a key

Ask to connect. This needs no key:

```bash
curl -s -X POST https://api.memlane.sh/v1/connect   -H 'content-type: application/json'   -d '{"name":"my-script"}'
```

```json
{
  "device_code": "omd_...",
  "user_code": "WDJB-MJHT",
  "verification_uri_complete": "https://api.memlane.sh/connect?code=WDJB-MJHT",
  "interval": 5,
  "expires_in": 600
}
```

Open `verification_uri_complete` in a browser. Sign in, or create an account (an email and a password). Pick a memory, or start a new one, and approve. Then collect the key:

```bash
curl -s -X POST https://api.memlane.sh/v1/connect/token   -H 'content-type: application/json'   -d '{"device_code":"omd_..."}'
```

```json
{
  "space_id": "sp_...",
  "member_id": "mb_...",
  "name": "my-script",
  "role": "owner",
  "api_key": "om_...",
  "next": "Send the key as 'Authorization: Bearer <api_key>'. Start with GET /v1/context ..."
}
```

Before you approve, this returns `authorization_pending`: run it again. The key is shown **once**. Only a hash of it is stored, so it cannot be shown again. Keep it somewhere safe, such as an environment variable:

```bash
export MEMLANE_KEY="om_..."
```

Lost it? Connect again: you pick the same memory from your account. See [Accounts](/docs/accounts).

Connecting an app that signs in with OAuth (ChatGPT, claude.ai, Claude Desktop, Claude Code, Cursor, Grok)? It needs no key: [it signs in](/docs/guides/oauth) and you pick the memory there.

A new memory's timezone comes from your browser. It decides what "today" means for the journal and when nightly dreaming runs. Change it with `PATCH /v1/space`.

## 2. Remember a fact

Send the key as `Authorization: Bearer <key>` (or `X-API-Key: <key>`):

```bash
curl -s -X POST https://api.memlane.sh/v1/memories \
  -H "Authorization: Bearer $MEMLANE_KEY" \
  -H 'content-type: application/json' \
  -d '{"subject":"Sam","text":"Prefers code reviews on Thursdays","origin":"user","tier":"core"}'
```

The response is `201` with `{"memory": {...}, "created": true}`. Sending the same subject and text again returns the existing fact with `200` and `"created": false`.

## 3. Recall it

```bash
curl -s "https://api.memlane.sh/v1/memories?q=thursday" \
  -H "Authorization: Bearer $MEMLANE_KEY"
```

Recall finds facts by their words and by their meaning, best matches first. Word search is case- and accent-insensitive, works in any script, and matches prefixes (`thurs` finds "Thursdays"). Meaning search (English) also finds facts that share no words with the question, so `q=when does Sam like meetings` finds the same fact once the vector index catches up, usually about two minutes after it is stored. The response's `search` field says which ran.

### See everything it stored

Leave out `q` to list every fact, with who wrote it (`origin`):

```bash
curl -s "https://api.memlane.sh/v1/memories?limit=100" -H "Authorization: Bearer $MEMLANE_KEY"
```

The response has `total`, and `next_cursor` when there's another page: pass it as `cursor`. Facts that were replaced or have expired aren't listed. `GET /v1/export` includes them.

## 4. Load context at the start of a run

```bash
curl -s "https://api.memlane.sh/v1/context" -H "Authorization: Bearer $MEMLANE_KEY"
```

One bounded read returns pinned and core facts, due records, open actions, the recent journal, the latest weekly digest, and the last dream report. See [Concepts](/docs/concepts#context).

## Or connect over MCP

Point any MCP client that supports Streamable HTTP at `https://mcp.memlane.sh` with the header `Authorization: Bearer <key>`. For Claude Code:

```bash
claude mcp add --transport http memlane https://mcp.memlane.sh \
  --header "Authorization: Bearer $MEMLANE_KEY"
```

Then ask the agent to call `get_context`. Guides for other clients are under [Agent guides](/docs/guides/mcp-clients).

This lists four tools: `get_context`, `remember`, `recall`, and `forget`. To list all 43, [add `?tools=all`](/docs/mcp-tools#which-tools-are-listed) to the URL. Chat apps use `?tools=chat`, which lists twelve.

## Next

- [Agent quickstart](/docs/agent-quickstart): let your agent do all of this itself.
- [Concepts](/docs/concepts): what else a space holds.
- [Your own OpenAI key](/docs/own-openai-key): your own allowance for meaning search, billed to you.
- [API reference](/docs/api-reference) and [MCP tools](/docs/mcp-tools).
