# sqlite-vec tutorial: code and real outputs

Prerequisites: Docker, Ollama on the host with `ollama pull nomic-embed-text`, and a `chunks.jsonl` in the folder named by `CHUNKS_DIR` (default `../data`). `kb.db` is produced by `load.py`; `offline.sh`, `update.py`, `dump_top.py` and `node/query.mjs` need it (and `qvecs.json` from `embed_queries.py`).
Images: `Dockerfile` (python:3.12-slim, `requirements.txt`) and `node.Dockerfile` (node:22-slim, `node/package.json`). `pip-freeze.txt` lists the Python pins.
`minimal.py` is the short example from the post (run with `OLLAMA_URL` set when Ollama is not on localhost); output in `minimal.out`.

Run order: `run.sh` runs everything in Docker (the Python steps, then Node, `offline.sh` and DuckDB). Scripts: `embed_queries.py` (caches query vectors from Ollama), `setup.py`, `load.py`, `sqlite3_cli.sh`, `query.py`, `filters.py`, `hybrid.py`, `update.py`, `dump_top.py`, `node/query.mjs`, `offline.sh` (+ `offline_query.py`), `duckdb_vss.py`.
`build_chunks.py` and `questions.json` are copied unchanged from the Chroma post. `build_chunks.py` was NOT run for this post.

Run date: 2026-11-08. Pins: `sqlite-vec` 0.1.9 (PyPI released 2026-03-31), Python 3.12.16 (`python:3.12-slim`), SQLite 3.46.1 (Debian build, used by both Python and the `sqlite3` CLI in the image), `requests` 2.32.3, `duckdb` 1.4.1 (`pip-freeze.txt`).
Node: `node:22-slim` (v22.23.4), `better-sqlite3` 13.0.3 (bundles SQLite 3.53.4), `sqlite-vec` 0.1.9 (`node-versions.out`). Docker 24.0.6.

Input: `chunks.jsonl` is NOT included (embeddings make it 3.4 MB). 304 rows, 52 pages of webcrawlerapi.com/docs, nomic-embed-text 768 dims,
sha256 7c62db9258ba7b33bc75bf3e0593b0a7ffc73d0b0fb11da68db0eb27ebe4e145 (same file as the Chroma post). The scripts read it from `/data/chunks.jsonl`
(`CHUNKS_DIR` in `run.sh`). Queries need Ollama on the host (`host.docker.internal:11434`) with the same model; query text is prefixed with `search_query: `.
The `kb.db` file (3,584,000 bytes) is not included.

The `*.out` files are the real output of the run. `ls -l` in `offline.sh` is cut to size and name.
