Back to stack index

Database

SQLite

Embedded DB for single-user local installs.

Short answer

SQLite is a small, fast database engine that stores an entire database in one file and runs inside the application, with no separate server. It is the most widely deployed database in the world and the natural choice for local and desktop AI apps. In our directory, Jan, GPT4All and AnythingLLM's default setup use SQLite to store conversations, settings and document metadata on the user's own computer. The current release is SQLite 3.54.1, from October 16, 2026; version 3.54.0 dropped support for Windows XP and added a diskused() function. SQLite is in the public domain, so it has no license terms at all. With the sqlite-vec extension it can also store and search embeddings, which lets a local AI app keep chats, documents and vectors in a single file that is easy to back up or move.

Latest release
SQLite 3.54.1, October 16, 2026
sqlite.org
License
Public domain
sqlite.org
Directory projects
Jan, GPT4All, AnythingLLM (default)
Project repositories
Vector search
sqlite-vec extension
sqlite-vec GitHub

Updated October 21, 2026How we evaluate tools

Official site

Directory projects (3)

  • Jan

    Offline-first desktop client for downloading and chatting with local models.

  • GPT4All

    Desktop runner for open weights on CPU-first hardware.

  • AnythingLLM

    Document chat and workspaces with optional vector DB and multi-user mode.

SQLite in open-source AI tools: the embedded database behind Jan, GPT4All and AnythingLLM in 2026

What SQLite is

SQLite, created by D. Richard Hipp in 2000, is a C library that implements a full SQL database. There is no server: the application reads and writes a single file through the library. Every phone, browser and most operating systems ship SQLite, and it is estimated to be in use in more than a trillion databases. The project's developers support it with a long-term commitment to keep the file format stable and readable through at least 2050.

For local AI apps, that model fits exactly. A chat app on your laptop needs to save conversations, model settings, prompts and document indexes. Running a database server for that would be heavy and fragile. A SQLite file in the app's data folder does the job with no setup.

Which directory projects use it

ProjectWhat it isWhat SQLite stores
JanDesktop app for local and cloud modelsThreads, messages, assistants and settings
GPT4AllDesktop app for local models with document chatChats and LocalDocs index metadata and embeddings
AnythingLLMDesktop and server document chatWorkspaces, users, chats; vectors go to LanceDB by default

n8n also uses SQLite by default for small single-instance installs, switching to PostgreSQL for production. Open WebUI uses SQLite by default and supports PostgreSQL for larger deployments.

SQLite 3.54

SQLite releases several times a year. Version 3.54.0 dropped support for Windows XP and added the diskused() function, which reports how much disk space tables and indexes use, useful for apps that need to show storage per workspace or prune old data. Version 3.54.1, on October 16, 2026, fixed bugs found after 3.54.0. Apps bundle SQLite, so you get new versions when the app updates, not by installing SQLite yourself.

Recent releases have also improved JSON support, with JSONB binary storage added in 3.45, which matters to AI apps that store model responses and tool-call arguments as JSON.

Vector search in SQLite

OptionWhat it isNotes
sqlite-vecExtension adding vector tables and KNN searchPure C, no dependencies; runs on desktop, mobile and in the browser
libSQL vectorsBuilt into Turso's SQLite forkNative vector column type and index
Separate vector storeLanceDB, Chroma, QdrantAnythingLLM pairs SQLite with LanceDB by default

sqlite-vec is the successor to the earlier sqlite-vss extension and has funding from Mozilla's Builders program. It stores vectors as float, int8 or binary values, supports metadata filtering, and handles hundreds of thousands of vectors comfortably on a laptop, which covers most personal document collections. For local RAG, it keeps the whole knowledge base in one portable file.

Write-ahead logging and concurrency

SQLite's default journal mode locks the whole database while writing. Most apps switch to write-ahead logging (WAL) mode, in which readers never block writers and writes are faster. Even in WAL mode, only one write happens at a time, so a busy multi-user server can hit "database is locked" errors. Desktop apps with one user never notice. For self-hosted servers such as Open WebUI or n8n with a team of users, SQLite is often fine up to a few dozen active users; beyond that, switch to PostgreSQL.

Backing up local AI data

Your chats, prompts and settings in Jan, GPT4All or AnythingLLM live in SQLite files in the app's data folder. To back them up:

  1. Close the app, then copy the data folder, including any -wal and -shm files.
  2. Or, while it runs, use sqlite3 app.db ".backup backup.db" for a consistent copy.
  3. Store backups outside the app folder, since uninstalling some apps removes it.

Because everything is in files, moving to a new computer is copying the data folder across.

Hosted and replicated SQLite

ServiceWhat it does
TursoHosted libSQL with replicas close to users and per-tenant databases
Cloudflare D1SQLite databases for Cloudflare Workers
LitestreamStreams SQLite changes to S3-compatible storage for continuous backup
LiteFSReplicates SQLite across servers, from Fly.io

Some AI app builders use one SQLite database per user or per agent, which isolates data neatly and makes deleting a user's data as simple as deleting a file.

When to move from SQLite to PostgreSQL

SignWhy
"Database is locked" errorsToo many concurrent writers
More than one app serverSQLite files cannot be shared safely over network storage
Need for managed backups and replicasPostgres tooling is more mature for servers
Very large vector collectionsPostgres with pgvector or a vector database scales further

Most projects that default to SQLite document the switch: set a database URL environment variable and run migrations. Export your data first, since migrations rarely copy existing SQLite data automatically.

SQLite in the browser and on phones

SQLite also runs in web browsers through an official WebAssembly build, storing data in the Origin Private File System. Paired with sqlite-vec and an in-browser embedding model from Transformers.js, a web app can index and search a user's documents without sending anything to a server. On phones, SQLite is built into both iOS and Android, which is why mobile AI apps that run small models on the device usually store chats and document indexes in it. The same database file format works everywhere, so a desktop app can sync a SQLite file to a phone app without conversion.

Performance tips for local AI apps

Large chat histories and document indexes can slow a SQLite database if it is never maintained. Apps should create indexes on columns they filter by, such as conversation ID and timestamp, run PRAGMA optimize periodically, and use VACUUM occasionally to reclaim space after deleting old chats. Batching many inserts into one transaction, for example when indexing a folder of documents, is many times faster than committing each row separately. If an app feels slow when opening long conversations, the database file size is a good first thing to check.

Privacy

SQLite files are not encrypted by default. Anyone with access to your computer's user account can open your chat history with any SQLite viewer. If that matters, use full-disk encryption, which modern operating systems provide, or an app that supports encrypted databases through SQLCipher.

Inspecting the data

Because the format is open, you can query your own AI app data directly. Open the database with the sqlite3 command-line tool, DB Browser for SQLite or Datasette, list tables with .tables, and run SQL to count messages, export conversations or find a lost prompt. Open a copy rather than the live file, and never edit tables while the app is running.

Related: PostgreSQL stack, Electron stack, Ollama stack, Qdrant stack, Stack index.

Frequently asked questions

Why do local AI apps use SQLite instead of PostgreSQL?

SQLite needs no installation or server process; it is a library inside the app and a file on disk. That makes desktop installers simple, keeps everything on the user's machine, and means backing up your chats is copying one file. PostgreSQL is better when many users or servers write at once.

Can SQLite do vector search?

Yes, with extensions. sqlite-vec, by Alex Garcia, adds vector tables and similarity search in a small C extension that runs anywhere SQLite does, including browsers through WebAssembly. It suits local RAG over personal documents. libSQL, Turso's fork, also has built-in vector search.

Where does AnythingLLM store its data?

By default in a SQLite database in its storage folder, alongside LanceDB files for vectors. Server deployments can switch the main database to PostgreSQL.

Is SQLite safe for a multi-user self-hosted app?

For small teams, often yes. With write-ahead logging, SQLite handles many readers and one writer at a time well. If you see 'database is locked' errors under load, or need several app servers, move to PostgreSQL.

How do I back up a SQLite database safely?

Use the sqlite3 command's .backup command or VACUUM INTO, which produce a consistent copy while the app runs. Copying the file directly while the app is writing can produce a corrupt backup unless the app is stopped.

Sources

  1. SQLite release history
  2. SQLite copyright (public domain)
  3. sqlite-vec on GitHub
  4. Appropriate uses for SQLite