Skim: My BYOK AI Email Client for Windows Skim, a new BYOK (Bring Your Own Key) AI email client for Windows, achieves an installer under 5 MB by optimizing dependencies and compiler flags, using Tauri 2 to leverage the system WebView2. The app features an LLM agent loop for multi-step email retrieval via tool-calling, supports Anthropic, OpenRouter, or local Ollama, and implements three-layer security including HTML sanitization with ammonia, sandboxed iframes, and stripped remote images. It is strictly offline-first with SQLite FTS5 search and bm25 ranking. Skim: My BYOK AI Email Client for Windows Technical Deep Dive: Keeping it Lean The biggest challenge wasn't the UI, but the binary size. I managed to get the installer under 5 MB by obsessing over dependencies and compiler flags. For example, using panic = "abort" stripped about 6 MB of unwind tables. I also stripped out redundant crypto libraries to avoid dead weight. Here is a snippet from my Cargo.toml showing how I handled the feature flags to save space: rustls = { version = "0.23", default-features = false, features = "ring" } aws-lc-rs would compile a second, unused crypto library. ~2 MB of dead weight. Since I used Tauri 2, the app leverages the system WebView2 rather than bundling a whole browser, which keeps resource consumption incredibly low. AI Workflow & Security Instead of a basic RAG /en/tags/rag/ implementation, I built an LLM agent loop for the "Ask your inbox" feature. The model uses tool-calling with search emails , read email , and fetch url to perform multi-step retrieval, providing citations back to the original emails. You can hook this up to Anthropic, OpenRouter, or a local Ollama instance. Security is handled by treating HTML as hostile. I implemented a three-layer defense: 1. Sanitization: Using ammonia in Rust to clean markup before it hits the IPC boundary. 2. Sandboxing: Rendering emails in an iframe with no allow-scripts and a strict CSP. 3. Privacy: Remote images are stripped by default to block silent trackers. Performance Architecture The app is strictly offline-first. Every action archiving, deleting, starring is wrapped in a single SQLite transaction and pushed to an operation queue. This allows the UI to update instantly while the server syncs in the background. For search, I'm using SQLite FTS5 with bm25 ranking, ensuring that searching through thousands of emails is instantaneous even without an internet connection. If you're looking for a lightweight, keyboard-driven alternative to Outlook, this is a great way to integrate your own LLM into your mail flow. https://skim-tech.com Next Topcoat: A Full-Stack Rust Alternative to Next.js → /en/threads/2629/