Problem
Desktop apps need instant, private search that works offline. Users expect results as they type, and a desktop app can’t assume a fast connection - or any connection at all. Round trips to a search service add latency you can feel and break the moment the network does.Approach
Keep the index on the device and query it in-process from the main process. Search becomes a local function call rather than a network request, so it stays sub-10 ms and keeps working offline. The index persists to the user data directory and syncs in the background when a connection is available.Architecture
- Main process owns a Moss client
- Renderer calls main via IPC for index/query
- Index persisted to the user data directory
Code walkthrough (Main)
Result
Native-feel search with sub-10 ms latency, no network dependency, and data that stays on the user’s machine.Related
Sub-10ms knowledge retrieval
The retrieval pipeline in depth.
Local embeddings
Embed on-device for privacy.