The zero-dependency core protocol engine for MisakaNet Swarm Knowledge Network.
Project description
misakanet-core
Zero-dependency BM25 search engine with RRF fusion — extracted from MisakaNet.
- Pure Python, stdlib only
- BM25 ranking with configurable k1/b
- Metadata-weighted scoring
- RRF (Reciprocal Rank Fusion) for multi-query fusion
- CJK-aware tokenization
- Works in air-gapped environments
Installation
pip install misakanet-core
Usage
from misakanet_core import BM25, ScoredDocument, tokenize, rrf
# Prepare corpus
docs = [
ScoredDocument("doc1", tokenize("the cat sat on the mat")),
ScoredDocument("doc2", tokenize("the dog sat on the log")),
ScoredDocument("doc3", tokenize("cats and dogs are friends")),
]
# Build index and search
engine = BM25(docs)
results = engine.search("cat dog", top_k=5)
for result in results:
print(f"{result.doc_id}: {result.score:.4f}")
# Multi-query fusion with RRF
from misakanet_core import SearchResult, rrf
query1 = engine.search("cat")
query2 = engine.search("dog")
fused = rrf([query1, query2], top_k=3)
Why not use elasticsearch / tantivy / whoosh?
| misakanet-core | elasticsearch | tantivy | whoosh | |
|---|---|---|---|---|
| Dependencies | Zero | JVM | Rust toolchain | Pure Python |
| Install time | 0.5s | 5min+ | 2min+ | 2s |
| Air-gapped | ✅ | ❌ | ❌ | ✅ |
| CJK support | ✅ | ✅ | ⚠️ | ⚠️ |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file misakanet_core-2.7.0.tar.gz.
File metadata
- Download URL: misakanet_core-2.7.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0762e9835a79ac23d5323ec077c8d6a91c046fd62bdac9d40c5a5bb3325cf5ed
|
|
| MD5 |
713eefbd9b4331e7f27c78f34ac455ca
|
|
| BLAKE2b-256 |
3cd3d8d4d396740c13ec03da66159a6c3036cd063e04582c2fc78632cf479775
|
Provenance
The following attestation bundles were made for misakanet_core-2.7.0.tar.gz:
Publisher:
publish.yml on Ikalus1988/misakanet-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
misakanet_core-2.7.0.tar.gz -
Subject digest:
0762e9835a79ac23d5323ec077c8d6a91c046fd62bdac9d40c5a5bb3325cf5ed - Sigstore transparency entry: 1808745728
- Sigstore integration time:
-
Permalink:
Ikalus1988/misakanet-core@85e58324de5f1e4aea91432d35b9cc0d0edc9b84 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Ikalus1988
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@85e58324de5f1e4aea91432d35b9cc0d0edc9b84 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file misakanet_core-2.7.0-py3-none-any.whl.
File metadata
- Download URL: misakanet_core-2.7.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d658c0d7d54e271928eee1638937b1feae9067e8c1f82750c185e26ef90a063
|
|
| MD5 |
60476ac460a76adacd927d45d0a82942
|
|
| BLAKE2b-256 |
28d67f9887d17ccc57fd269b876c3e022cabd820efd78881bb2fc606aa2c0a52
|
Provenance
The following attestation bundles were made for misakanet_core-2.7.0-py3-none-any.whl:
Publisher:
publish.yml on Ikalus1988/misakanet-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
misakanet_core-2.7.0-py3-none-any.whl -
Subject digest:
9d658c0d7d54e271928eee1638937b1feae9067e8c1f82750c185e26ef90a063 - Sigstore transparency entry: 1808745730
- Sigstore integration time:
-
Permalink:
Ikalus1988/misakanet-core@85e58324de5f1e4aea91432d35b9cc0d0edc9b84 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Ikalus1988
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@85e58324de5f1e4aea91432d35b9cc0d0edc9b84 -
Trigger Event:
workflow_dispatch
-
Statement type: