Developer guide

Self-hosting and runtime modes

Understand Backend serve/work modes, database boundaries, and local Runtime responsibilities.

Backend

One Backend codebase has two modes. serve exposes the public HTTP, tRPC, and Agent gateway. work consumes GBrain/Minions queues and exposes no HTTP. Scale them separately in production while keeping versions aligned.

Databases

  • DRAPUB_DATABASE_URL stores DraPub domain data and, after consolidation, auth and billing.
  • GBRAIN_RUNTIME_DATABASE_URL stores pages, chunks, vectors, facts, and task queues.
  • During migration, legacy DATABASE_URL serves old Web auth and billing only. Do not expand it.

Runtime

The Go Runtime is an independent execution plane that connects outbound to Backend. It never accesses business databases or GBrain and does not copy Backend state machines.

Security

Separate database roles, object storage, and model secrets. Authenticate public AgentRun invocation with the shared secret. Preserve review gates and least privilege in self-hosted deployments.