SOMA docs
Overview

Monorepo map

What each workspace does and how they depend on each other.

WorkspaceKindPurpose
apps/web (@soma/web)AppNext.js 15 App Router — the only deployable. Chat, entities, timeline, graph, settings, all API routes.
apps/bot (@soma/bot)Lib + dev-only pollingExports the grammY Bot instance used by apps/web/api/telegram/webhook. pnpm --filter @soma/bot dev runs long polling for local dev (no public URL needed).
apps/docs (@soma/docs)AppThis site. Astro + Starlight. Deploys to Cloudflare Pages.
apps/mobile (@soma/mobile)AppExpo RN + NativeWind (early stub).
packages/agent (@soma/agent)LibMastra agents, prompts, memory, Inngest workflow functions, observability.
packages/tools (@soma/tools)LibThe tool registry — memory_*, search_*, graph_*, schedule_*, external/*.
packages/db (@soma/db)LibDrizzle schema, migrations, RLS SQL, integration tests.
packages/core (@soma/core)LibZod schemas for entities, edges, events, facts, sources.
packages/ui (@soma/ui)Libshadcn primitives, design tokens (dark-first warm amber).
packages/api-client (@soma/api-client)LibTanStack Query hooks wrapping server actions.
packages/config (@soma/config)LibShared tsconfig, ESLint flat configs, Vitest config.

Dependency graph

flowchart TB
  core["@soma/core<br/>zod schemas"]
  db["@soma/db<br/>drizzle + rls"]
  tools["@soma/tools"]
  agent["@soma/agent"]
  ui["@soma/ui"]
  api["@soma/api-client"]
  web["apps/web<br/>(single deployable)"]
  bot["apps/bot<br/>(exports bot)"]

  core --> db
  core --> tools
  db --> tools
  tools --> agent
  agent --> bot
  agent --> web
  bot --> web
  ui --> web
  api --> web
  core --> ui

Invariants

  • No workspace imports upward (e.g. packages/tools never imports apps/web).
  • apps/web is the only production deployable.
  • apps/bot is simultaneously a workspace library (re-exporting bot) and a dev-only runnable for polling.
  • packages/config has no siblings that depend on its dist/ — everything consumes the raw .mjs / .json files via workspace symlinks.