Brain Docs
Run

Getting it up

Run it locallyConfiguration

Operating it

ObservabilityBackups and recoverySecurityScaling and limits

Reference

Brain/Docs
✦ ASKBrain on GitHubDashboard
RunRun

Run

Operating Brain yourself — the two processes, the platform it requires, the memory it needs, and the three things it refuses to start without.

PURPOSE

Everything here is about running the engine yourself. There is no public hosted endpoint yet, so self-hosting is the only way to run Brain today — once it is serving, the integration recipes are in Build.

What you are running

Two processes, and it is worth being clear which does what.

brain-db — the database

One Rust binary. Speaks the BRN0 binary wire protocol over TCP. Memories, the typed graph, the HNSW index and the WAL all live here. It holds no provider credential of its own.

brain-edge — the HTTP surface

Serves the /v1/* JSON API in front of the database, and serves the credential broker that brain-db resolves per-namespace LLM grants from. The same binary can be split so those two jobs run in separate processes.

Both images are published:

ghcr.io/arc-labs-ai/brain-db:0.4.0
ghcr.io/arc-labs-ai/brain-edge:0.4.0

You need the edge for HTTP, and for extraction to resolve credentials at all. You do not need it to run the database and talk to it with an SDK over the wire protocol — but a keyless deployment extracts entities and no statements.

What it needs

Linux, kernel 5.15 or newer. Brain depends on io_uring, O_DIRECT, madvise and fallocate. macOS and Windows are not supported — use the container. The CPU must be x86_64 with SSE 4.2, or ARM64 with the CRC32 extension.

Under Docker you need both:

--security-opt seccomp=unconfined
--ulimit memlock=-1

Docker's default seccomp profile blocks io_uring_setup, io_uring_enter and io_uring_register even on a new-enough kernel, so an unconfined — or custom io_uring-allowing — profile is mandatory. Without it the shard executor fails to start, and the failure looks like a startup hang rather than a permission error.

Give the Docker VM about 12 GiB

The full capability stack loads three models into RAM: the embedder (~130 MiB), the reranker (~1.1 GiB) and the GLiNER classifier (~590 MiB). With less headroom the shard spawn OOMs while loading the reranker, which presents as the container dying partway through boot rather than as a clear out-of-memory message.

Mount two volumes, not one — the data directory and the model cache:

-v brain-data:/var/lib/brain/data
-v brain-models:/var/lib/brain/models

Without the model volume every restart re-downloads the models.

What it refuses to start without

Fail-closed by design — the server would rather not come up than come up wrong.

SettingWhy
[llm.broker] urlCredentials resolve per namespace. A shard with no broker could never resolve one for any namespace. [llm] api_key is not a substitute — see below
[admin] tokenThe admin plane mints and revokes keys. It will not run unauthenticated

Plus, at connection time: a resolvable API key. There is no anonymous mode and no config flag to add one.

[llm.broker] service_key — Brain's identity to the broker, and not a provider key — is not part of that gate: validation only checks that the broker URL is present and non-empty. Omit the service key and the server still boots, logs that it is unset, and then runs with the LLM tier degraded for every namespace, because nothing can authenticate the resolve call. Set it alongside the URL.

The broker check is configuration-only — the URL has to be set, not reachable — so brain-db starts standalone. Until a broker answers, writes still land: the pattern and classifier extractor tiers run, the LLM tier reports that it could not run, and you get memories and entities without extracted statements. That is a reported outcome, not a silent one, and not a failed write.

`[llm] api_key` does not do what it looks like

It is not the serving credential and it does not satisfy the boot gate. Brain's own config says it plainly: setting it does not make a keyless namespace work. It is a shard-wide fallback, read only by the consumers that still hold a process-wide client — today the entity disambiguator and the shard's model router. Extraction and write-time HyPE never touch it; they resolve per namespace through the broker. Leaving it empty costs the disambiguator's second opinion on ambiguous-band partial matches and nothing else — and the shard warns when that is the state it is in.

A stale `[llm] api_key` turns a working deployment into a boot failure

When the key is set, the server spends one 1-token completion against the provider at boot. A definitive rejection (401/403) is fatal — it logs LLM credential rejected — refusing to start and exits — because a key that cannot complete would make the shard-wide consumers silently produce nothing. A network failure or a provider 5xx only warns. When the key is absent that probe is skipped entirely. So an expired key left in the environment is strictly worse than no key: remove it rather than letting it rot.

Why Brain holds no provider key

Brain holds a namespace-scoped grant, never the tenant's provider key. Resolving a namespace tells Brain only which provider and model serves it — the reply carries no key material — and the completion then travels through the broker, which signs it upstream. That is a storage decision as much as a security one: customer keys stay out of this process's WAL, its snapshots and its backups. A keyless boot is therefore correct — the credential is not known until a write names its namespace. The two endpoints a broker has to serve are in Configuration.

See Namespaces for the model, and Security for what it means operationally.

Know the shape before you commit

Brain is single-node, with no replication. Node loss means restore from snapshot. Several decisions are pinned at deployment creation and cannot be revisited in place — the embedding model and the shard count among them. If you need multi-node or HA today, that is not this; read Scaling and limits before you build on it.

Run it locally

Docker, a compose file that actually connects, and how to check it is alive.

Configuration

Both processes' settings, env overrides, and what is pinned.

Observability

Health, readiness, the 74 Prometheus series, logs and tracing.

Backups and recovery

Snapshots, the WAL, and what each one does and does not cover.

Security

The auth model, the plane split, and hardening before exposure.

Scaling and limits

Shards, what single-node means, and the decisions you cannot undo.

Was this page helpful?

Namespace lifecycle

Plan, create, populate, and decommission a namespace — the tenant boundary. Tenancy is managed in the dashboard; per-namespace schema is declared over the wire.

Run it locally

Start brain-db from the published image, wire brain-edge to it correctly, mint a key, and confirm the whole path is serving.

On this page

What you are runningWhat it needsWhat it refuses to start withoutWhy Brain holds no provider keyKnow the shape before you commit
Suggest an editOpen in Playground