Domain: UI surfaces
Canonical rule: Product UI lives under `src/routes/`. Mutations from the browser use native fetch to explicit +server.ts routes (per project guardrails), not ad-hoc server functions from client bundles.
CompetingSystems
- Demo routes vs product: `src/routes/demo/` contains Paraglide and Playwright demos — not the memory product surface. Prefer `capture`, `memory`, `chat`, `activity`, `settings` for product behavior.
Route map (high level)
Each entry: Purpose / Owns (user-visible concern) / Key server load (if any).
- `/` — Landing / home. Load: `+page.server.ts`.
/capture— Primary thought capture and post-capture edit UI. New submits use the client capture queue (capture-queue.md); editsfetch/api/capture/edit. Optional grounding check-in cards. Load: `capture/+page.server.ts`./memory— Memory hub (bottom nav). Secondary nav: Graph (default), Embeddings (?view=embeddings), Timeline (/memory/timeline), Notes (/memory/notes). Legacy/graph,/timeline,/notesredirect here./chat— Memory assistant UI (agent tool loop:retrieve_thoughtsthen inline compose; thought CRUD + Notes tools) backed by `/api/chat` and session routes./activity— Usage / activity views. Load: `activity/+page.server.ts`./settings— User settings (language, theme, LLM provider, push notifications, onboarding restart). Load: `settings/+page.server.ts`./api-keys— API key management UI. Load: `api-keys/+page.server.ts`./login,/register— Auth flows./eval— System evaluation harness (dev only): QA catalog and runs.
API routes (browser or MCP)
- Documented in ingestion and retrieval domain maps; UI typically hits
/api/capture/*,/api/retrieval/search,/api/chat/*,/api/entities/*,/api/thoughts/*as implemented. When adding a new button, trace to the matching+server.tsand update the relevant domain map. - PWA / push: manifest at
static/manifest.webmanifest; service worker `src/service-worker.ts` (push /notificationclick+ capture queue Background Sync). Client registration in `src/routes/+layout.svelte`. Push APIs:/api/push/subscribe,/api/push/unsubscribe,/api/push/test,/api/push/vapid-public-key(requiresVAPID_*env vars). - Capture queue (canonical): capture-queue.md — IndexedDB queue, layout runner, service worker Background Sync, queue list UI, ingest step indicator.
Components
- Reusable UI: `src/lib/components/` (shadcn-svelte under
ui/per AGENTS.md).