The vertical stack

The hosted deployment is intentionally narrow. There is one place where customer data lives, one place where ingest runs, and one place where retrieval is answered.

urb-api          # MCP, REST, document upload, retrieval
urb-worker       # ingest orchestration, embeddings, lifecycle
sm-internal      # StructuredMerge ingest/delta service
postgres         # memories, embeddings, accounts, policy
pgvector         # vector index colocated with policy
object storage   # raw document versions and artifacts

All of the above can run on a single host for development, on a managed Postgres with separate compute for hosted production, or on an isolated VPS with local Postgres for a customer that requires its own stack.

PostgreSQL and pgvector

UrBrain commits to PostgreSQL with pgvector as the primary data platform. Memories, embeddings, accounts, workspaces, and retention policy live in the same database family, which keeps retrieval queries close to the permission checks that gate them and avoids synchronizing two systems of record.

pgvector handles cosine similarity with HNSW indexing. pg_trgm handles lexical recall on the same memory records. Hybrid retrieval fuses the two ranked lists with reciprocal rank fusion before applying scope and lifecycle filters.

Event sourcing for the write path

The write path is built on Eventide and a Message DB event store. Document uploads, ingest jobs, memory promotions, lifecycle transitions, and runtime-adapter events are all recorded as immutable streams. Read models — including the searchable memory index — are projections off those streams.

Operationally, that gives UrBrain a durable history of every change for audit, replay, and recovery, and lets new projections be added without rewriting upstream services. A future projection can re-derive a different shape of memory without disturbing the ingest path.

Internal services, single subscription

StructuredMerge runs as an internal service inside the deployment. Customers do not need a second subscription, second API key, or second product surface to get version-aware document memory: the ingest and delta engine is part of what UrBrain delivers. The same engine can later be exposed as a standalone API for teams that want it outside the memory product.

Deployment options

The hosted product runs as a multi-tenant deployment with workspace scoping enforced inside the data model. For customers whose documents cannot share storage with other customers, the same stack can be deployed as an isolated single-tenant environment with its own compute, database, object storage, and backup policy. The software does not change; the operational posture does.

The public website at ur-brain.tech is a static site served from Cloudflare Pages and is fully separate from the hosted application.