Architecture
Overview
┌─────────────────────────────────────────────────────────┐
│ recall.app (Tauri 2) │
│ │
│ ┌───────────────────┐ ┌────────────────────────┐ │
│ │ React frontend │ IPC │ Rust backend │ │
│ │ (Vite + TS) │◄────►│ (src-tauri/src/lib.rs)│ │
│ └───────────────────┘ └──────────┬─────────────┘ │
│ │ │
│ ┌─────────▼──────────┐ │
│ │ recall-core │ │
│ │ ┌────────────────┐ │ │
│ │ │ db (rusqlite) │ │ │
│ │ ├────────────────┤ │ │
│ │ │ embedder │ │ │
│ │ │ (fastembed) │ │ │
│ │ ├────────────────┤ │ │
│ │ │ search │ │ │
│ │ │ (cosine sim) │ │ │
│ │ ├────────────────┤ │ │
│ │ │ history │ │ │
│ │ │ (zsh/bash) │ │ │
│ │ └────────────────┘ │ │
│ └─────────────────────┘ │
└─────────────────────────────────────────────────────────┘
┌────────────────────────────────────────┐
│ recall CLI (cmdcpy binary) │
│ ~/.local/bin/recall │
│ → loads recall-core, queries same DB │
└────────────────────────────────────────┘
Crate Layout
| Crate | Path | Purpose |
|---|---|---|
recall-core | recall-core/ | Shared library: DB, embedder, search, history |
recall (lib) | src-tauri/ | Tauri app backend — exposes IPC commands |
recall (bin) | cmdcpy/ | CLI binary installed to ~/.local/bin/recall |
AI Model
Uses fastembed-rs with AllMiniLML6V2 (384-dimensional embeddings). Model files are cached in ~/.cache/fastembed/ after the one-time ~120 MB download.
Embeddings are stored as raw f32 LE bytes in the embeddings.vector BLOB. Search is linear cosine similarity scan — fast for typical library sizes (<10k commands).
IPC
Frontend calls Rust via @tauri-apps/api/core invoke(). All commands are registered in tauri::generate_handler![]. Payloads serialize with serde_json.
State
AppState holds:
conn: Mutex<Connection>— single SQLite connection (serialized writes)embedder: Arc<Mutex<Option<Embedder>>>—Nonewhile model is loading; set from background thread