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_mdNext: pick your surface
| You build with | Go to |
|---|---|
| TypeScript / Bun | TypeScript SDK quickstart |
| Python | Python SDK quickstart |
| Claude Code / Cursor / Codex | MCP quickstart |
| Terminal | CLI |
| Raw HTTP | Brain API quickstart |
| All surfaces at a glance | Explore the brain |
Introduction
Unison is the team brain for AI agents: a persistent, shared knowledge graph behind one HTTP API. Pick your surface and add memory in minutes — SDKs, a CLI, an MCP server, a filesystem mount, and framework integrations.
Create an API key
Get a usk_live_ key for the Unison Brain API — via the dashboard, CLI, or the headless email-OTP API.