SOMA docs

Welcome

Engineering handbook for SOMA — architecture, data model, agent stack, ops runbook.

SOMA is a personal AI assistant with knowledge-graph memory. This site is the engineering handbook: architecture, data model, agent stack, and ops runbook.

Where to start

Stack at a glance

RuntimeNode 22 · TypeScript 5 strict · pnpm 10 · Turborepo 2
AgentMastra on Vercel AI SDK · Claude Sonnet 4.5 (Opus 4.5 for synthesis)
EmbeddingsVoyage-3-large (1024d) + rerank-2
DBSupabase Postgres 16 + pgvector (HNSW) · Drizzle ORM
Queue / CronInngest Cloud
HostingVercel Pro · Supabase Pro · Cloudflare DNS
SecretsDoppler (project soma, config prod)
ObservabilityLangfuse · Sentry · PostHog · Axiom

Live surfaces

The four principles

  • One table per kind, not per noun. Every user-facing noun is a row in entities. New domain = new type, not a new migration.
  • Tools own writes. Every DB mutation flows through a Mastra tool. UIs and bots never touch the DB directly.
  • RLS on every table. user_id = auth.uid() policies on every table, even on single-user MVP.
  • Zod in @soma/core is the source of truth. One schema → backend validation + TS types + frontend forms.