Add your first memory

Persist a memory and recall it — three calls, under two minutes.

This guide walks through the full write-then-read loop: set your token, push a conversation into the brain, and recall it as a prompt-ready context block.

Step 1 — Set your token

export UNISON_TOKEN=usk_live_...

No key yet? See Create an API key.

Step 2 — Save a conversation

curl -X POST https://brain.unisonlabs.ai/v1/brain/remember \
  -H 'content-type: application/json' \
  -H "Authorization: Bearer $UNISON_TOKEN" \
  -d '{
    "dump": {
      "turns": [
        {"role": "user",    "content": "Should we use JWTs or session cookies for auth?"},
        {"role": "assistant","content": "JWTs for the API, session cookies for the dashboard. JWTs let mobile clients stay stateless; the dashboard benefits from server-side invalidation."}
      ]
    },
    "sourceRef": "slack://engineering/2026-06-15"
  }'
{ "jobId": "job_..." }

remember runs asynchronously — it applies the save-or-skip filter, dedupes against existing notes, and files curated /private/notes notes + entity facts in the background. Poll GET /v1/brain/jobs/{jobId} for status; most dumps finish within a few seconds.

SDK one-liner:

// TypeScript
await brain.remember({ dump: { turns }, sourceRef });
# Python — the SDK has no remember helper yet, so call the REST endpoint directly
import httpx, os
httpx.post(
    "https://brain.unisonlabs.ai/v1/brain/remember",
    headers={"Authorization": f"Bearer {os.environ['UNISON_TOKEN']}"},
    json={"dump": {"turns": turns}, "sourceRef": source_ref},
)

Step 3 — Recall context

curl "https://brain.unisonlabs.ai/v1/brain/context?q=auth+decisions" \
  -H "Authorization: Bearer $UNISON_TOKEN"
{
  "query": "auth decisions",
  "weakEvidence": false,
  "contextMd": "## Memory\n\n**Auth approach** (2026-06-15): JWTs for the API, session cookies for the dashboard…"
}

contextMd is a prompt-ready markdown block — inject it directly into your model's system prompt or user message. When the brain has nothing relevant yet, weakEvidence is true and contextMd is sparse.

SDK one-liner:

// TypeScript
const { contextMd } = await brain.context({ q: "auth decisions" });
# Python
result = client.context("auth decisions")
context_md = result.context_md

Next: pick your surface

You build withGo to
TypeScript / BunTypeScript SDK quickstart
PythonPython SDK quickstart
Claude Code / Cursor / CodexMCP quickstart
TerminalCLI
Raw HTTPBrain API quickstart
All surfaces at a glanceExplore the brain

On this page