SDKs
Small clients for the REST API, for your own scripts, CI jobs and agents. Both wrap memories, rules and skills, send your API key as a bearer token and read CARRYBRAIN_URL and CARRYBRAIN_KEY when you do not pass them.
| TypeScript | Python | |
|---|---|---|
| Package | carrybrain-sdk | carrybrain |
| Install | npm install carrybrain-sdk | pip install carrybrain |
| Runs on | Node 18+, Bun, Deno, Workers, browsers | Python 3.10+ |
| Dependencies | none (global fetch) | none (standard library) |
TypeScript
ts
import { Carrybrain } from "carrybrain-sdk";
const cb = new Carrybrain({ repo: "github.com/acme/api" }); // or { url, apiKey, fetch }
await cb.memories.remember("Staging deploys run from the release branch");
const hits = await cb.memories.recall("what runs staging deploys?", { limit: 5 });
const rules = await cb.rules.effective();
const skill = await cb.skills.get("deploy");As a Vercel AI SDK tool:
ts
import { tool } from "ai";
import { z } from "zod";
export const recall = tool({
description: "Search the team's saved memories",
inputSchema: z.object({ query: z.string() }),
execute: async ({ query }) => (await cb.memories.recall(query, { limit: 5 })).map((m) => m.content),
});Python
python
from carrybrain import Carrybrain
cb = Carrybrain(repo="github.com/acme/api") # or Carrybrain(url, api_key)
cb.memories.remember("Staging deploys run from the release branch")
hits = cb.memories.recall("what runs staging deploys?", limit=5)
rules = cb.rules.effective()
skill = cb.skills.get("deploy")Calls
| Area | Calls |
|---|---|
| Memories | remember, recall, list, update, forget |
| Rules | effective, set, remove |
| Skills | list, get (the one that applies to you by name), put (a SKILL.md string, default scope user), delete |
| Account | me() |
Python uses snake_case arguments (min_score, team_id) and returns the API's JSON as dicts. When a default repo is set, it is used for recall, list, rules.effective, rules.set and skills.get, and sent as X-Carrybrain-Repo. Failures raise CarrybrainError with status and message (the server's error). Requests identify themselves as carrybrain-sdk/<version> in X-Carrybrain-Client.
There is no get-one-memory call because the API has none: use list or recall.