Skip to Content

sdkMigrations

const sdkMigrations: Readonly<{ maxVersion: number; minVersion: number; sortedMigrations: Readonly<{ steps: MigrationStep[]; toVersion: number; }>[]; validated: true; }>

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

Combined migrations for all SDK storage modules.

These migrations handle database schema upgrades from any previous version to the current version. The SDK manages all migration logic internally, so consumer apps don’t need to handle version arithmetic or migration merging.

Minimum supported version: v2 Migrations from v1 are not supported. Databases at v1 require a fresh install.

Migration history:

  • v2 → v3: Added was_stopped column to history table
  • v3 → v4: Added modelPreferences table for settings storage
  • v4 → v5: Added error column to history table for error persistence
  • v5 → v6: Added thought_process column to history table for activity tracking
  • v6 → v7: Added userPreferences table for unified user settings storage
  • v7 → v8: BREAKING - Clear all data (embedding model change)
  • v8 → v9: Added thinking column to history table for reasoning/thinking content
  • v9 → v10: Added projects table and project_id column to conversations
  • v10 → v11: Added media table for library feature, added file_ids column to history
  • v11 → v12: Added chunks column to history table for sub-message semantic search
  • v12 → v13: Added parent_message_id column to history table for message branching
  • v13 → v14: Added feedback column to history table for like/dislike on responses
  • v14 → v15: Replaced memories table with memory_vault table for persistent memory vault
  • v15 → v16: Added scope column to memory_vault table for memory partitioning
  • v16 → v17: Added image_model column to history table for AI-generated image model tracking
  • v17 → v18: Added vault_folders table (with scope) and folder_id column to memory_vault for folder organization
  • v18 → v19: Added user_id column to memory_vault for multi-user server-side scoping
  • v19 → v20: Added index on updated_at column of memory_vault for efficient since-based filtering
  • v20 → v21: Added embedding column to memory_vault for persisted embedding vectors
  • v21 → v22: Added is_system column to vault_folders for default system folders
  • v22 → v23: Added conversation_summaries table for progressive history summarization
  • v23 → v24: Added context column to vault_folders for LLM-generated folder summaries
  • v24 → v25: Added saved_tools table for user-saved display apps exposed as LLM tools
  • v25 → v26: Added app_files table for LLM-generated app source files (HTML/CSS/JS)
  • v26 → v27: Added tool_call_events column to history for reconstructing tool call history
Last updated on