dirsql-plugin-embeddings
A first-party dirsql plugin for
semantic search over files.
Installing the plugin loads the
sqlite-vec extension (for
vec_distance_cosine() and friends) and declares an embed() SQL scalar
function that turns TEXT or BLOB values into embedding vectors:
uvx --with dirsql-plugin-embeddings dirsql "
SELECT path
FROM (SELECT path, embed(content ->> 'abstract') AS emb
FROM 'arxiv-firehose/data/**/metadata.json')
ORDER BY vec_distance_cosine(emb, embed('local private models'))
LIMIT 10"
embed() is inert until a query calls it: no worker process is spawned and no
model is loaded for queries that never use it. On the first call, dirsql
spawns the plugin's worker process (dirsql-plugin-embeddings worker), which
serves every call of the invocation over stdin/stdout.
Model
Embeddings come from model2vec
(static embeddings — numpy + tokenizers, no torch), defaulting to
minishlab/potion-retrieval-32M.
The model downloads to the standard Hugging Face cache on the first ever run,
with progress on stderr when stderr is a TTY.
An optional second argument overrides the model per call — the id must be model2vec-loadable (sentence-transformers/torch models are out of scope):
SELECT embed('some text', 'minishlab/potion-base-8M')
Vector cache
Computed vectors are cached at ~/.cache/dirsql/embeddings/ (or
$XDG_CACHE_HOME/dirsql/embeddings/ when XDG_CACHE_HOME is set), keyed by
the SHA-256 of the value bytes plus the model identifier — changing either
recomputes; switching models never serves stale vectors. There is no
eviction: the directory is safe to wipe at any time; the only cost is
re-embedding. The cache never lives inside a queried tree — the worker
receives values, not paths, and writes nothing anywhere else.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dirsql_plugin_embeddings-0.1.12.tar.gz.
File metadata
- Download URL: dirsql_plugin_embeddings-0.1.12.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea83424a6ff614e82b4013ca61f0f4132d0947b19f25fe31ec6380a79d8d558c
|
|
| MD5 |
d403a1850d276bc79f26c79548c9914d
|
|
| BLAKE2b-256 |
d4f2772327dd9c029349a2f1e1c2ec574d6326f094baa9426880281605fbb76a
|
Provenance
The following attestation bundles were made for dirsql_plugin_embeddings-0.1.12.tar.gz:
Publisher:
release.yml on thekevinscott/dirsql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dirsql_plugin_embeddings-0.1.12.tar.gz -
Subject digest:
ea83424a6ff614e82b4013ca61f0f4132d0947b19f25fe31ec6380a79d8d558c - Sigstore transparency entry: 2423684019
- Sigstore integration time:
-
Permalink:
thekevinscott/dirsql@a31b4ddd18eda89305659578b86691893070f91b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/thekevinscott
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a31b4ddd18eda89305659578b86691893070f91b -
Trigger Event:
push
-
Statement type:
File details
Details for the file dirsql_plugin_embeddings-0.1.12-py3-none-any.whl.
File metadata
- Download URL: dirsql_plugin_embeddings-0.1.12-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fba5a12f3f9b06e607d13600aa9470fb77143f4fbfc153958e611c17909590cb
|
|
| MD5 |
a74305d93755f836bf30afec35ee1b3c
|
|
| BLAKE2b-256 |
8329f2f499f9d762cc43b97464935f19676dfc581adc761487de5f13d341e60f
|
Provenance
The following attestation bundles were made for dirsql_plugin_embeddings-0.1.12-py3-none-any.whl:
Publisher:
release.yml on thekevinscott/dirsql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dirsql_plugin_embeddings-0.1.12-py3-none-any.whl -
Subject digest:
fba5a12f3f9b06e607d13600aa9470fb77143f4fbfc153958e611c17909590cb - Sigstore transparency entry: 2423684028
- Sigstore integration time:
-
Permalink:
thekevinscott/dirsql@a31b4ddd18eda89305659578b86691893070f91b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/thekevinscott
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a31b4ddd18eda89305659578b86691893070f91b -
Trigger Event:
push
-
Statement type: