Skip to main content

semsift

Building blocks for hybrid retrieval: 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.2). 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.2

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.2
File Size Uploaded
semsift-0.0.2.tar.gz 36.9 kB Details

Built distribution (wheel)

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

Total release size: 77.9 kB

Release files / semsift-0.0.2.tar.gz

Download URL semsift-0.0.2.tar.gz
Size 36.9 kB
Tags Source
SHA-256 checksum
How to use checksums
09e23650cad5d31b035fd7bea602faa3a754f7a4b09fa7f33089dae14b9f4baa
BLAKE2b-256 checksum
How to use checksums
4304f9bfc3362727badb584ecdd9884c16d09e39806c002a1abd617463eba773
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 27, 2026.

Transparency log

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

Download URL semsift-0.0.2-py3-none-any.whl
Size 41.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35e78649f3392487cf1105eb7f3fddfe2f2d0f9e571996aaa09547c1f71f9f02
BLAKE2b-256 checksum
How to use checksums
ff8bab5e8498e660310f6b970e24a11d457b5f089550c2acb1fe7e29b531deba
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 27, 2026.

Transparency log

Release history Release notifications | RSS feed

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

This release

0.0.2 This release

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