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)

Install extras for what you use: static (model2vec encoders), onnx, webgpu, tree-sitter (syntax-aware chunking).

Development

uv venv .venv && uv pip install --python .venv/bin/python -e ".[static,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.1). 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.1

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.1
File Size Uploaded
semsift-0.0.1.tar.gz 37.0 kB Details

Built distribution (wheel)

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

Total release size: 77.9 kB

Release files / semsift-0.0.1.tar.gz

Download URL semsift-0.0.1.tar.gz
Size 37.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8928b5bfb0d6da820a4204dbddd5a829adf9d68aeee8f91f8e6fdbc899400cf6
BLAKE2b-256 checksum
How to use checksums
3b12dbaf678ef18a8f932c79844bea681031ff42b6db6ae3dc8f36037eee40a8
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.1-py3-none-any.whl

Download URL semsift-0.0.1-py3-none-any.whl
Size 40.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52533026985a74c116f6003717118fc67d4956e59f29109f6503f07e7cb154c2
BLAKE2b-256 checksum
How to use checksums
83f3789a10ebfb931c465da8f39302016a49946005dceac0ff148900ee3714f7
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

0.0.2

2 release files

This release

0.0.1 This release

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