What the platform does
When a user speaks, the platform:- Bootstraps a voice session through a managed provider (ElevenLabs Conversations API).
- Retrieves relevant facts, entities, and document chunks from the knowledge graph during the conversation via server-tool callbacks.
- Ingests new sources in the background — extracting facts, evaluating them, and promoting approved knowledge into the graph.
Tech stack
| Layer | Technology |
|---|---|
| Monorepo | pnpm 10.15+ with Turborepo |
| Runtime | Node.js >= 22, ESM throughout |
| Language | TypeScript in strict mode, tsup builds |
| Database | Supabase Postgres with pgvector for embeddings |
| Background jobs | Inngest for durable step functions |
| Voice | ElevenLabs Conversations API |
| Auth | Clerk JWT (frontend) + bearer tokens (service-to-service) |
| Frontend | Next.js (web), native Swift (iOS) |
| Validation | Zod schemas shared across all layers |
Two execution planes
The system separates work into two execution planes with different latency and safety requirements.Realtime plane
Voice session bootstrap, server-tool callbacks, and knowledge retrieval. Read-only against truth
tables (facts, entities, chunks, sources). Optimized for low latency.
Background plane
Source ingestion, fact extraction, evaluation, and patch application. Facts enter as candidates
and become active only after passing the eval gate.
DB query segregation
The@reflection/db package exposes three entrypoints that enforce access boundaries at the import level:
./queries/read— used by the realtime plane for retrieval queries../queries/write— used for mutations like conversation logging../queries/admin— used exclusively by background workers for ingestion, patch application, and evaluation writes.
admin imports from the realtime and API planes. File-scan tests provide an additional enforcement layer that cannot be disabled with inline comments.
Dependency direction
Packages never depend on apps. Apps consume packages only through published entrypoints.Learn more
Two-plane architecture
Why the system separates realtime inference from background learning.
Boundary matrix
What each plane is allowed and forbidden to do.
System invariants
Non-negotiable rules, complexity budgets, and release blockers.
Package map
Every app and package in the monorepo with its purpose and dependencies.
Knowledge graph
Temporal facts, the patch lifecycle, and the aspect taxonomy.
Decision records
25 ADRs documenting core architectural choices.

