> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reflections.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture decision records

> Index of all architecture decisions in the Reflections platform.

Architecture decision records (ADRs) capture the reasoning behind significant technical choices in the Reflections platform. Each record describes the context, the decision, alternatives that were considered, and the consequences of the chosen approach.

ADRs are numbered sequentially. Superseded decisions remain in the index for historical context, with their status clearly marked.

## Core architecture

Foundational decisions about repository structure, runtime standards, and the two-plane execution model.

<CardGroup cols={2}>
  <Card title="ADR-0001: Monorepo and package boundaries" href="/decisions/adr-0001">
    Enforce clear dependency direction and reduce cross-package coupling in a multi-app system.
  </Card>

  <Card title="ADR-0002: Runtime and build standards" href="/decisions/adr-0002">
    Standardize runtime and build behavior to minimize environment drift and packaging surprises.
  </Card>

  <Card title="ADR-0003: Two-plane system architecture" href="/decisions/adr-0003">
    Separate low-latency inference from asynchronous learning to preserve reliability and control
    risk.
  </Card>
</CardGroup>

## Data and storage

How the platform stores, evolves, and retrieves data including temporal facts, query segregation, and vector retrieval.

<CardGroup cols={2}>
  <Card title="ADR-0004: Primary data platform" href="/decisions/adr-0004">
    Use Supabase Postgres with pgvector and pg\_trgm for transactional, relational, and vector
    workloads.
  </Card>

  <Card title="ADR-0005: Temporal fact and patch lifecycle" href="/decisions/adr-0005">
    Preserve auditable memory evolution through temporal facts and gated patch promotion.
  </Card>

  <Card title="ADR-0006: DB query surface segregation" href="/decisions/adr-0006">
    Constrain data mutation capabilities by design-time import boundaries.
  </Card>

  <Card title="ADR-0007: Retrieval pipeline design" href="/decisions/adr-0007">
    Build evidence retrieval that combines semantic recall with graph context while remaining
    low-latency.
  </Card>
</CardGroup>

## Security and auth

Authentication, authorization, tenant isolation, and content safety across the platform.

<CardGroup cols={2}>
  <Card title="ADR-0008: Authentication and RBAC model" href="/decisions/adr-0008">
    Support both service-to-service and end-user auth while enforcing server-derived reflection
    roles.
  </Card>

  <Card title="ADR-0009: API architecture and authorization" href="/decisions/adr-0009">
    Keep API boundaries explicit with consistent route-level authn/authz and error semantics.
  </Card>

  <Card title="ADR-0015: Tenant isolation and database RLS" href="/decisions/adr-0015">
    Define defense-in-depth tenant isolation across API authorization and database row-level
    policies.
  </Card>

  <Card title="ADR-0017: Public share-link boundary" href="/decisions/adr-0017">
    Allow public reflection access via constrained anonymous sessions without exposing privileged
    surfaces.
  </Card>

  <Card title="ADR-0018: Ingestion source security" href="/decisions/adr-0018">
    Protect ingestion from hostile or oversized source inputs while preserving deterministic
    pipeline behavior.
  </Card>

  <Card title="ADR-0028: Clerk org canonicalization" href="/decisions/adr-0028">
    Canonicalize team-sharing onto Clerk Organizations using free-plan-compatible roles while
    preserving creator-private access semantics.
  </Card>
</CardGroup>

## Operations

CI/CD pipelines, observability, migration governance, and ingestion orchestration.

<CardGroup cols={2}>
  <Card title="ADR-0010: Ingestion orchestration" href="/decisions/adr-0010">
    Make source ingest retry-safe and recoverable while preserving evaluation-gated learning.
  </Card>

  <Card title="ADR-0011: Observability and tracing" href="/decisions/adr-0011">
    Provide actionable diagnostics without making core flows brittle.
  </Card>

  <Card title="ADR-0012: CI/CD quality and release gates" href="/decisions/adr-0012">
    Keep release quality high through automated, ordered validation gates.
  </Card>

  <Card title="ADR-0013: Migration governance" href="/decisions/adr-0013">
    Keep database schema evolution deterministic and verifiable across environments.
  </Card>
</CardGroup>

## Frontend and mobile

Client-side architecture, voice runtime, and mobile API contracts.

<CardGroup cols={2}>
  <Card title="ADR-0014: Frontend state and realtime" href="/decisions/adr-0014">
    Balance server-state correctness, local UI responsiveness, and realtime ingest visibility.
  </Card>

  <Card title="ADR-0019: Voice runtime provider" href="/decisions/adr-0019">
    Replace self-hosted voice agent with a managed conversation provider while preserving
    knowledge-graph authority.
  </Card>

  <Card title="ADR-0020: Expo mobile app (superseded)" href="/decisions/adr-0020">
    Expo mobile configuration contracts in a pnpm monorepo. Superseded by native Swift iOS app.
  </Card>

  <Card title="ADR-0021: Mobile API contracts (superseded)" href="/decisions/adr-0021">
    Centralize mobile-facing DTO schemas via shared Zod schemas. Superseded by native Swift iOS app.
  </Card>

  <Card title="ADR-0027: Agent routing and session orchestration" href="/decisions/adr-0027">
    Explicit three-mode session routing (interview, reflection, share) with mode-aware tool
    permissions and dynamic variable budgeting.
  </Card>

  <Card title="ADR-0031: Prompt pack runtime and public freshness" href="/decisions/adr-0031">
    Persisted prompt-pack authority, audience-scoped public runtime, gated artifact promotion, and
    freshness-aware public agent selection.
  </Card>
</CardGroup>

## Quality and governance

Lint enforcement strategy, rate limiting, content monitoring, and domain taxonomy.

<CardGroup cols={2}>
  <Card title="ADR-0022: Lint policy and enforcement layers" href="/decisions/adr-0022">
    Mechanically enforce architectural invariants through layered, defense-in-depth tooling.
  </Card>

  <Card title="ADR-0023: API rate-limit strategy" href="/decisions/adr-0023">
    Keep the in-process limiter for now with explicit key derivation and clear migration triggers.
  </Card>

  <Card title="ADR-0024: Loti content monitoring feed" href="/decisions/adr-0024">
    Ingest daily Loti content-monitoring results into Postgres for talent protection workflows.
  </Card>

  <Card title="ADR-0025: Aspect taxonomy and scoring" href="/decisions/adr-0025">
    Provide user-facing domain structure over the knowledge graph with hybrid classification and
    dual scoring.
  </Card>

  <Card title="ADR-0030: Knowledge graph relational overview" href="/decisions/adr-0030">
    Truth-first relational atlas with disclosure-first shell, bundled relationship edges, and
    deterministic structure-preserving sampling.
  </Card>
</CardGroup>

## Voice cloning

Voice clone pipeline, lifecycle authority, and readiness gating.

<CardGroup cols={2}>
  <Card title="ADR-0026: Voice clone pipeline (superseded)" href="/decisions/adr-0026">
    Voice cloning via outbox pattern with quality gating and metrics tracking. Superseded by
    ADR-0029.
  </Card>

  <Card title="ADR-0029: Voice clone lifecycle authority" href="/decisions/adr-0029">
    Durable attempt-driven lifecycle with sample-first product contract and multi-condition
    readiness gate.
  </Card>
</CardGroup>

## AI strategy

Vendor selection, model strategy, and AI capability boundaries.

<CardGroup cols={2}>
  <Card title="ADR-0016: AI vendor and model strategy" href="/decisions/adr-0016">
    Separate inference, embedding, and voice-runtime vendor responsibilities with configurable
    provider selection.
  </Card>
</CardGroup>
