BrainDocs

Architecture

How Brain is structured — private client, Postgres, models, and live MCP tools.

Brain is a private work assistant on your host, not a public AI website and not a RAG chatbot that copies Slack or Snowflake into a vector index.

Three planes

Brain logical architectureSigned-in browser talks to Brain on dFlow Enterprise. Brain stores product data in Postgres, calls Command Code or Azure AI Foundry for models, and fetches live work data through stateless MCP.PEOPLESigned-in staffBrowser / Chat / Tools / Models / SchedulesHTTPSAPPLICATION - BRAIN ON DFLOW ENTERPRISENext.jsUI on :3000eve agent runtimeSessions, streaming, MCP, approvalsBetter AuthWorkspaces, roles, HITLPRODUCT DATAINFERENCELIVE TOOLSPRODUCT DATABASEOperator PostgresAccounts, chats, playbooks,schedules - not a copy of Slackor SnowflakeMODEL PLANECommand CodeDefault BYOKAzure AI FoundryCustom / private BYOASTATELESS MCPLive fetch at request timeClickUp, Slack, AsanaGmail, GitHubSnowflake, MongoDBMCP Toolbox, dFlowRybbit, BytebotWrites require in-chat approvalBrain owns accounts and transcripts. Work data stays in the source systems. Models are called at an endpoint the organization chooses.BRAIN LOGICAL ARCHITECTURE - DFLOW ENTERPRISE - AUGUST 2026
PlaneWhat lives thereWhat does not
Product data (Postgres)Accounts, transcripts, playbooks, schedulesCopies of Slack, ClickUp, or warehouse tables
ModelsCommand Code (default) or a custom OpenAI-compatible endpoint (Azure AI Foundry, Ollama, a company proxy, …)The Brain UI itself
Live tools (MCP)Current tasks, mail, deploys, SQL at request timeA stale search index inside Brain

The browser talks only to Brain. Brain stores its own product data, calls the model endpoint you choose, and reads or writes work systems through MCP (with approval on writes).

Runtime (production)

Browser → Next (:3000)
            ├─ Better Auth + Brain APIs → Postgres
            └─ /eve/v1/* (withEve proxy) → eve Nitro (:4274 loopback)

Expose 3000 (or your reverse-proxy target). Keep 4274 on loopback. Details: Self-hosting overview.

Models

  • Built-in — set COMMAND_CODE_API_KEY for the curated Command Code catalog (OpenAI-compatible chat completions). Workspace admins can turn individual built-ins off on /models so they leave that workspace's composer.
  • Custom — instance or workspace admins register any OpenAI-compatible base URL on /models, including Azure AI Foundry. Chat works without Command Code if a usable custom model exists for the workspace.
  • Brain does not train models. Fine-tuning and content filters belong at the model host (Foundry or equivalent). Native Anthropic Messages / Claude-as-provider is not wired.

See Models overview and Custom models.

Live tools, not RAG

Connections call the app now. If a tool is disconnected, Brain cannot answer from an old copy. Tokens are per signed-in user × workspace. See Connections.

Guardrails

  • Sign-in required; history in your Postgres
  • Workspaces isolate chats and MCP grants
  • Roles: instance admin; workspace owner / admin / member
  • Mutating MCP tools wait for in-chat approval in the default Auto posture; instance admins can choose Strict or Dangerous on Instance policies. Ask mode cannot call tools. A command policy still blocks high-risk shell and SQL. Auto and Strict also screen tool results before the model sees them.
  • Model keys and warehouse tokens stay on the host (.eve/), not in the browser

See Security and Approvals.

Deploy

Run the Docker image on Dokku / dFlow Enterprise (or any host that can run the Dockerfile). Operator Postgres is required — no SQLite fallback.

See Dokku and dflow.