Betti — Topological-Shape Oracle 🕳️
Betti sells the shape of data. Given a point cloud it builds a Vietoris–Rips filtration and runs the standard GF(2) persistence reduction to read off the Betti numbers as a function of scale:
- b₀ — connected components (how many clusters),
- b₁ — loops / holes (1-cycles that don't fill in),
- b₂ — voids / cavities (hollow 3-D regions),
plus the full persistence barcode/diagram and a bottleneck distance between two diagrams — a basis-free, noise-stable drift detector: ~0 when two clouds share a topology, clearly positive when the shape changed (a loop appeared, components merged, a cavity opened).
Built on oracle-core (AIMarket Protocol v2). Where Lumen scores who
to trust and Percola finds when a graph collapses, Betti answers what
shape the data has — structure no scalar summary statistic can express.
# Homology: 24 points on a ring → one loop (b1 = 1), one component (b0 = 1)
curl -s -X POST http://localhost:9313/ai-market/v2/invoke -H "Content-Type: application/json" \
-d '{"capability_id":"betti.homology@v1","input":{"points":[[1,0],[0.97,0.26],[0.87,0.5],[0.71,0.71],[0.5,0.87],[0.26,0.97],[0,1],[-0.26,0.97],[-0.5,0.87],[-0.71,0.71],[-0.87,0.5],[-0.97,0.26],[-1,0],[-0.97,-0.26],[-0.87,-0.5],[-0.71,-0.71],[-0.5,-0.87],[-0.26,-0.97],[0,-1],[0.26,-0.97],[0.5,-0.87],[0.71,-0.71],[0.87,-0.5],[0.97,-0.26]],"max_scale":0.5}}'
| Capability | What | Price |
|---|---|---|
betti.homology@v1 |
b₀/b₁/b₂ at scale, Betti curve, persistence diagram | $0.008 |
betti.distance@v1 |
bottleneck distance between two diagrams (topology drift) | $0.004 |
The mathematics
- Vietoris–Rips: vertices at scale 0; an edge when a pair distance ≤ ε; a triangle when all three edges exist; a tetrahedron when all four faces exist (needed for a true b₂). Each simplex's filtration value (birth) is its longest edge.
- Reduction: sort simplices by
(filtration, dimension), build the boundary matrix as GF(2) columns of face-index sets, reduce left-to-right by the low-row pivot. Each pivot pairs a birth simplex with a death simplex → a persistence interval[birth, death]; unpaired columns are essential (infinite) bars. b₀ is cross-checked with union–find. - Betti curve:
b_k(ε)= number of dim-k bars alive at ε. - Bottleneck: exact matching via binary search on ε + Hopcroft–Karp/Kuhn perfect
matching on the threshold bipartite graph, with the diagonal allowed. Complexity per
feasibility check
O(E·√V);V ≤ 2(|A|+|B|)after the diagram cap.
Hard caps (no silent truncation)
The protocol layer does not validate input, so the handlers do. A Rips complex is
combinatorially explosive, so Betti caps points at 300 and total simplices at
150 000; if it clips, it says so in the response notes/capped fields rather than
quietly dropping data. Missing/malformed points raise ValueError → {ok:false}.
Part of the AICOM oracle family. MIT.
Metadata
Release files for aimarket-oracle-betti 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aimarket_oracle_betti-0.1.0.tar.gz | 15.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aimarket_oracle_betti-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.2 kB
Release files / aimarket_oracle_betti-0.1.0.tar.gz
| Download URL | aimarket_oracle_betti-0.1.0.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f4e09bd9540a97f4a8a2068f6b754b17df715c32d33337adf93c7eb7080d9ed
|
|
BLAKE2b-256 checksum How to use checksums |
52bcff69661778e9f8045d87f61fe6f6f4c0e4361742cc5a732136b1d4fae1c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / aimarket_oracle_betti-0.1.0-py3-none-any.whl
| Download URL | aimarket_oracle_betti-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
787e779da956c603fe7d8e3d7cecd3fb2c9e259c69e3847bfae48036184761b9
|
|
BLAKE2b-256 checksum How to use checksums |
9863c677540f728eee59f2f7e6b1082b39fd6143131cc9b81946476979f06ec2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for aimarket-oracle-betti 0.1.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.