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_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.