sqliteai/sqlite-sync

CRDT-based offline-first sync for SQLite. Syncs automatically with SQLite Cloud, PostgreSQL, and Supabase. No conflicts, no data loss, no backend to build. For offline-first apps and AI agents.

What it solves

SQLite-Sync provides a way to turn a local SQLite database into an offline-first replica that automatically synchronizes with a remote server (such as SQLite Cloud, PostgreSQL, or Supabase). It eliminates the need for developers to build their own custom sync protocols or backend infrastructure to handle data consistency across multiple devices or AI agent instances.

How it works

The project uses Conflict-free Replicated Data Types (CRDTs) to ensure that updates made on different devices—even while offline—can be merged automatically and deterministically without data loss or manual conflict resolution. It includes a built-in network layer for communication and supports "Block-Level LWW" (Last-Write-Wins), which allows concurrent edits to different lines of text or markdown files to be preserved rather than overwriting the entire cell.

Who it’s for

  • App Developers: Those building offline-first mobile, desktop, or IoT applications (e.g., shared to-do lists, note-taking apps, or field data collection tools).
  • AI Agent Developers: Those creating agents that need to share state, memory, or knowledge bases across different instances without a central coordinator.
  • Enterprise Developers: Those building multi-tenant SaaS platforms or CRM systems requiring row-level security (RLS) to isolate user data.

Highlights

  • CRDT-based synchronization: Uses algorithms like Causal-Length Set and Delete-Wins to guarantee convergence.
  • Block-Level LWW: Specialized line-level merging for markdown and text columns.
  • Multi-platform support: Works across Linux, macOS, Windows, iOS, Android, and WASM.
  • Server-enforced RLS: Row-level security ensures clients only sync data they are authorized to access.
  • Plug-and-play backends: Compatible with SQLite Cloud, PostgreSQL, and Supabase.

Related

  • Project
  • Project
  • Project
  • Project
  • Dispatch