Skip to Content

SDK_SCHEMA_VERSION

const SDK_SCHEMA_VERSION: 50 = 50

Defined in: src/lib/db/schema.ts:138 

Current combined schema version for all SDK storage modules.

Version history:

  • v2: Baseline (chat + memory tables) - minimum supported version for migrations
  • v3: Added was_stopped column to history table
  • v4: Added modelPreferences table for settings storage
  • v5: Added error column to history table for error persistence
  • v6: Added thought_process column to history table for activity tracking
  • v7: Added userPreferences table for unified user settings storage
  • v8: BREAKING - Clear all data (switching embedding model from OpenAI to Fireworks)
  • v9: Added thinking column to history table for reasoning/thinking content
  • v10: Added projects table and project_id column to conversations table
  • v11: Added media table for library feature, added file_ids column to history table
  • v12: Added chunks column to history table for sub-message semantic search
  • v13: Added parent_message_id column to history table for message branching (edit/regenerate)
  • v14: Added feedback column to history table for like/dislike on responses
  • v15: Replaced memories table with memory_vault table for persistent memory vault
  • v16: Added scope column to memory_vault table for memory partitioning
  • v17: Added image_model column to history table for AI-generated image model tracking
  • v18: Added vault_folders table and folder_id column to memory_vault for folder organization
  • v19: Added user_id column to memory_vault for multi-user server-side scoping
  • v20: Added index on updated_at column of memory_vault for efficient since-based filtering
  • v21: Added embedding column to memory_vault for persisted embedding vectors
  • v22: Added is_system column to vault_folders for default system folders
  • v23: Added conversation_summaries table for progressive history summarization
  • v24: Added context column to vault_folders for LLM-generated folder summaries
  • v25: Added saved_tools table for user-saved display apps exposed as LLM tools
  • v26: Added app_files table for LLM-generated app source files (HTML/CSS/JS)
  • v27: Added tool_call_events column to history for reconstructing tool call history
  • v28: Added source_chunk_ids, proof_count, source columns to memory_vault for auto-extraction provenance and supersession tracking
  • v29: Added entity + memory_entity tables for the W5 knowledge-graph retrieval lane
  • v30: Added event_time_start, event_time_end, event_time_kind columns to memory_vault for the W6 temporal retrieval lane
  • v31: Added user_id column to memory_entity for multi-user server-side scoping of the W5 graph retrieval lane
  • v32: Added pinned_at column to conversations for pinning chats to the top of the list
  • v33: Added embedding_model column to memory_vault so stale-model vectors are detectable and re-embeddable after an embedding-model change (null = legacy rows, grandfathered as compatible with the current model)
  • v34: Added topics_user_managed column to memory_vault so a memory whose entity links the user has taken manual control of is left alone by auto-extraction (null/false = auto-derived, the default)
  • v35: Added conversation_memory table recording which vault memories a conversation drew on, so the conversation-level Memories panel survives reload
  • v36: Added topics_extracted_at column to memory_vault — watermark of the last LLM topic-extraction pass, so the background topic worker re-extracts only memories edited since (updated_at > topics_extracted_at) instead of re-running the whole vault
  • v37: Added superseded_by + superseded_at columns to memory_vault for write-time supersession — a changed fact retires the stale one (points at the newer memory) instead of both surviving; superseded rows are excluded from recall/dedup by default
  • v38: Added topics_extracted_version column to memory_vault — the extraction logic version a memory was last stamped under. Bumping TOPICS_EXTRACTION_VERSION (new prompt/model) makes the worker re-extract every row whose stored version is behind, so topic-quality improvements propagate across the existing vault
  • v39: Added last_observed_at column to memory_vault (C3) — a re-observation watermark stamped each time retain() merges into an existing fact, kept distinct from updated_at (which merges preserve). Lets profile synthesis weight facts by recency of reinforcement rather than last edit.
  • v40: Added fact_type, archived_at, trust_tier columns to memory_vault for typed memory + decay + Tier-0 security. All nullable + plaintext, no backfill (null = legacy/untyped, active, un-screened — content is encrypted so in-migration classification is impossible; NULL = zero-risk, exact embedding_model precedent)
  • v41: Added visibility, twin_opt_in, published_at, geohash columns to memory_vault for the People Nearby cross-user visibility axis. Visibility is TWO-tier (private | public); null — and any unrecognised value — reads as ‘private’, so nothing pre-existing is ever published without an explicit visibility write
  • v42: Added topics, topics_updated_at columns to memory_vault so a memory’s topics become the DURABLE record and entity / memory_entity become a device-local index over it. Those two tables never sync (entity ids are locally generated), so a restored device used to receive “curated” / “already extracted” flags on memories with zero topic links and the graph recall lane stayed dead. topics carries the names across devices; topics_updated_at is a SECOND timestamp because every topic writer pins updated_at on purpose (recall’s recency multiplier) and both sync paths key on updated_at, so a topic-only change would neither upload nor merge
  • v43: Added a (is_deleted, created_at) index to conversations. Every conversation list read filters is_deleted and orders by created_at DESC, which previously meant a temp B-tree sort of the whole live set on every read. Structural only — no column added, no data rewritten
  • v44: Added origin column to history — provenance of a row, set by the producer that synthesised it (tool_result = the hidden [Tool Execution Results] message written from autoExecutedToolResults). The embedding sweep skips those rows: they are machine-readable API dumps that are never rendered, and chunking one cost 52 MB of vectors (620 chunks) against 0.2 MB of content. A content-prefix test cannot do this job — content is enc:v3: ciphertext by the time the sweep reads it, so provenance has to be recorded at write time. Deliberately NOT encrypted: the sweep that must honour it runs with no wallet context, and an unreadable flag would fail open. Existing rows stay NULL (= legacy, unknown provenance, embedded as before) with no backfill, matching the v37 read-time-fallback precedent
  • v45: Added media to memory_vault — the photo(s) a server-extracted memory came from, as JSON [{feed_item_id, object_key}]. Null on every row that did not come from a photo, which is all of them before this migration ran
  • v46: Added device-local memory_extraction_jobs outbox for restart-safe extraction. Additive (a single createTable, no backfill), so a v45 database upgrades cleanly. NOT reversible: WatermelonDB has no downgrade path, so rolling a release back past v46 after a device has run it resets that device’s local database. Relevant to OTA, where a JS-only rollback can land on a database the newer build already migrated
  • v47: Added failed_sessions, failed_head, failed_at to memory_extraction_jobs — the persisted poison count for a job’s head batch (how many worker sessions it failed in, which batch that count belongs to, and when the last one was counted, so sessions minutes apart count once). Without it the retry budget was in memory and reset on every turn, so one batch that could never extract blocked its conversation’s extraction forever. Additive, both nullable, no backfill: NULL reads as “never failed”
  • v48: Added kind, kind_value (encrypted) and level to memory_vault; level is backfilled from scope where SQL steps run
Last updated on