Architecture
How Retrace is built and how the pieces fit together.
Overview
Retrace is a local-first desktop app built with:
- Tauri (Rust) for the native macOS shell
- React for the frontend UI
- Bun for the backend server (API + processing)
- SQLite for all data storage (conversations, embeddings, config)
Everything runs on your machine. The Bun server starts when you launch the app and stops when you close it.
Project structure
retrace/
packages/
app/ Tauri + React frontend
server/ Bun/Hono API server
src/
routes/ REST API endpoints
consumers/ MCP, Chrome extension, ingest pipeline
db/ Drizzle ORM schema + migrations
docs/ Developer documentation sourcesData flow
Import/Sync sources
|
v
Bun API server (Hono)
|
v
SQLite database
|
+--> Segmentation (time-based chunking)
| |
| v
| Local LLM (summarization, topics, sentiment)
| |
| v
| Embeddings (vector search)
|
+--> React frontend (read + display)
|
+--> MCP server (Claude Desktop access)
|
+--> Embedded Claude chat (via Claude Code CLI)Key design decisions
Local-first: All data is stored in SQLite on disk. No cloud database, no accounts, no sync service. The app works offline.
Hono framework: The API server uses Hono, a lightweight web framework that runs on Bun. All routes return JSON.
Drizzle ORM: Database access uses Drizzle for type-safe queries and schema migrations.
Vector search: Embedding similarity search runs in-process within SQLite. No external vector database.
MCP integration: The MCP server exposes conversation data as tools that Claude Desktop (or any MCP client) can call. It runs as a stdio server.
Ports and processes
| Process | Port | What it does |
|---|---|---|
| Bun API server | 1420 | REST API for the frontend and extensions |
| Tauri app | - | Native window, spawns the Bun server |
| MCP server | stdio | Launched by Claude Desktop on demand |