Analytics platforms sell your team a place to ask questions. BrainBox is for the teams building that place: an AI analyst inside your product, or an internal agent for your own team. It gives the agent the business meaning your schema doesn’t carry, separately for each customer if you need it.
Definitions, join paths, metrics, and rules, built from the schema and docs you already have. No months-long modeling project first.
Model a data source once and reuse it for every customer. Each customer adds their own definitions on top, and isolation is enforced on the server.
Corrections and context gaps flow back into the Brain, so the agent stops repeating the same mistake.
Your customers ask questions about their own data, and every customer is different. One calls a customer "active" after a first payment, another after thirty days of usage. One starts the fiscal year in February. Your agent needs a shared model of the sources you support, plus each customer’s own definitions, and the two can never leak into each other.
You already have a model, a warehouse, and a Slack channel full of data questions. You don’t want to move the team onto a new BI platform just to get context. You want the context inside the agent you’re building, over MCP or an SDK, next to the tools you already run.
Text-to-SQL rarely fails on syntax. It fails on meaning: the agent picks a plausible table, a plausible flag, and a plausible definition, then confidently answers a different question than the one asked.
Schema only
# “How many active customers do we have in EMEA?”
SELECT COUNT(*) FROM crm_accounts WHERE is_active = true AND region = 'EMEA';
crm_accounts is a nightly CRM mirror. Billing is the system of record.is_active is a sales flag, not the definition finance reports.region is the sales rep’s territory, not the customer’s billing country.With the Brain
→ recall_domain("active customer")
← Customer: billing.customers (system of record)
active: status = 2 AND churned_at IS NULL
source: RevOps policy doc
EMEA: billing_country → ref.regions
source: finance handbookSELECT COUNT(*) FROM billing.customers c JOIN ref.regions r ON r.country_code = c.billing_country WHERE c.status = 2 AND c.churned_at IS NULL AND r.region = 'EMEA';
Illustrative example. A better model can’t fix this. The knowledge was never in the schema.
Connect Postgres or Trino, your dbt project, and the docs that explain them, such as metric definitions, data dictionaries, and policy pages. BrainBox builds one model from all of them. Each source adds to the model instead of replacing it, and every fact keeps a link to the source it came from.
Customer, Invoice, and Subscription, each mapped to the table that backs it, with the keys and join paths that connect them. The agent stops picking the legacy table with the friendlier name.
What "active," "churned," and "settled" mean, written as conditions the agent can turn into a WHERE clause, with the doc each one came from.
Grain, expression, and time field for each shared measure, plus a metric-to-SQL compiler. If you already have dbt or MetricFlow definitions, import them.
Profiles (enum values, cardinality, null rate, format hints) and annotations for units, encodings, and caveats. The agent knows status 2 means active before it runs a query to find out.
The words your users actually type, such as "ARR," "logo," and "book of business," mapped to the entities and fields they mean.
Column-level lineage across the ETL boundary, recording what fed each column upstream. This helps when two columns look identical but aren’t.
For databases, BrainBox reads schema metadata and, if you opt in, column profiles (sampled statistics). Your experts review what ingestion proposes, and their edits survive the next re-ingest.
Your product supports a set of sources, such as Shopify, Stripe, or a standard ERP schema. Build a brain for each source once. Each customer gets a tenant that reads the shared brains it uses and writes only to its own private brain on top.
A tenant API key resolves on the server to that customer’s brain and the shared brains it may read. Nothing your agent passes as a parameter can reach another tenant.
When one customer’s correction applies to everyone using the same source, an admin can promote it into the shared brain. Agents can’t promote anything with their own tokens.
More on this pattern: multi-tenant agent context.
Questions like “why did mid-market retention drop in Q3?” take twenty queries, three dead ends, and a chart. An agent with a code sandbox can run that loop on its own. Without context, most of the loop goes to rediscovering your business: which customer table is real, whether refunds are already netted out, what status 4 means.
research_task
The Brain assembles the entities, metrics, rules, past findings, and saved procedures relevant to the question before the agent writes any SQL.
your sandbox
The agent writes SQL and Python, runs them against a read-only warehouse role, looks at the result, and decides what to try next.
recall_domain
When it reaches an unfamiliar term or table, it asks the Brain. It doesn’t run SELECT DISTINCT queries to guess what a column means.
save_wiki_page · create_learning
Findings are filed as a wiki page, and corrections become learnings. The next investigation starts from this one.
Every investigation starts from zero. The agent spends its first dozen steps on exploratory queries, and what it figures out is lost when the session ends. Next week, a teammate’s agent pays the same cost again.
Every step starts grounded, and every investigation leaves something behind: a finding in the Wiki, a corrected definition, a saved procedure for “how we investigate a retention drop.” Research builds on earlier research instead of repeating it.
BrainBox supplies the context and the memory, and the sandbox is yours. The guide covers the architecture, sandbox guardrails, the tool surface, what to write back, and how to tell whether it’s working.
When the agent is corrected, the correction is recorded. When it can’t find something, the gap is logged. Your team approves what changes, and the Brain absorbs it.
A user says “that’s gross, we report net.” The agent records it with create_learning. Once a reviewer promotes it, the Brain absorbs it.
report_context_gap files what the agent couldn’t find into a review queue that removes duplicates, so you fix the gaps users actually hit.
Definitions that recent events keep contradicting are flagged for review, so they don’t quietly go out of date.
Every change records what was added, by which source, and why. You can see exactly what moved and who approved it.
On the roadmap: evals grounded in the Brain, and the exact facts behind each answer returned with the answer. See what’s shipped and what isn’t on the Capability Map.
One project, a whole org, or one tenant’s brain plus the shared brains it may read. Works with Claude, ChatGPT, Codex, or your own orchestrator.
The same tools from your backend, for when grounding runs inside your product rather than through an agent.
Push a schema, run a connector, and inspect the Brain from the terminal or from CI.
brainbox-mcp serves SQL data tools alongside the Brain on a developer’s machine, which is the fastest way to prototype a data agent.
A text-to-SQL company uses BrainBox to give its structured-data agent the business context that the schema alone doesn’t carry: definitions, rules, and vocabulary.
Bring the agent you’re building. We’ll show you its context layer on your own schema and docs.