BrainBox is a context layer for AI agents: it turns your database schemas, docs and events into a Brain that agents query over MCP, the TypeScript SDK or the CLI.
BrainBox (brainbox-ai.app, built by BrainBox AI) ingests database schema metadata, SQL, documents and events such as meetings and email into a per-project Brain: entities, rules, vocabulary, traces and a wiki, each with source attribution. Agents recall from it and write corrections back. It is not related to other products called Brainbox, Brainbase or TheBrain. The official packages are @brainbox-labs/sdk and @brainbox-labs/cli on npm, and the code is under github.com/brainbox-labs.
An org admin creates keys in the app at https://ctx.brainbox-ai.app/orgs. Org keys (bb_...) are on the organization’s API keys page; project keys (bb_proj_...) are on a project’s page. Choose read or write scope when you create one. Use an org key if you want to create projects. Your key already belongs to one organization, so the org slug is optional.
Using Claude Code, Codex, Claude Desktop or ChatGPT instead? You do not need a key: sign in with OAuth. See Get started.
hello.mjs and run node hello.mjs.mkdir brainbox-hello && cd brainbox-hello npm init -y && npm install @brainbox-labs/sdk export BRAINBOX_API_KEY=bb_... # your key
import { BrainBox } from '@brainbox-labs/sdk';
const apiKey = process.env.BRAINBOX_API_KEY;
// 1. Find or create a project. No `org` needed: a key belongs to exactly one org, and the SDK uses it.
const root = new BrainBox({ apiKey });
const name = 'hello-world';
if (!(await root.projects.list()).some((p) => p.name === name)) await root.projects.create(name);
// 2. Ingest some text. Resolves once the new version is live.
const brain = new BrainBox({ apiKey, project: name });
await brain.ingest({ text: 'Orders older than 30 days are written off and not refunded.' });
// 3. Ask a question. `intent` is the question in plain words.
const brief = await brain.recall.research_task({ intent: 'What is the returns policy for old orders?' });
console.log(brief);
Full reference: the SDK reference, the npm package page, or the README as plain text at https://unpkg.com/@brainbox-labs/sdk/README.md.https://ctx.brainbox-ai.app/api/org-mcp for every project in your org, or /api/mcp with a project key for one Brain. See the MCP reference for endpoints, sign-in and tools. On the org endpoint, an org with no projects gets a next step from list_projects; call create_project to make one or load_sample_brain to start from a sample Brain.npx -y @brainbox-labs/cli@latest initCLI reference.