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.

Metadata

Release files for semsift 0.0.6

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.6
File Size Uploaded
semsift-0.0.6.tar.gz 44.2 kB Details

Built distribution (wheel)

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

Total release size: 91.7 kB

Release files / semsift-0.0.6.tar.gz

Download URL semsift-0.0.6.tar.gz
Size 44.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5966d3d1f852deb344c3587c4ca008b570c68e5c773738baab01172815205c54
BLAKE2b-256 checksum
How to use checksums
cb9a7d246cab5c4a0a412ee665fa0f4e31538d9c6a8af9a2d43df00f4c95bf7b
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 29, 2026.

Transparency log

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

Download URL semsift-0.0.6-py3-none-any.whl
Size 47.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25937a55925bcb9ace521f51cade513def6eb3cb21e89c5b0bb6d758cc3975aa
BLAKE2b-256 checksum
How to use checksums
28de915280f63fbba03f2adff03329b5ab46c1e7002aa9c269ffba50d9720b0c
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 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.0.7

2 release files

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

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