Deploying Vector Search with SQLite
Continue with the workshop writeup
Open the canonical pages, recording, materials, and code repo.
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.
Hosted by
Alexey Grigorev
Chief Agent Officer at AI Shipping Labs
Software engineer and machine learning practitioner with 15+ years of experience building production ML systems. I focus on practical, production-grade ML and AI systems, from early prototypes to reliable systems in production.
I'm the founder of DataTalks.Club, a free community that connects tens of thousands of practitioners worldwide, and the creator of the Zoomcamp series, free, code-first programs that have reached 100,000+ learners globally.
At AI Shipping Labs, I'm building the kind of environment that would have accelerated my own career growth. After years of teaching at scale, I wanted something more focused: a space for action-oriented builders who want to turn AI ideas into real projects. The community gives members the structure, accountability, and peer support to ship practical AI products consistently, even alongside their main jobs.
More from AI Shipping Labs
Inference Engineering Book Club — Week 1
For this first session, finish Chapters 0, 1, and 2 (Inference, Prerequisites, Architecture). We kick off the weekly reading rhythm. Come with your questions and takeaways. Can't …
August 17, 2026
Inference Engineering Book Club — Kickoff
We are starting a book reading club, and the first book is Inference Engineering by Philip Kiely (Baseten). It is a book for engineers who want to understand the technologies behi…
August 10, 2026
LLM Zoomcamp 2026 office hours — Session 6
August 3, 2026