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 — Ingest a conversation

curl -X POST https://brain.unisonlabs.ai/v1/brain/ingest \
  -H 'content-type: application/json' \
  -H "Authorization: Bearer $UNISON_TOKEN" \
  -d '{
    "items": [{
      "type": "conversation",
      "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",
      "visibility": "private"
    }]
  }'
{ "accepted": 1, "jobId": "job_..." }

Ingestion is asynchronous — the brain indexes the item in the background. Most items are searchable within a few seconds.

SDK one-liner:

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

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