libsql-search 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/docs/API.md +3 -1
- package/docs/INDEXING.md +1 -1
- package/docs/MIGRATIONS.md +1 -0
- package/docs/TROUBLESHOOTING.md +38 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -26,11 +26,21 @@ npm install libsql-search @libsql/client
|
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
deno add jsr:@logan/libsql-search npm:@libsql/client
|
|
29
|
+
deno add jsr:@logan/libsql-search npm:@libsql/client@^0.17.0
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
For npm usage, the package requires Node `>=22.12.0`.
|
|
33
33
|
|
|
34
|
+
**On npm/pnpm**, the peer range is `@libsql/client ^0.15.0 || ^0.17.0`. Both lines are supported: every behavior this package depends on — `vector_top_k()`'s result shape, the vector index error wording that `search()` matches on, and transactional `batch()` rollback — is identical across them, so an existing `0.15.x` install does not have to move. There is no `0.16.x` line upstream, which is why the range is a disjunction rather than a span. The packaged build is smoke-tested against both arms on every release, at the newest release each arm admits (currently `0.15.15` and `0.17.4`).
|
|
35
|
+
|
|
36
|
+
**On JSR/Deno the range does not apply to you.** `deno.json` declares no dependency on `@libsql/client` — this package imports only its *types* — so the client you `deno add` separately is constrained by nothing on our side, and a plain `deno add npm:@libsql/client` will silently take whatever is newest, including a future major we have never tested. Deno also cannot express our range: `npm:@libsql/client@^0.15.0 || ^0.17.0` is a parse error, as is any `>=`/`<` span. Pin an arm yourself instead:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
deno add jsr:@logan/libsql-search npm:@libsql/client@^0.17.0
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Note for `0.17.x`: the client no longer exports `./package.json`, so `require("@libsql/client/package.json")` throws `ERR_PACKAGE_PATH_NOT_EXPORTED`. Nothing in this package reads it, but tooling of yours that inspected the client manifest by specifier needs a direct `node_modules` path instead. See [`@libsql/client` version differences](./docs/TROUBLESHOOTING.md#libsqlclient-version-differences) for the other upgrade-visible change.
|
|
43
|
+
|
|
34
44
|
## Quick Start
|
|
35
45
|
|
|
36
46
|
This example uses the default local provider. Local embeddings run in-process after the initial model download and cache warmup; they are not automatically air-gapped.
|
|
@@ -99,7 +109,7 @@ await search({ client, query, exact: true });
|
|
|
99
109
|
|
|
100
110
|
`exact: true` is the only way to guarantee exactness. Use it for small corpora, for correctness checks against the index path, and for tables that have no vector index.
|
|
101
111
|
|
|
102
|
-
Requirements: `vector_top_k()` and `libsql_vector_idx()` need a libSQL build with native vector support. The peer dependency is `@libsql/client ^0.15.0`, verified against `0.15.15`; remote Turso/libSQL servers must support vector indexes as well. See the [API reference](./docs/API.md#searchoptions) for full semantics, and [Indexing and operations](./docs/INDEXING.md) for tables created before the index existed.
|
|
112
|
+
Requirements: `vector_top_k()` and `libsql_vector_idx()` need a libSQL build with native vector support. The peer dependency is `@libsql/client ^0.15.0 || ^0.17.0`, verified against `0.15.15` and `0.17.4`; remote Turso/libSQL servers must support vector indexes as well. See the [API reference](./docs/API.md#searchoptions) for full semantics, and [Indexing and operations](./docs/INDEXING.md) for tables created before the index existed.
|
|
103
113
|
|
|
104
114
|
## Providers
|
|
105
115
|
|
package/docs/API.md
CHANGED
|
@@ -256,7 +256,9 @@ Search never falls back to the exact scan on its own. A silent fallback would tu
|
|
|
256
256
|
|
|
257
257
|
### Requirements
|
|
258
258
|
|
|
259
|
-
`vector_top_k()` and `libsql_vector_idx()` require a libSQL build with native vector support. The peer dependency is `@libsql/client ^0.15.0`; this behavior is verified against `@libsql/client` `0.15.15` with a local `:memory:` database.
|
|
259
|
+
`vector_top_k()` and `libsql_vector_idx()` require a libSQL build with native vector support. The peer dependency is `@libsql/client ^0.15.0 || ^0.17.0`; this behavior is verified against `@libsql/client` `0.15.15` and `0.17.4` with a local `:memory:` database. On both, `vector_top_k()` returns the matched rowids in an `id` column, libSQL's missing-index wording ("failed to parse vector index parameters") is byte-identical, and so is the dimension-mismatch wording that is passed through unchanged — so the index path and the diagnostics above behave the same on either line. The two lines share one embedded engine (`libsql` `0.5.29`), which is why the on-disk format and index semantics do not differ between them.
|
|
260
|
+
|
|
261
|
+
Coverage differs by layer, and is worth stating plainly: the packaged build is smoke-tested against **both** peer arms on every release, which covers table and vector-index creation. The full test suite — including the byte-exact assertions on the messages above — runs against the dev-pinned client, currently `0.17.4`. The no-vector-support case is the one message not reproducible against a local build on either version; it is asserted from a synthesized error rather than a measured one. Remote Turso/libSQL servers must also support vector indexes — that is a property of the server, not the client, and no minimum server version is claimed here beyond that requirement. A deployment without it fails the default path with an error saying so and naming `exact: true` as the remedy. Use `exact: true` against any deployment where vector index support is unavailable or unverified.
|
|
260
262
|
|
|
261
263
|
Result shape:
|
|
262
264
|
|
package/docs/INDEXING.md
CHANGED
|
@@ -174,6 +174,6 @@ Many projects wire indexing into a dedicated script and call it before their sit
|
|
|
174
174
|
## Runtime Notes
|
|
175
175
|
|
|
176
176
|
- local embeddings may download and cache a model on the first run
|
|
177
|
-
- Node users need `@libsql/client` installed alongside the package
|
|
177
|
+
- Node users need `@libsql/client` installed alongside the package, at `^0.15.0 || ^0.17.0`; the packaged build is smoke-tested against both arms (`0.15.15` and `0.17.4`), which covers table and vector-index creation. `batch()` rollback behaves identically on both at the contract level, though its error text differs — see [Version differences](./TROUBLESHOOTING.md#libsqlclient-version-differences). Upgrading the client is not a prerequisite for upgrading this package. Deno/JSR users are not covered by that range and should pin the client themselves — see [Install](../README.md#install)
|
|
178
178
|
- hosted providers send indexed or queried text to external services
|
|
179
179
|
- the repository validates package build and `deno check`, but indexing still depends on filesystem access
|
package/docs/MIGRATIONS.md
CHANGED
|
@@ -23,6 +23,7 @@ References:
|
|
|
23
23
|
- if dimensions stay the same but provider, model, endpoint, model revision, pooling, normalization, or input formatting changes, fully reindex anyway
|
|
24
24
|
- never mix two embedding spaces in one table
|
|
25
25
|
- prefer a parallel table migration because `indexContent()` replaces the whole target table, so an in-place rebuild leaves no way back to the old vectors
|
|
26
|
+
- upgrading `@libsql/client` is not one of these migrations. The client moves bytes; it does not define the embedding space. Moving between the supported `^0.15.0` and `^0.17.0` lines leaves stored vectors, table widths, and the embedding index untouched and needs no reindex. This is checkable rather than merely inferred: `libsql`, the embedded native engine that owns the on-disk `F32_BLOB` format and the vector index, resolves to `0.5.29` under both client lines — the client bump does not move it. See [`@libsql/client` version differences](./TROUBLESHOOTING.md#libsqlclient-version-differences) for the two client-side behaviors that do change.
|
|
26
27
|
|
|
27
28
|
In practice, this means:
|
|
28
29
|
|
package/docs/TROUBLESHOOTING.md
CHANGED
|
@@ -38,3 +38,41 @@ Common operational checks:
|
|
|
38
38
|
`createTable()`, `indexContent()`, and `search()`, and re-index if the stored
|
|
39
39
|
vectors are in the wrong space; see the
|
|
40
40
|
[Migration and reindexing guide](./MIGRATIONS.md)
|
|
41
|
+
|
|
42
|
+
## `@libsql/client` Version Differences
|
|
43
|
+
|
|
44
|
+
The peer range is `^0.15.0 || ^0.17.0`, verified against `0.15.15` and `0.17.4`.
|
|
45
|
+
There is no `0.16.x` line upstream. Everything this package depends on behaves
|
|
46
|
+
the same on both — `vector_top_k()` returns rowids in an `id` column, the
|
|
47
|
+
missing-index message this library rewrites ("failed to parse vector index
|
|
48
|
+
parameters") and the dimension-mismatch message it passes through unchanged are
|
|
49
|
+
both byte-identical, and `batch(..., "write")` still rolls the whole rebuild back
|
|
50
|
+
on failure — so upgrading the client is optional and neither direction requires
|
|
51
|
+
re-indexing. (The third message, the no-vector-support case, is not reproducible
|
|
52
|
+
against a local build on either version; see
|
|
53
|
+
[Requirements](./API.md#requirements).)
|
|
54
|
+
|
|
55
|
+
Two client-side differences are visible to callers on `0.17.x`:
|
|
56
|
+
|
|
57
|
+
- the client no longer exports `./package.json`. Reading it by specifier, as in
|
|
58
|
+
`require("@libsql/client/package.json")`, throws
|
|
59
|
+
`ERR_PACKAGE_PATH_NOT_EXPORTED`. Nothing in this package does that; if your own
|
|
60
|
+
tooling did, read the file through a direct `node_modules` path instead
|
|
61
|
+
- **constraint error codes lost the `_UNIQUE` suffix.** A duplicate slug that
|
|
62
|
+
reported `SQLITE_CONSTRAINT_UNIQUE` on `0.15.x` reports the broader
|
|
63
|
+
`SQLITE_CONSTRAINT` on `0.17.x`. This affects every caller on both query paths:
|
|
64
|
+
|
|
65
|
+
| | `0.15.15` | `0.17.4` |
|
|
66
|
+
| --- | --- | --- |
|
|
67
|
+
| `execute()` | `SQLITE_CONSTRAINT_UNIQUE: UNIQUE constraint failed: …` | `SQLITE_CONSTRAINT: UNIQUE constraint failed: …` |
|
|
68
|
+
| `batch(…, "write")` | `SQLITE_CONSTRAINT_UNIQUE: UNIQUE constraint failed: …` | `SQLITE_CONSTRAINT: SQLITE_CONSTRAINT: UNIQUE constraint failed: …` |
|
|
69
|
+
|
|
70
|
+
Note that the prefix is additionally **doubled on the `batch()` path only** —
|
|
71
|
+
that is the path `indexContent()` uses, so it is what surfaces as the `cause`
|
|
72
|
+
of an `IndexingError` with `phase: "replace"`. Your own `execute()` calls show
|
|
73
|
+
the single prefix. Both are cosmetic: the rollback and the `IndexingError`
|
|
74
|
+
contract are unchanged.
|
|
75
|
+
|
|
76
|
+
A log matcher or alert rule keyed on `SQLITE_CONSTRAINT_UNIQUE` will stop
|
|
77
|
+
matching after the upgrade, on either path. Match on `UNIQUE constraint failed`
|
|
78
|
+
instead — it is the one substring stable across all four cells above.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libsql-search",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Semantic search for static sites using libSQL/Turso with multi-provider embeddings",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.34.5",
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
"node": ">=22.12.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@libsql/client": "^0.15.0"
|
|
63
|
+
"@libsql/client": "^0.15.0 || ^0.17.0"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@huggingface/transformers": "4.2.0",
|
|
67
67
|
"gray-matter": "^4.0.3"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@libsql/client": "^0.
|
|
70
|
+
"@libsql/client": "^0.17.4",
|
|
71
71
|
"@rollup/plugin-commonjs": "^29.0.3",
|
|
72
72
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
73
73
|
"@types/node": "^24.13.3",
|