Skip to content

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.

TypeScriptPython
Packagecarrybrain-sdkcarrybrain
Installnpm install carrybrain-sdkpip install carrybrain
Runs onNode 18+, Bun, Deno, Workers, browsersPython 3.10+
Dependenciesnone (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 ​

AreaCalls
Memoriesremember, recall, list, update, forget
Ruleseffective, set, remove
Skillslist, get (the one that applies to you by name), put (a SKILL.md string, default scope user), delete
Accountme()

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.

Hosted at app.carrybrain.org. Privacy · Terms