Deploying Vector Search with SQLite
We take the FAQ agent from the End-to-End Agent Deployment workshop and change how it finds answers. That agent searched the FAQ with minsearch, an in-memory keyword index rebuilt from scratch on every boot.
We swap it for semantic vector search that lives in a single SQLite file. Then we host that file on Turso, so the data survives restarts on a free host. The app runs without Postgres, without a rented disk, and without a server billed while it sits idle. A coding assistant drives each step, and we include the prompts so you can reproduce the workflow with any agent.
The two changes
We make two moves, in order.
- Swap minsearch for
sqlitesearch. We replace keyword retrieval with semantic vector retrieval and store the index in one SQLite file instead of rebuilding it in memory. Embeddings come from a lightweight ONNX model, so PyTorch stays out of the dependency tree. - Host that SQLite file on Turso, a hosted libSQL service with a generous free plan that doesn't expire. The agent reads it through a local replica. The data survives restarts, and the searches stay fast.
The diagram shows the architecture:
We split the system into ingest and serve, which never run at the same time. Ingest is an offline job that fetches the FAQ and embeds every entry with the ONNX model. It then builds a vector index and writes it straight to Turso.
Serve is the running app. On boot it opens an embedded replica that syncs the data down from Turso once. Every search tool call then reads from that local copy.
The agent loop, the search tool, and the OpenAI call are unchanged from the previous workshop. Only what sits behind the tool is different.
I made the change for a practical reason. We deployed the previous workshop to Railway on a trial, and the trial ended. Most free tiers drop Postgres and persistent disk once the trial is over. That wipes anything stored on local disk at the next restart.
Turso keeps the data outside the host on a generous free plan. The app can move to any free platform and still find its vectors.
Links
Resources used here:
- End-to-End Agent Deployment - the workshop this one builds on.
- sqlitesearch - the vector search library, with the libSQL backend used here.
- LLM Zoomcamp ONNX embedder lesson - the source of the lightweight embedder.
Upgrade to Basic to access this workshop
- Full workshop overview
- Complete page list
- Step-by-step tutorial
- Cancel anytime
Tutorial pages
More from AI Shipping Labs
After the Interview: Offers and Negotiation
What happens after the interviews end: how to handle rejections without losing momentum, when to accept an offer, and how to negotiate salary with confidence.
September 16, 2026
The AI Engineering Field Guide
A data-driven guide to the AI engineer role: what the job involves, how the interview process works, and how to handle offers, based on 6,964 real job descriptions.
September 16, 2026
The AI Engineering Interview Process
What AI engineer interviews look like in practice: typical stages, what each round tests, how they differ from classic ML interviews, and how to prepare.
September 16, 2026