Deploying Vector Search with SQLite
Recording available with Main or above.
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 stays after restarts on a free host. The app runs without Postgres, without a rented disk, and without a server billed while it sits idle. We use a coding assistant for each step, and we include the prompts so you can reproduce the workflow with any agent.
The two changes
We make two changes, 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 stays after 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 the code 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
Job Hunt and Career
Getting an AI engineering job takes more than learning tools. We use real job descriptions to choose portfolio projects, tailor a CV, and find people who can introduce us to emplo…
November 10, 2026
Tracing a FAQ agent with Langfuse
We add Langfuse tracing to a FAQ agent, then turn its traces into reviewed evaluation examples. We start with the existing FAQ application, add the Cloud integration and repeat th…
November 4, 2026
Jev for LLM Evaluations
In the batch and flex workshop we built an eval for the FAQ agent and scored it with an LLM judge. Here we swap that judge for Jev, a model that returns typed decisions instead of…
September 22, 2026