Skip to main content

ecpfs

CI PyPI License

An implementation of the Extended Cluster Pruning (eCP) approximate nearest neighbor index, with a Rust core, Python bindings, and a standalone CLI.

Documentation: https://ok2610.github.io/ecpfs/

What is eCP?

Extended Cluster Pruning (eCP) is a hierarchical, cluster-based approximate nearest neighbor index built for collections too large to search, or even fit, in memory. A set of vectors is randomly selected from the collection as "leaders" (representatives), and every other vector is assigned to its nearest leader, forming clusters (leaf nodes, in the rest of this documentation). Because the leaders are used as-is, rather than a centroid computed after the fact, the index tree is known before any vector is assigned to a cluster, letting construction use that tree to route each vector to its cluster instead of comparing it against every leader.

For large collections, the leaders themselves are recursively clustered into an L-level tree, so a query descends the tree rather than scanning every leader directly. Cluster size is a target item count you choose rather than something eCP derives from a fixed ratio, typically picked to line up with a disk read's worth of data. At query time, a search expansion parameter controls how many clusters are read before returning results, trading I/O for recall.

What ecpfs does

ecpfs implements the eCP pipeline as a disk-based library: a Rust core (ecp-core), Python bindings (ecpfs, via PyO3), and a CLI (ecp). The "fs" in the name reflects that an index is disk-backed and lazily loaded rather than held entirely in memory. Nodes are read as a search visits them, and a cache capped by a memory limit decides which stay resident. By default the search visits the best few nodes on each level, from the root down, like the original eCP algorithm's level-by-level expansion. It can instead run best-first across the tree, regardless of level. Either way, each opened leaf contributes all of its items as candidates rather than being searched further. It also supports incremental search, which pulls further results for an already-run query without restarting it.

An index isn't build-once. insert (Python) and ecp add-data (CLI) add new points to an already-built index, routing each to its nearest leaf the same way search descends. Concurrent inserts and searches on one loaded index are safe and fine-grained (see docs/quickstart.rst), though naive insert never rebalances, so a leaf that keeps growing just keeps growing.

The on-disk format is Zarr: each tree node is a group of plain arrays, deliberately "whitebox" so it stays human-inspectable and easy to extend later without touching the loader. A second, minimal binary backend is planned for cases that do not need that extensibility.

Documentation

The site is at https://ok2610.github.io/ecpfs/ and covers:

  • Quickstart: installation and a build/search walkthrough
  • Search parameters: how k, search_exp, max_increments, exclude and the search strategy work together
  • Logging: the level policy, the JSONL record format, and where the file goes
  • Python API reference, with the Rust API reference under /rust/
  • CLI reference for ecp
  • Index format: the on-disk layout, including saved queries
  • Multithreading internals, for contributors to ecp-core

docs/build.sh builds the same site locally, and docs/gen_cli.py refreshes the CLI page from ecp --help. cargo doc --no-deps -p ecp-core -p ecp-cli builds just the Rust side.

Index format

An index is a directory (currently a Zarr store):

info/format_version     : uint32, 1 for this layout
info/levels             : uint32, L
info/metric             : string, "L2" or "IP"
info/is_normalized      : bool, optional, an index without it is searched as not normalized
info/total_items        : uint32, items currently stored
info/next_item_id       : uint32, the id the next insert hands out

rep_embeddings          : shape=(num_representatives, dim), optional
rep_item_ids            : shape=(num_representatives,), uint32

index_root/embeddings   : shape=(node_size, dim), the top-level representatives

lvl_1/node_M/embeddings : shape=(n, dim), for each node M at level 1
lvl_1/node_M/node_ids   : shape=(n,), uint32, children at level 2
lvl_1/node_M/border     : shape=(2,), float32, optional, written but never populated
...
lvl_L/node_M/embeddings : shape=(n, dim), leaf-level clusters
lvl_L/node_M/item_ids   : shape=(n,), uint32, the collection's item ids

queries/Q/...           : optional, a persisted query's state, one group per query id Q

n differs from node to node, since eCP does not enforce cluster sizes. Embeddings arrays are stored as float32, float16, uint8 or int8, chosen at build time; every read widens them to float32. The index format page describes every array in full, including a saved query's own.

Background

ecpfs builds on ideas first explored in eCP-FS, a file-structure-based eCP implementation:

@inproceedings{khan2025ecpfs,
  author    = {Khan, Omar Shahbaz and Guðmundsson, Gylfi Þór and Jónsson, Björn Þór},
  title     = {The Curious Case of High-Dimensional Indexing as a File Structure: A Case Study of eCP-FS},
  year      = {2025},
  publisher = {Springer-Verlag},
  address   = {Berlin, Heidelberg},
  doi       = {10.1007/978-3-032-06069-3_24},
  booktitle = {Similarity Search and Applications: 18th International Conference, SISAP 2025, Reykjavik, Iceland, October 1-3, 2025, Proceedings},
  pages     = {303-311},
  numpages  = {9},
  location  = {Reykjavik, Iceland}
}

Contributing

See CONTRIBUTING.md for development setup, the gate CI runs, and the project's conventions. Participation is covered by CODE_OF_CONDUCT.md.

License

Dual-licensed under MIT or Apache-2.0, at your option. See LICENSE-MIT and LICENSE-APACHE.

Metadata

Release files for ecpfs 0.10.0

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

Source distribution (sdist)

Source distribution for ecpfs 0.10.0
File Size Uploaded Provenance Actions
ecpfs-0.10.0.tar.gz 109.1 kB With provenance Details for ecpfs-0.10.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ecpfs 0.10.0
File Actions
ecpfs-0.10.0-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details for ecpfs-0.10.0-cp314-cp314t-win_amd64.whl
ecpfs-0.10.0-cp314-cp314t-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 Details for ecpfs-0.10.0-cp314-cp314t-manylinux_2_28_x86_64.whl
ecpfs-0.10.0-cp314-cp314t-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 Details for ecpfs-0.10.0-cp314-cp314t-manylinux_2_28_aarch64.whl
ecpfs-0.10.0-cp314-cp314t-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 Details for ecpfs-0.10.0-cp314-cp314t-macosx_11_0_arm64.whl
ecpfs-0.10.0-cp314-cp314t-macosx_10_12_x86_64.whl CPython 3.14 CPython 3.14 free-threading macOS 10.12+ x86-64 Details for ecpfs-0.10.0-cp314-cp314t-macosx_10_12_x86_64.whl
ecpfs-0.10.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for ecpfs-0.10.0-cp314-cp314-win_amd64.whl
ecpfs-0.10.0-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details for ecpfs-0.10.0-cp314-cp314-manylinux_2_28_x86_64.whl
ecpfs-0.10.0-cp314-cp314-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ ARM64 Details for ecpfs-0.10.0-cp314-cp314-manylinux_2_28_aarch64.whl
ecpfs-0.10.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for ecpfs-0.10.0-cp314-cp314-macosx_11_0_arm64.whl
ecpfs-0.10.0-cp314-cp314-macosx_10_12_x86_64.whl CPython 3.14 CPython 3.14 macOS 10.12+ x86-64 Details for ecpfs-0.10.0-cp314-cp314-macosx_10_12_x86_64.whl

Total release size: 35.7 MB

Release files / ecpfs-0.10.0.tar.gz

Download URL ecpfs-0.10.0.tar.gz
Size 109.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e91b73f85d9e0fcc94c3a3b9dd7a96e48d453035f656296f380c31fbd23b7eb2
BLAKE2b-256 checksum
How to use checksums
8437c91e371d4df80f8a2e9f11b1da1e50176e7b64851dcb2e9ac31a9a2298e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / ecpfs-0.10.0-cp314-cp314t-win_amd64.whl

Download URL ecpfs-0.10.0-cp314-cp314t-win_amd64.whl
Size 3.6 MB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
26eaa036daa431fd8421012071be067106c5ae817fc9baa7c8ac68c3b43e5e27
BLAKE2b-256 checksum
How to use checksums
0a78861bbad47738e3c34663354bd8d61ffcc2ac47e0467e5a815ef61a683863
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / ecpfs-0.10.0-cp314-cp314t-manylinux_2_28_x86_64.whl

Download URL ecpfs-0.10.0-cp314-cp314t-manylinux_2_28_x86_64.whl
Size 3.9 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a607042502f4669c523c98be53052586fbc40d80ccc1196c2961ab568d33f23f
BLAKE2b-256 checksum
How to use checksums
aee07defebb588871bba35bfc2a262825a481c00acfbe7fc1e489ea515f2d16a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / ecpfs-0.10.0-cp314-cp314t-manylinux_2_28_aarch64.whl

Download URL ecpfs-0.10.0-cp314-cp314t-manylinux_2_28_aarch64.whl
Size 3.6 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
d2b64fb5b809d05d8538c75d742d470f9c1e7191fb1951d22e5349ebf1a31c8c
BLAKE2b-256 checksum
How to use checksums
f1b9f19543db53ab82b63bfe2ca1063a96ced65ac90ca0c0acd07e25a43a4829
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / ecpfs-0.10.0-cp314-cp314t-macosx_11_0_arm64.whl

Download URL ecpfs-0.10.0-cp314-cp314t-macosx_11_0_arm64.whl
Size 3.2 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6f9d81ad26ae0be251e85b2dd9fcc3c1ded2e58c483fc748917035d602b5a293
BLAKE2b-256 checksum
How to use checksums
ba6b475981dc8c871e4301893746e5753d36266f93d5d72fd44ce54d946f2853
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / ecpfs-0.10.0-cp314-cp314t-macosx_10_12_x86_64.whl

Download URL ecpfs-0.10.0-cp314-cp314t-macosx_10_12_x86_64.whl
Size 3.5 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
77f2969bd50aa29420022ebcad80ae61b431d06a3a6517bc3b4159aed981b7fc
BLAKE2b-256 checksum
How to use checksums
ab6a0630069d7afc369e6635da11bdadae05db63e18071767aef0376c77ce42d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / ecpfs-0.10.0-cp314-cp314-win_amd64.whl

Download URL ecpfs-0.10.0-cp314-cp314-win_amd64.whl
Size 3.6 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
0d404c01a5c32221e57bad35e67dadc8bc99765002bd7c7379aff9a500385886
BLAKE2b-256 checksum
How to use checksums
89ea176aaad809238ca7337837a81a69aec2c06dabbc0f6b1f34616ea8954a70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / ecpfs-0.10.0-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL ecpfs-0.10.0-cp314-cp314-manylinux_2_28_x86_64.whl
Size 3.9 MB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
af6cb34fd8d939dcfd65da26f618894f0ec84fa3e26f83ad435c3654e4f3aa6d
BLAKE2b-256 checksum
How to use checksums
d83aa92da432f8d338b4e2d8748f604fd7c21632ced7d58e9a3ad08d3598f4ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / ecpfs-0.10.0-cp314-cp314-manylinux_2_28_aarch64.whl

Download URL ecpfs-0.10.0-cp314-cp314-manylinux_2_28_aarch64.whl
Size 3.6 MB
Tags CPython 3.14 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
d415abfeee94cb8bcc6f907ac865361056fcf6999d436f83482134c53f060567
BLAKE2b-256 checksum
How to use checksums
07f27737b8bc90866237e2f4015362779b7ee155def95092244713d404a6cee8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / ecpfs-0.10.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL ecpfs-0.10.0-cp314-cp314-macosx_11_0_arm64.whl
Size 3.2 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
39a07762c2c8052e47ad683388b70a7835153eb241164aa5fb0aaa11ae63525d
BLAKE2b-256 checksum
How to use checksums
3201da7c8a3ad6773e720d8a49fc67cfb065aaad45a041ad6642ce3487883eff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / ecpfs-0.10.0-cp314-cp314-macosx_10_12_x86_64.whl

Download URL ecpfs-0.10.0-cp314-cp314-macosx_10_12_x86_64.whl
Size 3.5 MB
Tags CPython 3.14 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
d6223e910ba012f318e48b3caf4099f9eb86776f07c3b50ef327a25bf5778e44
BLAKE2b-256 checksum
How to use checksums
b0d2f625ca006ef15f290b180623b702c82246481ec41263716e7790b3da7e03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Security for ecpfs 0.10.0

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.

Full provenance

All 11 files in this release have been uploaded with provenance metadata.

Select from 11 files

Attestation for ecpfs-0.10.0.tar.gz

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 Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.10.0 This release

11 release files Full provenance

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