Skip to main content

semsift

Building blocks for hybrid retrieval: find files, chunk text, embed it, store vectors and a keyword index together in SQLite or memory, search both, fuse the ranked results and rerank them. It retrieves and ranks; it never generates text.

Status: Implemented, not yet released. See docs/design.md for the blocks and their contracts, and docs/features.md for what was taken from other projects.

import sqlite3

from semsift.embed import StaticEncoder
from semsift.search import KeywordSource, Search, VectorSource
from semsift.store import Field, Item, Store

conn = sqlite3.connect(":memory:", isolation_level=None)
store = Store(conn, "notes", [Field("source", "text")],
              encoder=StaticEncoder("minishlab/potion-base-8M"))

items = [Item(1, "Rent is due on the first of the month.", {"source": "lease.md"}),
         Item(2, "The boiler service is booked for Tuesday.", {"source": "home.md"})]
vectors = store.embed(items)          # encode before opening the transaction
conn.execute("BEGIN")
store.upsert(items, vectors)          # the store never commits; you do
conn.execute("COMMIT")

search = Search(store, sources=[VectorSource(store), KeywordSource(store)],
                citation=("source",))
for hit in search.run("when is rent due", k=1).hits:
    print(hit.citation["source"], hit.text)

pip install semsift includes the static (model2vec) encoders. Extras add the rest: onnx, webgpu, and tree-sitter for syntax-aware chunking.

Development

uv venv .venv && uv pip install --python .venv/bin/python -e ".[onnx,tree-sitter]"
HF_HUB_OFFLINE=1 .venv/bin/python -m unittest discover -s tests -t .
.venv/bin/python benchmarks/run.py

To use an unreleased semsift from another project, depend on the checkout (uv add --editable ../semsift, or pip install -e ../semsift), or build it (uv build) and install the wheel from dist/.

Releasing

The version lives only in semsift.__version__. Bump it, commit, and push a matching tag (v0.0.4). The release workflow runs the tests, builds, refuses to publish unless the tag, __version__, the sdist and the wheel agree, publishes to PyPI through trusted publishing, and creates the GitHub release. PyPI must list this repository's release.yml as a trusted publisher for the semsift project.

Release files for semsift 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for semsift 0.0.4
File Size Uploaded
semsift-0.0.4.tar.gz 42.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for semsift 0.0.4
File Interpreter ABI Platform
semsift-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 89.1 kB

Release files / semsift-0.0.4.tar.gz

Download URL semsift-0.0.4.tar.gz
Size 42.9 kB
Tags Source
SHA-256 checksum
How to use checksums
424df8351288ea3f7d6823aea1cff6d9d248695ded54d28a008272f8af16872c
BLAKE2b-256 checksum
How to use checksums
f2e52866e1eb5711c9f47af73aaf9e9ed090a6313a1be70cc62f19b8f40a73c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release files / semsift-0.0.4-py3-none-any.whl

Download URL semsift-0.0.4-py3-none-any.whl
Size 46.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
850b3d7af2eacee306fce0f20464871ba95b6a233d6bc6127dba3147c6294df2
BLAKE2b-256 checksum
How to use checksums
1cfedf5958b5ab70f7f1d782ad249bb12a58e4be4506858cd5f352ecb23ebfa5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page