Knovum 為何選用 Tauri 2 + Vue 3,而非 Electron,打造本機優先 AI 知識空間
Why We Built a Local-First AI Knowledge Space with Tauri 2 + Vue 3 (Instead of Electron)
Knovum 團隊以 Tauri 2、Rust 和 Vue 3 打造開源、本機優先的桌面知識工作空間,結合無限 2D 畫布與裝置端 AI 整合。應用程式閒置時約使用 45–65MB 記憶體,並以 SQLite 和內嵌 LanceDB 儲存及搜尋資料;筆記等內容除非用戶明確要求,否則不會離開裝置。Knovum 目前為早期存取版,並已在 GitHub 開源。
When we set out to build Knovum—an open-source, local-first desktop workspace that combines an infinite 2D canvas with on-device AI synthesis—we faced an architectural fork in the road that every desktop developer eventually encounters:
Should we build on Electron, or take the plunge into Tauri 2 and Rust?
Today, almost every popular developer tool defaults to Electron. It’s mature, has an enormous ecosystem, and lets web developers build cross-platform apps in a weekend. But for a local-first knowledge management tool designed to run alongside IDEs, compiler jobs, and local LLMs, Electron brought severe trade-offs.
Here is why we chose Tauri 2 + Rust + Vue 3, what we built, and the architectural lessons we learned along the way.
1. The Real Cost of "Yet Another Electron App"
As developers, our daily workflow already involves running VS Code, Slack, Discord, and a browser. Each of these ships with its own bundled Chromium instance and Node.js runtime.
When your note-taking app or knowledge base consumes 600MB–1.2GB of RAM just sitting idle in the background, your laptop fans spin up during Docker builds, and battery life takes a noticeable hit.
With Tauri 2:
- Binary Size & Cold Start: Instead of bundling a 150MB Chromium binary, Tauri leverages the OS's native Webview (WebKit on macOS via WebKit2GTK / WKWebView, WebView2 on Windows). Cold startup is instantaneous.
- Resource Footprint: Knovum’s idle memory usage hovers around 45–65MB, rather than 800MB+.
-
Zero Bridge Overhead: When passing large document chunks and vector embeddings between the UI and storage, Rust native types and serialized IPC streams eliminate the serialization latency typical of Electron's
ipcRenderer/contextBridge.
2. The Engine: Rust + SQLite + Embedded LanceDB
In Knovum, privacy is a fundamental architecture requirement, not a marketing checkbox. Notes, meeting recordings, PDF highlights, and code snippets never leave the user's machine unless explicitly requested.
To achieve this entirely on-device, we designed a hybrid storage model in Rust:
-
Relational Metadata with SQLite:
- Structured metadata, card hierarchies, tags, and connections are managed via strict SQLite migrations.
- We utilize
PRAGMA journal_mode = WAL;and batched transactions, reducing thousands of record inserts from multiple minutes to single-digit milliseconds.
-
Embedded Vector Search with LanceDB:
- Rather than forcing users to spin up a Docker container with Qdrant, Chroma, or Milvus, we embedded LanceDB directly within the application.
- Embeddings generated via local Ollama models (such as
nomic-embed-textorqwen3-embedding:0.6b) are indexed locally into columnar arrow format, enabling sub-millisecond similarity queries with zero network egress.
3. Solving Local RAG’s Hidden Flaw: Citation Rot
If you have used retrieval-augmented generation (RAG) on editable documents, you've likely encountered citation drift:
- You ask a question about a project specification.
- The model answers and cites "Section 3, Paragraph 2".
- Tomorrow, you edit Section 3 to update an API parameter.
- The old citation now points to mutated text, presenting inaccurate provenance.
To fix this, Knovum implements a mutation-aware provenance engine. When document chunks are ingested, we capture immutable content-addressed span hashes. If an underlying note is mutated, existing citations visibly flag as detached or auto-realign with the updated span.
4. The Frontend: Vue 3 + Pinia + Infinite Canvas (Konva)
For the visual interface, we paired Vue 3’s Composition API with Konva for hardware-accelerated 2D canvas manipulation:
- 60 FPS Pan & Zoom: Users can pan, zoom, cluster cards, draw directed relational edges, and group concepts visually.
-
Open Standard Compatibility (.canvas): We chose not to invent a proprietary file format. Knovum natively supports the open JSON Canvas specification (
.canvas). Cards and links can be opened seamlessly in Obsidian or other compatible tools. - On-Device Whisper Transcription: Users can drop audio files (interviews, lectures, voice memos) directly onto the canvas. Native Whisper sidecars transcribe the audio into timestamped markdown cards locally on Apple Silicon / CUDA / CPU.
5. What We're Learning as an Open Source Project
Transitioning from an internal tool to a public open-source project taught us three key principles:
- Local-first users demand auditability: Being source-available and transparent about network requests builds immediate trust.
- Standards beat lock-in: Supporting JSON Canvas and standard SQLite schemas gave users confidence that their knowledge isn't locked in another proprietary silo.
- Performance is a feature: When a tool opens in 100 milliseconds and uses minimal RAM, developers actually keep it running all day.
Check It Out
Knovum is early-access and 100% open on GitHub. If you are interested in local-first software, Tauri 2 architecture, or spatial note-taking with private AI:
👉 GitHub Repository: https://github.com/madebyzan/knovum
We would love your feedback, PRs, and a ⭐️ if you find the project interesting!
來源:DEV Community · dev.to