Semantic search engine upgrade: Integrated Apple Sentence Embedding with sqlite-vec (static), moving sorting into the database layer for faster responses and lower memory usage.
Smarter hybrid mode: Merged text and semantic results for higher relevance and more stable recall.
Enhanced Chinese search: Enabled FTS5 trigram tokenization for more accurate and faster CJK retrieval.
Improvements
OCR performance optimization: Downsamples large images to reduce UI lag and memory spikes.
Sync and database stability: Improved CloudKit batch submission and added automatic backup, integrity checks, and recovery mechanisms.
Memory optimization: Reduced memory usage from ~300MB to ~50MB.
Technical Changelog
Integrated sqlite-vec as a static component to avoid dynamic extension issues and improve startup reliability.
Moved search result sorting into the database layer to reduce data copying and intermediate memory usage.
Updated FTS5 configuration to use trigram tokenizer for better CJK support.
Compatibility & Behavior Notes
This release introduces no database schema changes and supports in-place upgrades.
All processing is performed locally with no data uploaded or stored remotely.
Upgrade Notes
All users are recommended to upgrade for significantly faster search, lower memory usage, and more stable syncing.
Database file validity check: Added isDatabaseFileValid() to verify that the database file exists and is readable before each operation.
Hardened withDB flow: Validate the database file before execution. If invalid or missing, the app logs a warning, notifies the user, attempts async recovery, and returns nil instead of crashing.
Safe SQL iteration: Replaced unsafe for-in iteration with failableNext() for PRAGMA and FTS queries to avoid fatal errors caused by try!.
Technical Notes
db.prepare(Table query) returns AnySequence<Row>, whose internal iterator uses try! and cannot be safely controlled externally.
db.prepare(String SQL) returns Statement, which allows safe iteration via failableNext().
Validating the database file before execution prevents most crashes caused by deleted or moved database files.
Compatibility & Behavior Notes
This release introduces no database schema or data format changes and supports in-place upgrades.
All processing remains local with no data uploaded or stored remotely.
Upgrade Notes
All users are strongly recommended to upgrade to prevent potential crashes and data corruption.