Quickstart

Start with BrainBox in five minutes

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.

What BrainBox is

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.

1. Get an API key

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.

2. Pick a path

  • TypeScript SDK (code that calls BrainBox). Needs Node 24+ and an org key. This creates a project, ingests one sentence and asks a question about it; re-running is safe. Save the script as 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.
  • Hosted MCP server (an agent or framework that speaks MCP): connect to 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.
  • CLI (terminal, CI, ingest a database or a docs folder):
    npx -y @brainbox-labs/cli@latest init
    CLI reference.

Questions while you set up?

We onboard every new team directly.

Book a Demo