Behind the Scenes
Frugal AI, Harness Engineering, and system architecture behind Dori.
When engineers look under the hood of Dori, they find an application built with strict systems discipline: Frugal AI, Harness Engineering, zero native binary dependencies, offline-first execution, and graph-engineered AI workflows.
Dori was built from day one refusing to treat personal memory or AI interaction as an ephemeral, wasteful cloud service.
Key Technical Benchmark & Design Highlights
| Architectural Layer | Implementation Detail | Systems Benefit |
|---|---|---|
| Token-Conscious Engine | Frugal AI & Harness Engineering pipeline wrapping pre-LLM, in-flight, and post-LLM turns. | Up to 90% reduction in API token spend and 80% lower latency via prompt caching & zero-token bypass. |
| Engine Runtime | Replaced better-sqlite3 native bindings with Node 24 built-in node:sqlite. |
Zero native C++ binary dependencies. Engine packages as pure JS across all OS targets without cross-compilation builds. |
| Memory & Boot Latency | Engine daemon consumes <120 MB RAM with a cold boot time of <250 ms. | Instant responsiveness on desktop startup without heavy Electron overhead. |
| Token Economy | Markdown indexing, OCR, Whisper audio transcription, and hybrid search run at 0 API token cost. | Sub-millisecond search without spending LLM tokens on parsing or formatting. |
| State Consistency | Single-writer SQLite WAL (Write-Ahead Logging) mode with explicit BEGIN/COMMIT/ROLLBACK boundaries. |
Crash-safe atomic mutations even during unexpected lid closes or process restarts. |
Technical Deep Dives
- The Token-Conscious Engine: Frugal AI philosophy, Pre-LLM, In-Flight, and Post-LLM Harness Engineering.
- Graph Engineering: DAG topologies, zero-token edge contracts, fan-out/fan-in barriers, and cyclic verifiers.
- Alternatives Considered & Refused: Retrospectives on why we refused LanceDB, Cloudflare Workers, Electron, and
better-sqlite3. - Automated Triage & Confidence Thresholds: Confidence thresholds, severity states, and pattern absorption.
- Offline-First & Zero-Native Engine: Node 24 native SQLite, Tauri IPC,
./doriCLI, and vault synchronization. - LLM Cost & Context Optimization: Prompt caching, context pruning, model tiering (
flashvspro), and schema contracts. - Storage, Indexing & Hybrid Search: Content-addressable SHA-256 fingerprinting, SQLite FTS5 BM25, and local vector embeddings.