Sdk typescript
TypeScript SDK
Install @unisonlabs/sdk and use the complete, typed brain surface from TypeScript or Bun: context recall, ingest, documents, the knowledge graph, and actor delegation.
The TypeScript SDK is the reference surface - every brain operation, typed.
bun add @unisonlabs/sdk # or npm installimport { BrainClient } from "@unisonlabs/sdk";
const brain = new BrainClient({ token: process.env.UNISON_TOKEN });
// base URL defaults to https://brain.unisonlabs.ai (override: apiUrl / UNISON_API_URL)
const ctx = await brain.context({ q: "what did we decide about auth" });
if (!ctx.weakEvidence) prompt += ctx.contextMd;
await brain.ingest({ items: [{ type: "conversation", sourceRef: "s-42", turns }] });
await brain.remember({ dump: { sessionJsonl }, source: "claude-code-session" }); // curate a session
await brain.write({ path: "/workspace/decisions/queue.md", bodyMd: "# pgmq\n…", tags: ["infra"] });Surface map
| Area | Methods |
|---|---|
| recall | context, search, grep, get, list, listFs, readFs, neighbors |
| write | write, writeDocs (batch), patchDocMeta, delete, tag, share, ingest, remember |
| graph | entities.list/resolve/get/upsert, facts.list/about/timeline/record/correct/invalidate, links.list/create |
| admin | review.conflicts/resolve/merges/undo, jobs.*, status |
| auth | keys.create/list/revoke, invitations, whoami |
Acting for end users
const u1 = brain.withActor("user-001"); // isolated /private/ per actor
await u1.search("what did I say?");Safe concurrent writes: pass expectedContentHash to write and handle the 409 conflict.
Add Unison to a TypeScript Agent - SDK Quickstart
Give your TypeScript agent persistent team memory with @unisonlabs/sdk: install, first recall, and the write-back loop in under five minutes.
Add Unison to a Python Agent - SDK Quickstart
Give your Python agent persistent team memory with the unisonlabs package: pip install, first search, and the write-back loop.