simlar-engine 1.1.0__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- simlar_engine/__init__.py +36 -0
- simlar_engine/_filter_compiler.cp313-win_amd64.pyd +0 -0
- simlar_engine/_filtered_index.cp313-win_amd64.pyd +0 -0
- simlar_engine/_metadata_filter.cp313-win_amd64.pyd +0 -0
- simlar_engine/_persistence.py +62 -0
- simlar_engine/_registry.py +26 -0
- simlar_engine/_sql.cp313-win_amd64.pyd +0 -0
- simlar_engine/_sql_filter.cp313-win_amd64.pyd +0 -0
- simlar_engine/_stopwords.cp313-win_amd64.pyd +0 -0
- simlar_engine/_types.py +29 -0
- simlar_engine/fusion/__init__.py +3 -0
- simlar_engine/fusion/rrf.cp313-win_amd64.pyd +0 -0
- simlar_engine/indexes/__init__.py +40 -0
- simlar_engine/indexes/_hash_match_impl.cp313-win_amd64.pyd +0 -0
- simlar_engine/indexes/_hash_match_impl.pyi +29 -0
- simlar_engine/indexes/_helix_impl.cp313-win_amd64.pyd +0 -0
- simlar_engine/indexes/_helix_impl.pyi +65 -0
- simlar_engine/indexes/_lookup_impl.cp313-win_amd64.pyd +0 -0
- simlar_engine/indexes/_lookup_impl.pyi +25 -0
- simlar_engine/indexes/_relevance_impl.cp313-win_amd64.pyd +0 -0
- simlar_engine/indexes/_relevance_impl.pyi +35 -0
- simlar_engine/indexes/_simlar_impl.cp313-win_amd64.pyd +0 -0
- simlar_engine/indexes/_simlar_impl.pyi +41 -0
- simlar_engine/indexes/_streaming_impl.cp313-win_amd64.pyd +0 -0
- simlar_engine/indexes/_streaming_impl.pyi +35 -0
- simlar_engine/kernels/__init__.py +7 -0
- simlar_engine/kernels/_batching.cp313-win_amd64.pyd +0 -0
- simlar_engine/kernels/core.cp313-win_amd64.pyd +0 -0
- simlar_engine/kernels/distance.cp313-win_amd64.pyd +0 -0
- simlar_engine/kernels/fusion.cp313-win_amd64.pyd +0 -0
- simlar_engine/kernels/lookup_search.cp313-win_amd64.pyd +0 -0
- simlar_engine/kernels/packing.cp313-win_amd64.pyd +0 -0
- simlar_engine/py.typed +0 -0
- simlar_engine/tuning/__init__.py +10 -0
- simlar_engine/tuning/_hybrid_tuner_lite.cp313-win_amd64.pyd +0 -0
- simlar_engine/tuning/_hybrid_tuner_lite.pyi +27 -0
- simlar_engine/tuning/models/lookup.npz +0 -0
- simlar_engine/tuning/models/relevance.npz +0 -0
- simlar_engine-1.1.0.dist-info/METADATA +56 -0
- simlar_engine-1.1.0.dist-info/RECORD +46 -0
- simlar_engine-1.1.0.dist-info/WHEEL +5 -0
- simlar_engine-1.1.0.dist-info/licenses/EULA.md +133 -0
- simlar_engine-1.1.0.dist-info/licenses/LICENSE +5 -0
- simlar_engine-1.1.0.dist-info/licenses/NOTICE +12 -0
- simlar_engine-1.1.0.dist-info/licenses/THIRD_PARTY_LICENSES.md +147 -0
- simlar_engine-1.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from simlar_engine._filter_compiler import FilterError
|
|
2
|
+
from simlar_engine._filtered_index import FilteredIndex
|
|
3
|
+
from simlar_engine._metadata_filter import MetadataFilter
|
|
4
|
+
from simlar_engine._sql_filter import SQLFilter
|
|
5
|
+
from simlar_engine._types import PredictionResult, SearchResult, _Parameters
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"SearchResult",
|
|
9
|
+
"PredictionResult",
|
|
10
|
+
"_Parameters",
|
|
11
|
+
"SQLFilter",
|
|
12
|
+
"MetadataFilter",
|
|
13
|
+
"FilteredIndex",
|
|
14
|
+
"FilterError",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
try:
|
|
18
|
+
from simlar_engine.indexes._simlar_impl import _SimlarCore
|
|
19
|
+
from simlar_engine.indexes._helix_impl import _HelixCore
|
|
20
|
+
from simlar_engine.indexes._relevance_impl import _RelevanceCore
|
|
21
|
+
from simlar_engine.indexes._lookup_impl import _TextCore
|
|
22
|
+
from simlar_engine.indexes._streaming_impl import _StreamingCore
|
|
23
|
+
from simlar_engine.fusion.rrf import ReciprocalRankFusion
|
|
24
|
+
from simlar_engine.tuning._hybrid_tuner_lite import HybridTunerLite
|
|
25
|
+
|
|
26
|
+
__all__ += [
|
|
27
|
+
"_SimlarCore",
|
|
28
|
+
"_HelixCore",
|
|
29
|
+
"_RelevanceCore",
|
|
30
|
+
"_TextCore",
|
|
31
|
+
"_StreamingCore",
|
|
32
|
+
"ReciprocalRankFusion",
|
|
33
|
+
"HybridTunerLite",
|
|
34
|
+
]
|
|
35
|
+
except ImportError:
|
|
36
|
+
pass # compiled extensions not yet built
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""Versioned index persistence helpers used by compiled cores."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import json
|
|
5
|
+
import logging
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
logger = logging.getLogger(__name__)
|
|
9
|
+
|
|
10
|
+
FORMAT_VERSION = "1.0"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def write_config(path: Path | str, data: dict) -> None:
|
|
14
|
+
payload = {"format_version": FORMAT_VERSION, **data}
|
|
15
|
+
Path(path).write_text(json.dumps(payload, indent=2))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def read_config(path: Path | str) -> dict:
|
|
19
|
+
raw = json.loads(Path(path).read_text())
|
|
20
|
+
ver = raw.get("format_version", "0.0")
|
|
21
|
+
if ver != FORMAT_VERSION:
|
|
22
|
+
logger.warning(
|
|
23
|
+
"Index at '%s' has format_version=%s (current: %s). "
|
|
24
|
+
"Some fields may use default values.",
|
|
25
|
+
Path(path).parent,
|
|
26
|
+
ver,
|
|
27
|
+
FORMAT_VERSION,
|
|
28
|
+
)
|
|
29
|
+
return raw
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def resolve_directory(directory: Path | str, base_dir: Path | str | None = None) -> Path:
|
|
33
|
+
"""Resolve `directory`, always rejecting `..` components, optionally confining to `base_dir`.
|
|
34
|
+
|
|
35
|
+
`..` components are rejected unconditionally (no base_dir needed) — this alone defeats the
|
|
36
|
+
traversal pattern in issue-15 Finding A. Passing `base_dir` adds stronger, opt-in confinement
|
|
37
|
+
on top: `directory` must resolve inside it, which also catches symlink escapes — a symlink
|
|
38
|
+
inside `base_dir` that points outside it resolves outside too.
|
|
39
|
+
"""
|
|
40
|
+
if ".." in Path(directory).parts:
|
|
41
|
+
raise ValueError(f"directory '{directory}' contains '..' components, which is not allowed")
|
|
42
|
+
d = Path(directory).resolve()
|
|
43
|
+
if base_dir is not None:
|
|
44
|
+
base = Path(base_dir).resolve()
|
|
45
|
+
if not d.is_relative_to(base):
|
|
46
|
+
raise ValueError(
|
|
47
|
+
f"directory '{directory}' resolves to '{d}', which escapes the allowed "
|
|
48
|
+
f"base directory '{base}'"
|
|
49
|
+
)
|
|
50
|
+
return d
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def reject_legacy_pickle(directory: Path | str, filename: str) -> None:
|
|
54
|
+
"""Refuse to load a directory saved with the old pickle-based format (issue-15 Finding B).
|
|
55
|
+
|
|
56
|
+
Never call `pickle.load()` on `filename` — raise instead of falling back to it.
|
|
57
|
+
"""
|
|
58
|
+
raise ValueError(
|
|
59
|
+
f"Index at '{directory}' was saved with pickle-based '{filename}', which is no longer "
|
|
60
|
+
f"supported for security reasons (CWE-502, unsafe deserialization). Re-save this index "
|
|
61
|
+
f"with a current version of simlar-engine to migrate it to the JSON format."
|
|
62
|
+
)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Internal engine registry used by _StreamingCore and _HelixCore save/load."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import json
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
_ENGINE_REGISTRY: dict[str, type] = {}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _register_engine(name: str, cls: type) -> None:
|
|
12
|
+
_ENGINE_REGISTRY[name] = cls
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def load_engine_from_directory(directory: str):
|
|
16
|
+
"""Load a compiled index from its saved directory via the engine registry."""
|
|
17
|
+
import simlar_engine.indexes # noqa: F401 — side-effect: populates _ENGINE_REGISTRY
|
|
18
|
+
config_path = Path(directory) / "config.json"
|
|
19
|
+
meta = json.loads(config_path.read_text())
|
|
20
|
+
index_type = meta["index_type"]
|
|
21
|
+
if index_type not in _ENGINE_REGISTRY:
|
|
22
|
+
raise KeyError(
|
|
23
|
+
f"Saved index type {index_type!r} not in engine registry. "
|
|
24
|
+
f"Available: {sorted(_ENGINE_REGISTRY)}"
|
|
25
|
+
)
|
|
26
|
+
return _ENGINE_REGISTRY[index_type].load(directory)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
simlar_engine/_types.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
|
|
5
|
+
import numpy as np
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@dataclass
|
|
9
|
+
class SearchResult:
|
|
10
|
+
"""A single ranked result from any index."""
|
|
11
|
+
rank: int
|
|
12
|
+
id: str
|
|
13
|
+
score: float
|
|
14
|
+
text: str | None = None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass(frozen=True)
|
|
18
|
+
class PredictionResult:
|
|
19
|
+
"""Sub-k settings a tuned model recommends for one corpus size and cutoff."""
|
|
20
|
+
text_k: int
|
|
21
|
+
vector_k: int
|
|
22
|
+
top_k: int
|
|
23
|
+
expected_recall: float | None
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass
|
|
27
|
+
class _Parameters:
|
|
28
|
+
boundaries: np.ndarray # (dim, n_bins) float64
|
|
29
|
+
fit_values: np.ndarray # (dim,) float64
|
|
Binary file
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from simlar_engine._registry import _register_engine
|
|
2
|
+
|
|
3
|
+
def _try_register(name: str, module: str, attr: str) -> type | None:
|
|
4
|
+
try:
|
|
5
|
+
import importlib
|
|
6
|
+
mod = importlib.import_module(module)
|
|
7
|
+
cls = getattr(mod, attr)
|
|
8
|
+
_register_engine(name, cls)
|
|
9
|
+
return cls
|
|
10
|
+
except (ImportError, AttributeError):
|
|
11
|
+
return None
|
|
12
|
+
|
|
13
|
+
_SimlarCore = _try_register("simlar", "simlar_engine.indexes._simlar_impl", "_SimlarCore")
|
|
14
|
+
_RelevanceCore = _try_register("relevance", "simlar_engine.indexes._relevance_impl", "_RelevanceCore")
|
|
15
|
+
_TextCore = _try_register("hash_table", "simlar_engine.indexes._lookup_impl", "_TextCore")
|
|
16
|
+
_HashMatchCore = _try_register("hash_match", "simlar_engine.indexes._hash_match_impl", "_HashMatchCore")
|
|
17
|
+
# _HashMatchCore now self-reports index_type "lookup" (see _hash_match_impl.pyx),
|
|
18
|
+
# so load_engine_from_directory() needs that key too; "hash_match" is kept for
|
|
19
|
+
# directories saved before that change.
|
|
20
|
+
_try_register("lookup", "simlar_engine.indexes._hash_match_impl", "_HashMatchCore")
|
|
21
|
+
_HelixCore = _try_register("helix", "simlar_engine.indexes._helix_impl", "_HelixCore")
|
|
22
|
+
_StreamingCore = _try_register("streaming_hybrid", "simlar_engine.indexes._streaming_impl", "_StreamingCore")
|
|
23
|
+
# bm25c (https://github.com/.../bm25c, or wherever it ends up) -- a from-
|
|
24
|
+
# scratch C implementation of BM25 (Robertson variant), interface-
|
|
25
|
+
# compatible with _RelevanceCore. An external, optional dependency (not
|
|
26
|
+
# one of this package's own compiled extensions), same _try_register
|
|
27
|
+
# graceful-fallback pattern applies if it isn't installed.
|
|
28
|
+
_BM25CCore = _try_register("bm25c", "bm25c", "BM25CRelevanceCore")
|
|
29
|
+
# Metadata-filtered wrapper around any of the above (see _filtered_index.py).
|
|
30
|
+
_try_register("filtered", "simlar_engine._filtered_index", "FilteredIndex")
|
|
31
|
+
|
|
32
|
+
__all__ = [
|
|
33
|
+
"_SimlarCore",
|
|
34
|
+
"_HelixCore",
|
|
35
|
+
"_RelevanceCore",
|
|
36
|
+
"_TextCore",
|
|
37
|
+
"_HashMatchCore",
|
|
38
|
+
"_StreamingCore",
|
|
39
|
+
"_BM25CCore",
|
|
40
|
+
]
|
|
Binary file
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
class _HashMatchCore:
|
|
4
|
+
def __init__(self, stopwords_lang: str | None = ...) -> None: ...
|
|
5
|
+
def fit(self, corpus: list[str], parallel: bool = ...) -> None: ...
|
|
6
|
+
def add(self, ids: list[str], texts: list[str], parallel: bool = ...) -> None: ...
|
|
7
|
+
def update(self, ids: list[str], texts: list[str]) -> None: ...
|
|
8
|
+
def delete(self, ids: list[str]) -> None: ...
|
|
9
|
+
def search(self, query: str | list[str], k: int, parallel: bool = ..., batch_size: int | None = ..., candidates: object = ...) -> list: ...
|
|
10
|
+
def search_raw(self, queries: object, k: int, parallel: bool = ..., candidates: object = ...) -> tuple: ...
|
|
11
|
+
def save(self, directory: str, base_dir: str | None = ...) -> None: ...
|
|
12
|
+
@classmethod
|
|
13
|
+
def load(cls, directory: str, base_dir: str | None = ...) -> _HashMatchCore: ...
|
|
14
|
+
@property
|
|
15
|
+
def size(self) -> int: ...
|
|
16
|
+
@property
|
|
17
|
+
def is_trained(self) -> bool: ...
|
|
18
|
+
@property
|
|
19
|
+
def index_type(self) -> str: ...
|
|
20
|
+
@property
|
|
21
|
+
def ids(self) -> list[str]: ...
|
|
22
|
+
@property
|
|
23
|
+
def stopwords_lang(self) -> str | None: ...
|
|
24
|
+
@property
|
|
25
|
+
def vocab_size(self) -> int: ...
|
|
26
|
+
@property
|
|
27
|
+
def nnz(self) -> int: ...
|
|
28
|
+
@property
|
|
29
|
+
def memory_bytes(self) -> dict[str, int]: ...
|
|
Binary file
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
|
|
5
|
+
from simlar_engine._types import _Parameters
|
|
6
|
+
|
|
7
|
+
class _HelixCore:
|
|
8
|
+
def __init__(
|
|
9
|
+
self,
|
|
10
|
+
text_index: object = ...,
|
|
11
|
+
vector_index: object = ...,
|
|
12
|
+
fusion: object = ...,
|
|
13
|
+
text_k: int | None = ...,
|
|
14
|
+
vector_k: int | None = ...,
|
|
15
|
+
top_k: int = ...,
|
|
16
|
+
alpha_text: float = ...,
|
|
17
|
+
alpha_vector: float = ...,
|
|
18
|
+
speed_preference: str = ...,
|
|
19
|
+
) -> None: ...
|
|
20
|
+
def add(self, ids: list[str], texts: object = ..., vectors: object = ..., parallel: bool = ...) -> None: ...
|
|
21
|
+
def update(self, ids: list[str], texts: object = ..., vectors: object = ...) -> None: ...
|
|
22
|
+
def delete(self, ids: list[str]) -> None: ...
|
|
23
|
+
def search(
|
|
24
|
+
self,
|
|
25
|
+
query_text: object = ...,
|
|
26
|
+
query_vector: object = ...,
|
|
27
|
+
k: object = ...,
|
|
28
|
+
parallel: bool = ...,
|
|
29
|
+
batch_size: object = ...,
|
|
30
|
+
candidates: np.ndarray | None = ...,
|
|
31
|
+
) -> list: ...
|
|
32
|
+
def fit(
|
|
33
|
+
self,
|
|
34
|
+
corpus: list[str],
|
|
35
|
+
vectors: np.ndarray,
|
|
36
|
+
parallel: bool = ...,
|
|
37
|
+
params: object = ...,
|
|
38
|
+
) -> None: ...
|
|
39
|
+
def save(self, directory: str, base_dir: str | None = ...) -> None: ...
|
|
40
|
+
@classmethod
|
|
41
|
+
def load(cls, directory: str, base_dir: str | None = ...) -> _HelixCore: ...
|
|
42
|
+
@property
|
|
43
|
+
def size(self) -> int: ...
|
|
44
|
+
@property
|
|
45
|
+
def is_trained(self) -> bool: ...
|
|
46
|
+
@property
|
|
47
|
+
def index_type(self) -> str: ...
|
|
48
|
+
@property
|
|
49
|
+
def boundaries(self) -> np.ndarray | None: ...
|
|
50
|
+
@property
|
|
51
|
+
def fit_values(self) -> np.ndarray | None: ...
|
|
52
|
+
@property
|
|
53
|
+
def _params(self) -> _Parameters | None: ...
|
|
54
|
+
@property
|
|
55
|
+
def text_index(self) -> Any: ...
|
|
56
|
+
@property
|
|
57
|
+
def vector_index(self) -> Any: ...
|
|
58
|
+
@property
|
|
59
|
+
def text_k(self) -> int | None: ...
|
|
60
|
+
@property
|
|
61
|
+
def vector_k(self) -> int | None: ...
|
|
62
|
+
@property
|
|
63
|
+
def speed_preference(self) -> str: ...
|
|
64
|
+
@property
|
|
65
|
+
def expected_recall(self) -> float | None: ...
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
class _TextCore:
|
|
4
|
+
def __init__(
|
|
5
|
+
self,
|
|
6
|
+
stopwords_lang: str = ...,
|
|
7
|
+
stemmer_lang: str = ...,
|
|
8
|
+
) -> None: ...
|
|
9
|
+
def fit(self, corpus: list[str], parallel: bool = ...) -> None: ...
|
|
10
|
+
def add(self, ids: list[str], texts: list[str], parallel: bool = ...) -> None: ...
|
|
11
|
+
def update(self, ids: list[str], texts: list[str]) -> None: ...
|
|
12
|
+
def delete(self, ids: list[str]) -> None: ...
|
|
13
|
+
def search(self, query: str, k: int, parallel: bool = ..., candidates: object = ...) -> list: ...
|
|
14
|
+
def search_raw(self, queries: object, k: int, parallel: bool = ..., candidates: object = ...) -> tuple: ...
|
|
15
|
+
def save(self, directory: str, base_dir: str | None = ...) -> None: ...
|
|
16
|
+
@classmethod
|
|
17
|
+
def load(cls, directory: str, base_dir: str | None = ...) -> _TextCore: ...
|
|
18
|
+
@property
|
|
19
|
+
def size(self) -> int: ...
|
|
20
|
+
@property
|
|
21
|
+
def is_trained(self) -> bool: ...
|
|
22
|
+
@property
|
|
23
|
+
def index_type(self) -> str: ...
|
|
24
|
+
@property
|
|
25
|
+
def ids(self) -> list[str]: ...
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
class _RelevanceCore:
|
|
2
|
+
def __init__(
|
|
3
|
+
self,
|
|
4
|
+
method: str = ...,
|
|
5
|
+
k1: float = ...,
|
|
6
|
+
b: float = ...,
|
|
7
|
+
stopwords_lang: str = ...,
|
|
8
|
+
stemmer_lang: str = ...,
|
|
9
|
+
) -> None: ...
|
|
10
|
+
def fit(self, corpus: list[str], parallel: bool = ...) -> None: ...
|
|
11
|
+
def add(self, ids: list[str], texts: list[str], parallel: bool = ...) -> None: ...
|
|
12
|
+
def update(self, ids: list[str], texts: list[str]) -> None: ...
|
|
13
|
+
def delete(self, ids: list[str]) -> None: ...
|
|
14
|
+
def search(
|
|
15
|
+
self,
|
|
16
|
+
query: str | list[str],
|
|
17
|
+
k: int,
|
|
18
|
+
parallel: bool = ...,
|
|
19
|
+
batch_size: int | None = ...,
|
|
20
|
+
candidates: object = ...,
|
|
21
|
+
) -> list: ...
|
|
22
|
+
def search_raw(
|
|
23
|
+
self, queries: object, k: int, parallel: bool = ..., candidates: object = ...
|
|
24
|
+
) -> tuple: ...
|
|
25
|
+
def save(self, directory: str, base_dir: str | None = ...) -> None: ...
|
|
26
|
+
@classmethod
|
|
27
|
+
def load(cls, directory: str, base_dir: str | None = ...) -> _RelevanceCore: ...
|
|
28
|
+
@property
|
|
29
|
+
def size(self) -> int: ...
|
|
30
|
+
@property
|
|
31
|
+
def is_trained(self) -> bool: ...
|
|
32
|
+
@property
|
|
33
|
+
def index_type(self) -> str: ...
|
|
34
|
+
@property
|
|
35
|
+
def ids(self) -> list[str]: ...
|
|
Binary file
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
|
|
3
|
+
from simlar_engine._types import _Parameters
|
|
4
|
+
|
|
5
|
+
class _VectorStore:
|
|
6
|
+
def fit(self, embeddings: np.ndarray, parallel: bool = ...) -> None: ...
|
|
7
|
+
def _train_mapped(self, embeddings: np.ndarray, boundaries: np.ndarray, parallel: bool = ...) -> None: ...
|
|
8
|
+
def search(self, vectors: np.ndarray, k: int, candidates: np.ndarray | None = ..., parallel: bool = ...) -> tuple[np.ndarray, np.ndarray]: ...
|
|
9
|
+
def save(self, directory: str) -> None: ...
|
|
10
|
+
@classmethod
|
|
11
|
+
def load(cls, directory: str) -> _VectorStore: ...
|
|
12
|
+
@property
|
|
13
|
+
def boundaries(self) -> np.ndarray | None: ...
|
|
14
|
+
@property
|
|
15
|
+
def matrix(self) -> np.ndarray | None: ...
|
|
16
|
+
@property
|
|
17
|
+
def is_trained(self) -> bool: ...
|
|
18
|
+
|
|
19
|
+
class _SimlarCore:
|
|
20
|
+
def __init__(self, n_candidates: int | None = ...) -> None: ...
|
|
21
|
+
def fit(self, embeddings: np.ndarray, parallel: bool = ..., params: object = ...) -> None: ...
|
|
22
|
+
def add(self, ids: list[str], vectors: np.ndarray, parallel: bool = ...) -> None: ...
|
|
23
|
+
def search(self, query: np.ndarray, k: int, parallel: bool = ..., batch_size: int | None = ..., candidates: np.ndarray | None = ...) -> list: ...
|
|
24
|
+
def search_raw(self, vectors: np.ndarray, k: int, candidates: np.ndarray | None = ..., parallel: bool = ..., n_candidates: int | None = ...) -> tuple[np.ndarray, np.ndarray]: ...
|
|
25
|
+
def update(self, ids: list[str], vectors: np.ndarray) -> None: ...
|
|
26
|
+
def delete(self, ids: list[str]) -> None: ...
|
|
27
|
+
def save(self, directory: str, base_dir: str | None = ...) -> None: ...
|
|
28
|
+
@classmethod
|
|
29
|
+
def load(cls, directory: str, base_dir: str | None = ...) -> _SimlarCore: ...
|
|
30
|
+
@property
|
|
31
|
+
def size(self) -> int: ...
|
|
32
|
+
@property
|
|
33
|
+
def is_trained(self) -> bool: ...
|
|
34
|
+
@property
|
|
35
|
+
def index_type(self) -> str: ...
|
|
36
|
+
@property
|
|
37
|
+
def _params(self) -> _Parameters | None: ...
|
|
38
|
+
@property
|
|
39
|
+
def _matrix(self) -> np.ndarray | None: ...
|
|
40
|
+
@property
|
|
41
|
+
def ids(self) -> list[str]: ...
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
|
|
3
|
+
class _StreamingCore:
|
|
4
|
+
def __init__(
|
|
5
|
+
self,
|
|
6
|
+
text_index_cls: object = ...,
|
|
7
|
+
vector_index_cls: object = ...,
|
|
8
|
+
top_k: int = ...,
|
|
9
|
+
alpha_text: float = ...,
|
|
10
|
+
alpha_vector: float = ...,
|
|
11
|
+
rrf_k: int = ...,
|
|
12
|
+
n_candidates: int | None = ...,
|
|
13
|
+
speed_preference: str = ...,
|
|
14
|
+
) -> None: ...
|
|
15
|
+
def add_batch(self, corpus: list[str], vectors: np.ndarray, parallel: bool = ...) -> None: ...
|
|
16
|
+
def search(self, query_text: object, query_vector: np.ndarray, k: object = ..., parallel: bool = ..., batch_size: int | None = ..., candidates: np.ndarray | None = ...) -> tuple[np.ndarray, np.ndarray]: ...
|
|
17
|
+
def save(self, directory: str, base_dir: str | None = ...) -> None: ...
|
|
18
|
+
@classmethod
|
|
19
|
+
def load(cls, directory: str, base_dir: str | None = ...) -> _StreamingCore: ...
|
|
20
|
+
@property
|
|
21
|
+
def size(self) -> int: ...
|
|
22
|
+
@property
|
|
23
|
+
def n_shards(self) -> int: ...
|
|
24
|
+
@property
|
|
25
|
+
def is_trained(self) -> bool: ...
|
|
26
|
+
@property
|
|
27
|
+
def index_type(self) -> str: ...
|
|
28
|
+
@property
|
|
29
|
+
def speed_preference(self) -> str: ...
|
|
30
|
+
@property
|
|
31
|
+
def expected_recall(self) -> float | None: ...
|
|
32
|
+
@property
|
|
33
|
+
def boundaries(self) -> np.ndarray | None: ...
|
|
34
|
+
@property
|
|
35
|
+
def fit_values(self) -> np.ndarray | None: ...
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
try:
|
|
2
|
+
from simlar_engine.kernels.core import _CoreIndex, _DataMatrix, _transform, fit
|
|
3
|
+
from simlar_engine.kernels.quantization import generate_numpy, generate_numba, encode_dataset
|
|
4
|
+
from simlar_engine.kernels.distance import _search
|
|
5
|
+
from simlar_engine.kernels.fusion import merge
|
|
6
|
+
except ImportError:
|
|
7
|
+
pass # compiled extensions not yet built
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
simlar_engine/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from simlar_engine._types import PredictionResult
|
|
2
|
+
|
|
3
|
+
__all__ = ["PredictionResult"]
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
from simlar_engine.tuning._hybrid_tuner_lite import HybridTunerLite, TunedModel, default_tuner
|
|
7
|
+
|
|
8
|
+
__all__ += ["HybridTunerLite", "TunedModel", "default_tuner"]
|
|
9
|
+
except ImportError:
|
|
10
|
+
pass # compiled extensions not yet built
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from os import PathLike
|
|
2
|
+
|
|
3
|
+
from simlar_engine._types import PredictionResult
|
|
4
|
+
|
|
5
|
+
class TunedModel:
|
|
6
|
+
speed_preferences: list[str]
|
|
7
|
+
def __init__(self, arrays: dict) -> None: ...
|
|
8
|
+
@classmethod
|
|
9
|
+
def load(cls, path: str | PathLike[str]) -> TunedModel: ...
|
|
10
|
+
def predict_one(
|
|
11
|
+
self, corpus_size: int, cutoff: int, speed_preference: str = "balanced"
|
|
12
|
+
) -> PredictionResult: ...
|
|
13
|
+
|
|
14
|
+
class HybridTunerLite:
|
|
15
|
+
@property
|
|
16
|
+
def model(self) -> TunedModel: ...
|
|
17
|
+
@property
|
|
18
|
+
def use_cache(self) -> bool: ...
|
|
19
|
+
@property
|
|
20
|
+
def speed_preferences(self) -> list[str]: ...
|
|
21
|
+
def __init__(self, model_file: str | PathLike[str], use_cache: bool = True) -> None: ...
|
|
22
|
+
def predict(
|
|
23
|
+
self, corpus_size: int, cutoff: int, speed_preference: str = "balanced"
|
|
24
|
+
) -> PredictionResult: ...
|
|
25
|
+
def predict_all(self, corpus_size: int, cutoff: int) -> dict[str, PredictionResult]: ...
|
|
26
|
+
|
|
27
|
+
def default_tuner(index_type: str) -> HybridTunerLite | None: ...
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: simlar-engine
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: High-performance similarity search — compiled binary engine
|
|
5
|
+
License-Expression: LicenseRef-TekDatum-Commercial
|
|
6
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
License-File: NOTICE
|
|
11
|
+
License-File: EULA.md
|
|
12
|
+
License-File: THIRD_PARTY_LICENSES.md
|
|
13
|
+
Requires-Dist: numpy>=1.24
|
|
14
|
+
Requires-Dist: bm25s>=0.1
|
|
15
|
+
Requires-Dist: nltk>=3.8
|
|
16
|
+
Requires-Dist: PyStemmer>=2.0
|
|
17
|
+
Requires-Dist: numba>=0.60.0
|
|
18
|
+
Requires-Dist: sqlglot>=25.0
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: Cython>=3.0; extra == "dev"
|
|
21
|
+
Requires-Dist: cibuildwheel>=2.16; extra == "dev"
|
|
22
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
23
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
24
|
+
Requires-Dist: numpy>=1.24; extra == "dev"
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# simlar-engine
|
|
28
|
+
|
|
29
|
+
High-performance similarity search — a compiled binary engine.
|
|
30
|
+
|
|
31
|
+
`simlar-engine` is the optimized engine that powers the [`simlar`](https://pypi.org/project/simlar/)
|
|
32
|
+
search library.
|
|
33
|
+
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
- Fast, memory-efficient vector similarity search
|
|
37
|
+
- Hybrid search combining semantic and keyword relevance
|
|
38
|
+
- Keyword and exact-text search
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install simlar-engine
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Prebuilt wheels are provided for CPython 3.11–3.13 on Linux, macOS, and Windows.
|
|
47
|
+
|
|
48
|
+
## Usage
|
|
49
|
+
|
|
50
|
+
Most users should install [`simlar`](https://pypi.org/project/simlar/), which provides the
|
|
51
|
+
high-level API on top of this engine.
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
Commercial / proprietary. Use is governed by the TekDatum End User License Agreement.
|
|
56
|
+
See the accompanying EULA. All rights reserved.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
simlar_engine/__init__.py,sha256=SVxNATDNniKcVPwWsyGoOW1V0BNnc0MXqdSKIQWlrCo,1217
|
|
2
|
+
simlar_engine/_filter_compiler.cp313-win_amd64.pyd,sha256=JUy7v_m0hUrrS9iADffx_FyTsu0_JvG7QPEFXEQ_obU,156160
|
|
3
|
+
simlar_engine/_filtered_index.cp313-win_amd64.pyd,sha256=F1ll0e8i5x90T7EM8NhKaQxPWIGmwmT50foDIWzDAvI,96768
|
|
4
|
+
simlar_engine/_metadata_filter.cp313-win_amd64.pyd,sha256=2--qJKT5ycXprBYRrYSdFmM8DKayCNZbFZ4sqO1UFj8,149504
|
|
5
|
+
simlar_engine/_persistence.py,sha256=V-sScDN_ViDQlciF7DV_ZNL1q4nD_kF5hnD8c6ns1Lw,2452
|
|
6
|
+
simlar_engine/_registry.py,sha256=Vs1yx8AoseQ5Swo3shptkc0NmwYs3Q5I2TUuZlaUZyE,921
|
|
7
|
+
simlar_engine/_sql.cp313-win_amd64.pyd,sha256=iE4tk5X_D1AKmjagWKRR4u2JPeufPAwCvmiIc34bjUE,89600
|
|
8
|
+
simlar_engine/_sql_filter.cp313-win_amd64.pyd,sha256=nxY22Ej23cFm8qRx4gFjHSlvvvrSgb9ankQTOoUwgmQ,208384
|
|
9
|
+
simlar_engine/_stopwords.cp313-win_amd64.pyd,sha256=65mhkC0od4WQ6d8u4gS3ubBARFnSk8sqg4bTQGjjYLk,38400
|
|
10
|
+
simlar_engine/_types.py,sha256=InRgkoDfDem8UTcSa8jiZ9sjnQ3vVwoiYMXL6UBiANw,618
|
|
11
|
+
simlar_engine/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
simlar_engine/fusion/__init__.py,sha256=hn8fSxekIp8RD0V25TLcBSVtgqxXCdjVQ_5nv-HXMeo,97
|
|
13
|
+
simlar_engine/fusion/rrf.cp313-win_amd64.pyd,sha256=O8UTQcnsR-HStS14q-8bdP4JtC0DEF99LHusyHOhW8A,84480
|
|
14
|
+
simlar_engine/indexes/__init__.py,sha256=Lu4_vcUxe537zqXF1MJda78ZUvi1CHG2KCgBxHUfNkI,2134
|
|
15
|
+
simlar_engine/indexes/_hash_match_impl.cp313-win_amd64.pyd,sha256=N6LSRym0L6Ddt-rIFnE9ir1l212NJ1qdB32nr-sFmFM,275968
|
|
16
|
+
simlar_engine/indexes/_hash_match_impl.pyi,sha256=AjomvQvv-x4w2bLSffg0G8iqmdeXF3_dr5cbLz39tdY,1287
|
|
17
|
+
simlar_engine/indexes/_helix_impl.cp313-win_amd64.pyd,sha256=UkEJTAZQI88S89bIp8mWNfibrTllSn4Kl2D8LOqyPcY,133120
|
|
18
|
+
simlar_engine/indexes/_helix_impl.pyi,sha256=MVaraFL6qdy_DEL1oGubQNS5UVuVuM6deDSkcR1fdaQ,2048
|
|
19
|
+
simlar_engine/indexes/_lookup_impl.cp313-win_amd64.pyd,sha256=UTIL8KW-xvF337vCOtYVv9NM74GaepT7NWbSpiCLEJ8,136192
|
|
20
|
+
simlar_engine/indexes/_lookup_impl.pyi,sha256=ZVgQcM3-6m5jJqbaqPZy-fdbxbTxjsn7QbUWwgp9cZw,1059
|
|
21
|
+
simlar_engine/indexes/_relevance_impl.cp313-win_amd64.pyd,sha256=XEuaVilSxxkk-BvhQRKzdh68uFMrDJPUhd4qomiTlok,121856
|
|
22
|
+
simlar_engine/indexes/_relevance_impl.pyi,sha256=wi05Lc1HG_6RdHxqt_Vi-vAlV8JXXIsSHy5DScHhu6w,1230
|
|
23
|
+
simlar_engine/indexes/_simlar_impl.cp313-win_amd64.pyd,sha256=yAYWWif_IKwKuyGF2dWOu6xwOZ5B9Iur4CO_bslzw3g,183296
|
|
24
|
+
simlar_engine/indexes/_simlar_impl.pyi,sha256=AfStWKEXlmzEQ6i7lKX0i_hrrpVk6cjjFWc8OMkGJyw,1989
|
|
25
|
+
simlar_engine/indexes/_streaming_impl.cp313-win_amd64.pyd,sha256=C8QBUg4zI8S6tlhAZ9sr3GhGeR16tWYItySxadKFcrM,145408
|
|
26
|
+
simlar_engine/indexes/_streaming_impl.pyi,sha256=YNCgvjv1axgXJIJxm_y3uXvhzzMSdU5K35idBqTWaFU,1340
|
|
27
|
+
simlar_engine/kernels/__init__.py,sha256=X582nmX-uQOqs1A-v9dotVjTkNb2JB0e1n4M1qIutZQ,366
|
|
28
|
+
simlar_engine/kernels/_batching.cp313-win_amd64.pyd,sha256=gXcuuZoL4N2aPvnrjVFBUNIkUctz9W6Q9u0-hqSB4Zo,68096
|
|
29
|
+
simlar_engine/kernels/core.cp313-win_amd64.pyd,sha256=vpp8JhlSiMFdzciQyyPT3PA3siqEoqCsI7bxy-svo00,310784
|
|
30
|
+
simlar_engine/kernels/distance.cp313-win_amd64.pyd,sha256=G-7SIAUqb6MiYk1ScZftwId6Lqi6rbV8FlRftpGRwDA,174080
|
|
31
|
+
simlar_engine/kernels/fusion.cp313-win_amd64.pyd,sha256=wHNh9gMQZGV5vaMvgHUEiQRdAQz8EMRsvf_dVT7KWKk,204800
|
|
32
|
+
simlar_engine/kernels/lookup_search.cp313-win_amd64.pyd,sha256=Sglae4ZHTbITurFiOBbjpDS_u4AG0-pPmFEo9Y7b0uc,160768
|
|
33
|
+
simlar_engine/kernels/packing.cp313-win_amd64.pyd,sha256=u6IO15wCoZsuJf_s7ITHXhiFNX2xyAQ7yZsxIPYkNDQ,159232
|
|
34
|
+
simlar_engine/tuning/__init__.py,sha256=bFuLaxnccIasdc8Yhsplx9SsLQysD0nNQfi1eUu1yOw,330
|
|
35
|
+
simlar_engine/tuning/_hybrid_tuner_lite.cp313-win_amd64.pyd,sha256=nkgzXHV-GjGULmwn2qgVA4rzSr8U5tTkxcNV8xMg_LY,251904
|
|
36
|
+
simlar_engine/tuning/_hybrid_tuner_lite.pyi,sha256=8i9nWhHdWb0i5JahyFRSCTXZOAs2wZCh08TtY1zr6AA,990
|
|
37
|
+
simlar_engine/tuning/models/lookup.npz,sha256=mgEo5LLibpzkFK72pnzqFmnl4cSXexIP7zlBuLXtZBI,1225224
|
|
38
|
+
simlar_engine/tuning/models/relevance.npz,sha256=1dgFjNNr3ttRdYbwDAg5up8nFGlGoSaav3CvU32VuIU,1853588
|
|
39
|
+
simlar_engine-1.1.0.dist-info/licenses/EULA.md,sha256=EiNoVndveuLbCXjqj-24HXejLVIRorcABAC-AXtsjtw,13819
|
|
40
|
+
simlar_engine-1.1.0.dist-info/licenses/LICENSE,sha256=smpg9Oe_ZiGI2qUh3AbZHH7M6ZgeOHQXYbUbDgarHnc,181
|
|
41
|
+
simlar_engine-1.1.0.dist-info/licenses/NOTICE,sha256=I8MXFXn-_WrUXywzeDS-5v_9sht_83TpT_qBzSMaN0Y,443
|
|
42
|
+
simlar_engine-1.1.0.dist-info/licenses/THIRD_PARTY_LICENSES.md,sha256=-ne6bnDW7-U_JizsCknDnR1pXbC0yGzplKCkcsnM14s,6765
|
|
43
|
+
simlar_engine-1.1.0.dist-info/METADATA,sha256=iQC1WhB4fUgG_dtaLpH8W4iVCF65hbbtJgBaAN7MIRg,1660
|
|
44
|
+
simlar_engine-1.1.0.dist-info/WHEEL,sha256=0LUNoHxLvcpw9db_x0XozE5jW73-_GOAO7fDDJ4Xt4Q,101
|
|
45
|
+
simlar_engine-1.1.0.dist-info/top_level.txt,sha256=oBypgzczSKLJ2RxdnLIH7IT9YLn3r_xG4YwQ_jCTAEk,14
|
|
46
|
+
simlar_engine-1.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# End User License Agreement
|
|
2
|
+
|
|
3
|
+
** sim_LAR by TEKDatum — Proprietary Binary Component (Open-Core Distribution)**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Agreement
|
|
8
|
+
|
|
9
|
+
This End User License Agreement ("Agreement") is a legal contract between you (an individual or a single legal entity, "Licensee", "you") and Licensor governing your use of the proprietary software component distributed as the `simlar-engine` package, including any associated binaries, object code, models, data files, documentation, and updates (collectively, the "Software").
|
|
10
|
+
|
|
11
|
+
By installing, copying, downloading, accessing, or otherwise using the Software, you agree to be bound by this Agreement. If you do not agree, do not install or use the Software. If you are entering into this Agreement on behalf of a company or other legal entity, you represent and warrant that you have authority to bind that entity, and "you" refers to that entity.
|
|
12
|
+
|
|
13
|
+
## 2. License grant
|
|
14
|
+
|
|
15
|
+
Subject to your compliance with this Agreement and payment of all applicable fees, Licensor grants you a limited, non-exclusive, non-transferable, non-sublicensable, revocable license to:
|
|
16
|
+
|
|
17
|
+
(a) install and use the Software in object/binary form, solely for your internal business purposes; and
|
|
18
|
+
|
|
19
|
+
(b) use the Software in combination with Licensor's open-source wrapper and SDK and with third-party frameworks (including LangChain, LlamaIndex, and Haystack) as intended.
|
|
20
|
+
|
|
21
|
+
The scope, term, seat/instance count, and deployment environment of your license are defined by the SUBSCRIPTION PLAN under which you obtained the Software. Absent such a document, the license is limited to an evaluation use for 60 days.
|
|
22
|
+
|
|
23
|
+
## 3. Restrictions and acceptable use
|
|
24
|
+
|
|
25
|
+
You shall not, and shall not permit any third party to:
|
|
26
|
+
|
|
27
|
+
(a) reverse engineer, decompile, disassemble, or otherwise attempt to derive the source code, underlying ideas, algorithms, or structure of the Software, **except** and only to the extent this restriction is expressly prohibited by applicable law (e.g., where mandatory interoperability rights apply under EU Directive 2009/24/EC or similar);
|
|
28
|
+
|
|
29
|
+
(b) copy, modify, adapt, translate, or create derivative works of the Software;
|
|
30
|
+
|
|
31
|
+
(c) rent, lease, lend, sell, sublicense, distribute, host, or provide the Software to third parties, including as a service bureau, SaaS offering, or hosted API, except as expressly permitted in writing;
|
|
32
|
+
|
|
33
|
+
(d) remove, obscure, or alter any proprietary notices, labels, or marks;
|
|
34
|
+
|
|
35
|
+
(e) circumvent or disable any license key, usage metering, technical protection, or access control mechanism;
|
|
36
|
+
|
|
37
|
+
(f) use the Software to develop a similar or competing product or service, or to benchmark for the purpose of building a competing product;
|
|
38
|
+
|
|
39
|
+
(g) publish or disclose to any third party any performance or benchmark tests or analyses, the results of audits or penetration tests, or other non-public information relating to the Software or its use;
|
|
40
|
+
|
|
41
|
+
(h) use the Software in violation of applicable law, including export control and sanctions law; or
|
|
42
|
+
|
|
43
|
+
(i) exceed the usage limits (seats, instances, calls, or environments) defined in your SUBSCRIPTION PLAN.
|
|
44
|
+
|
|
45
|
+
## 4. Ownership
|
|
46
|
+
|
|
47
|
+
The Software is licensed, not sold. Licensor and its licensors retain all right, title, and interest in and to the Software, including without limitation all underlying software, models, data compilations, and all intellectual property rights (patents, trademarks, copyrights, database rights, and trade secrets), notwithstanding that portions may be derived from publicly available sources. No rights are granted except as expressly set out in this Agreement.
|
|
48
|
+
|
|
49
|
+
## 5. Open-source components and license boundary
|
|
50
|
+
|
|
51
|
+
**This Agreement governs only the proprietary Software.** It does **not** govern Licensor's open-source wrapper and SDK, which are distributed separately under the Apache License, Version 2.0, and which remain governed solely by that license. Nothing in this Agreement restricts, or purports to restrict, your rights under the Apache 2.0 license with respect to the open-source components.
|
|
52
|
+
|
|
53
|
+
Calling, importing, or interoperating with the Software through the open-source wrapper or SDK does not subject your own application code to this Agreement; this Agreement governs only the proprietary Software itself.
|
|
54
|
+
|
|
55
|
+
The Software may also include third-party or open-source components licensed under their own terms, listed in the accompanying NOTICE file. To the extent those terms conflict with this Agreement as to those components, the third-party terms govern for those components only, and nothing here limits your rights under them.
|
|
56
|
+
|
|
57
|
+
## 6. Fees
|
|
58
|
+
|
|
59
|
+
Use of the Software may require payment of fees as specified in your SUBSCRIPTION PLAN. All fees are non-refundable except as required by law or expressly stated. You are responsible for applicable taxes. Bespoke integrations or other development work are covered under a separate Master Services Agreement ("MSA") and Statement of Work ("SOW"). In the event of conflict between an MSA, SOW, and this Agreement regarding the Software, this Agreement governs unless explicitly disclaimed in the applicable MSA or SOW.
|
|
60
|
+
|
|
61
|
+
## 7. Updates and support
|
|
62
|
+
|
|
63
|
+
Licensor may, but is not obligated to, provide updates, upgrades, or maintenance and support. Any updates are governed by this Agreement unless accompanied by separate terms. Support, if any, is provided per the SUPPORT TERMS, and Licensor may decline support requests it reasonably deems excessive or out of scope.
|
|
64
|
+
|
|
65
|
+
## 8. Feedback
|
|
66
|
+
|
|
67
|
+
If you provide suggestions, comments, ideas, recommendations, bug reports, or other feedback regarding the Software ("Feedback"), you grant Licensor a royalty-free, worldwide, perpetual, irrevocable, assignable, and sublicensable license to use, reproduce, modify, incorporate, disclose, and otherwise exploit the Feedback for any purpose, without obligation, attribution, or compensation to you. **You will not provide Feedback that is subject to any license requiring Licensor to license its software or documentation to third parties as a result of incorporating the Feedback.** Licensor is under no obligation to use any Feedback.
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 9. Data, utilization data, and privacy
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
Because the Software is installed and operated within your own environment, your inputs, prompts, documents, and other content ("Your Content") ordinarily remain within your infrastructure and are not transmitted to Licensor. The Software does not transmit Your Content to Licensor except as expressly described in the http://tekdatum.com/privacy or as necessary to provide a feature you have enabled. You retain all right, title, and interest in Your Content.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
## 10. Artificial intelligence
|
|
77
|
+
|
|
78
|
+
The Software uses artificial intelligence and retrieval-augmented generation ("RAG") technologies and is designed to be used alongside large language models. You may provide input to the Software ("Input") and receive output generated based on that Input ("Output"). You are responsible for your Input and Output, including ensuring they do not violate applicable law or this Agreement. Given the probabilistic nature of AI, use of the Software may produce incorrect or incomplete Output that does not accurately reflect real facts. Licensor does not monitor the content or verify the accuracy of Output. You are solely responsible for evaluating Output for your use case, including through appropriate human review, before relying on it.
|
|
79
|
+
|
|
80
|
+
## 11. Confidentiality
|
|
81
|
+
|
|
82
|
+
"Confidential Information" means nonpublic information of a party (the "Disclosing Party") that is marked or reasonably understood to be confidential. For the avoidance of doubt, the Software and its documentation are Licensor's Confidential Information. Confidential Information does not include information that (i) was already known to the receiving party without obligation of confidentiality; (ii) was independently developed without use of the Disclosing Party's Confidential Information; (iii) is or becomes publicly known without breach of this Agreement; or (iv) is lawfully received from a third party without obligation of confidentiality. The receiving party shall not use or disclose Confidential Information except as authorized by this Agreement, shall protect it with at least reasonable care, and, if compelled by law to disclose it, shall promptly notify the Disclosing Party so it may seek a protective order.
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## 12. Disclaimer of warranties
|
|
87
|
+
|
|
88
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT. LICENSOR DOES NOT WARRANT THAT THE SOFTWARE WILL BE UNINTERRUPTED, ERROR-FREE, OR FREE OF HARMFUL COMPONENTS, OR THAT ITS OUTPUTS WILL BE ACCURATE OR RELIABLE.
|
|
89
|
+
|
|
90
|
+
## 13. Limitation of liability
|
|
91
|
+
|
|
92
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, LICENSOR SHALL NOT BE LIABLE FOR ANY SPECIAL, EXEMPLARY, INDIRECT, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, OR FOR LOSS OF USE, PROFITS, REVENUE, DATA, OR GOODWILL, ARISING OUT OF OR RELATED TO THIS AGREEMENT OR THE SOFTWARE, UNDER ANY THEORY OF LIABILITY, EVEN IF ADVISED OF THE POSSIBILITY. LICENSOR'S TOTAL AGGREGATE LIABILITY SHALL NOT EXCEED THE GREATER OF (A) FIVE HUNDRED U.S. DOLLARS ($500.00), OR (B) THE FEES YOU ACTUALLY PAID FOR THE SOFTWARE IN THE [SIX (6)] MONTHS PRECEDING THE EVENT GIVING RISE TO THE CLAIM. To the extent permitted by law, you may not bring any action under this Agreement more than one (1) year after the cause of action accrues.
|
|
93
|
+
|
|
94
|
+
## 14. Indemnification
|
|
95
|
+
|
|
96
|
+
You agree to defend, indemnify, and hold harmless Licensor and its affiliates, officers, directors, and employees from any claim, loss, liability, cost, or expense (including reasonable attorneys' fees) arising out of or related to (i) your use or misuse of the Software; (ii) your violation of this Agreement; (iii) your infringement or violation of any third-party intellectual property, proprietary, or privacy right; or (iv) your violation of applicable law.
|
|
97
|
+
|
|
98
|
+
## 15. Term and termination
|
|
99
|
+
|
|
100
|
+
This Agreement is effective upon your acceptance and continues until terminated. The initial term is one (1) year and automatically renews per your SUBSCRIPTION PLAN. It terminates automatically if you breach any term. Upon termination, you must cease all use and destroy all copies of the Software. Sections 3, 4, 5, 8, 9, 11, 12(b), 13, 14, 16, 17, and 19–20 survive termination, along with any provision that by its nature should survive.
|
|
101
|
+
|
|
102
|
+
## 16. Export control
|
|
103
|
+
|
|
104
|
+
The Software and related technology are subject to U.S. export control laws and may be subject to regulations in other countries. You represent that you are not located in, and will not export or transfer the Software to, any embargoed or restricted jurisdiction or party, and that you will comply with all applicable trade and sanctions laws.
|
|
105
|
+
|
|
106
|
+
## 17. Government end users
|
|
107
|
+
|
|
108
|
+
The Software and its documentation are "commercial items," "commercial computer software," and "commercial computer software documentation" under 48 CFR 2.101, and are provided with only the rights granted to all other end users, per 48 CFR 12.211, 12.212, and 227.7202, as applicable.
|
|
109
|
+
|
|
110
|
+
## 18. No advisory services
|
|
111
|
+
|
|
112
|
+
The Software does not provide and shall not be construed as providing investment, broker-dealer, accounting, legal, or actuarial services. Nothing in the provision of the Software is intended to subject Licensor to regulation or registration under any federal or state law.
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
## 19. Governing law and dispute resolution
|
|
117
|
+
|
|
118
|
+
This Agreement is governed by the laws of the State of Illinois, without regard to conflict-of-laws rules. To the extent permitted by law, any dispute arising out of or relating to this Agreement shall be resolved by binding arbitration under the Commercial Arbitration Rules of the American Arbitration Association, held in Cook County, Illinois, conducted in English, with the award final and enforceable in any court of competent jurisdiction. Nothing here limits either party's right to seek interim injunctive relief or to enforce an award in court. Any litigation arising out of this Agreement shall be brought exclusively in the state or federal courts located in Illinois, and each party waives objections based on personal jurisdiction or inconvenient forum.
|
|
119
|
+
|
|
120
|
+
## 21. General
|
|
121
|
+
|
|
122
|
+
**(a) Entire agreement.** This Agreement (with your Order Form and any referenced terms) is the entire agreement regarding the Software and supersedes prior understandings.
|
|
123
|
+
**(b) Assignment.** You may not assign this Agreement without Licensor's prior written consent; Licensor may assign freely. Assignments in violation are void.
|
|
124
|
+
**(c) Severability; waiver.** If any provision is unenforceable, the remainder remains in effect and the provision is modified to the minimum extent necessary. Failure to enforce is not a waiver.
|
|
125
|
+
**(d) Independent contractors.** The parties are independent contractors; no agency, partnership, or joint venture is created.
|
|
126
|
+
**(e) Force majeure.** Licensor is not liable for any failure to perform due to causes beyond its reasonable control, including acts of God, civil or military authority, riots, embargoes, and natural disasters.
|
|
127
|
+
**(f) Changes.** Licensor may modify this Agreement [at renewal / on notice]; your continued use after the effective date constitutes acceptance.
|
|
128
|
+
**(g) Headings.** Headings are for convenience only and do not affect interpretation.
|
|
129
|
+
**(h) Notices.** Notices to Licensor shall be sent to licensing@tekdatum.com.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
© 2026 TEKDatum, Inc. All rights reserved. sim_LAR and the TEKDatum name and logo are trademarks of TEKDatum. Use of the open-source components is governed by the Apache License 2.0; use of the proprietary Software is governed by this Agreement.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
simlar-engine
|
|
2
|
+
Copyright 2024-2026 TekDatum
|
|
3
|
+
|
|
4
|
+
Third-party open-source components bundled in this distribution:
|
|
5
|
+
|
|
6
|
+
- NumPy (BSD-3-Clause) — https://numpy.org
|
|
7
|
+
- bm25s (Apache-2.0) — https://github.com/xhluca/bm25s
|
|
8
|
+
- NLTK (Apache-2.0) — https://www.nltk.org
|
|
9
|
+
- PyStemmer (MIT / BSD) — https://github.com/snowballstem/pystemmer
|
|
10
|
+
- Numba (BSD-2-Clause) — https://numba.pydata.org
|
|
11
|
+
|
|
12
|
+
Full license texts are in THIRD_PARTY_LICENSES.md.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Third-Party License Notices
|
|
2
|
+
|
|
3
|
+
This file lists all open-source components bundled or imported by simlar-engine.
|
|
4
|
+
|
|
5
|
+
## Audit status
|
|
6
|
+
|
|
7
|
+
| Component | Version | License | Link-type | Status |
|
|
8
|
+
|------------|---------|--------------|-----------|---------|
|
|
9
|
+
| NumPy | ≥1.24 | BSD-3-Clause | dynamic | ✅ OK |
|
|
10
|
+
| bm25s | ≥0.1 | Apache-2.0 | dynamic | ✅ OK |
|
|
11
|
+
| NLTK | ≥3.8 | Apache-2.0 | dynamic | ✅ OK |
|
|
12
|
+
| PyStemmer | ≥2.0 | MIT / BSD | dynamic | ✅ OK |
|
|
13
|
+
| Numba | ≥0.60 | BSD-2-Clause | dynamic | ✅ OK |
|
|
14
|
+
|
|
15
|
+
"dynamic" means imported at runtime and not statically compiled into the wheel.
|
|
16
|
+
If any component is later statically linked or bundled inside the wheel binary,
|
|
17
|
+
re-audit for GPL/LGPL obligations before distribution.
|
|
18
|
+
|
|
19
|
+
## How to regenerate this file
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install pip-licenses
|
|
23
|
+
pip-licenses --with-license-file --format=markdown
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Full license texts
|
|
27
|
+
|
|
28
|
+
Paste the full license text for each component below before shipping.
|
|
29
|
+
Run `pip-licenses --with-license-file` to extract them automatically.
|
|
30
|
+
|
|
31
|
+
### NumPy — BSD-3-Clause
|
|
32
|
+
|
|
33
|
+
Copyright (c) 2005-2024, NumPy Developers.
|
|
34
|
+
All rights reserved.
|
|
35
|
+
|
|
36
|
+
Redistribution and use in source and binary forms, with or without
|
|
37
|
+
modification, are permitted provided that the following conditions are met:
|
|
38
|
+
|
|
39
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
40
|
+
this list of conditions and the following disclaimer.
|
|
41
|
+
|
|
42
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
43
|
+
this list of conditions and the following disclaimer in the documentation
|
|
44
|
+
and/or other materials provided with the distribution.
|
|
45
|
+
|
|
46
|
+
* Neither the name of the NumPy Developers nor the names of any contributors
|
|
47
|
+
may be used to endorse or promote products derived from this software without
|
|
48
|
+
specific prior written permission.
|
|
49
|
+
|
|
50
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
51
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
52
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
53
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
54
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
55
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
56
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
57
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
58
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
59
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
60
|
+
|
|
61
|
+
### bm25s — Apache-2.0
|
|
62
|
+
|
|
63
|
+
Copyright 2024 Xing Han Lù
|
|
64
|
+
|
|
65
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
66
|
+
you may not use this file except in compliance with the License.
|
|
67
|
+
You may obtain a copy of the License at
|
|
68
|
+
|
|
69
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
70
|
+
|
|
71
|
+
Unless required by applicable law or agreed to in writing, software
|
|
72
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
73
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
74
|
+
See the License for the specific language governing permissions and
|
|
75
|
+
limitations under the License.
|
|
76
|
+
|
|
77
|
+
### NLTK — Apache-2.0
|
|
78
|
+
|
|
79
|
+
Copyright (C) 2001-2024 NLTK Project
|
|
80
|
+
|
|
81
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
82
|
+
you may not use this file except in compliance with the License.
|
|
83
|
+
You may obtain a copy of the License at
|
|
84
|
+
|
|
85
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
86
|
+
|
|
87
|
+
Unless required by applicable law or agreed to in writing, software
|
|
88
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
89
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
90
|
+
See the License for the specific language governing permissions and
|
|
91
|
+
limitations under the License.
|
|
92
|
+
|
|
93
|
+
### PyStemmer — MIT / BSD
|
|
94
|
+
|
|
95
|
+
Copyright (c) 2006, Richard Boulton
|
|
96
|
+
All rights reserved.
|
|
97
|
+
|
|
98
|
+
Redistribution and use in source and binary forms, with or without
|
|
99
|
+
modification, are permitted provided that the following conditions are met:
|
|
100
|
+
|
|
101
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
102
|
+
this list of conditions and the following disclaimer.
|
|
103
|
+
|
|
104
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
105
|
+
this list of conditions and the following disclaimer in the documentation
|
|
106
|
+
and/or other materials provided with the distribution.
|
|
107
|
+
|
|
108
|
+
* Neither the name of the copyright holders nor the names of their contributors
|
|
109
|
+
may be used to endorse or promote products derived from this software without
|
|
110
|
+
specific prior written permission.
|
|
111
|
+
|
|
112
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
113
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
114
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
115
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
|
116
|
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
117
|
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
118
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
119
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
120
|
+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
|
121
|
+
THE POSSIBILITY OF SUCH DAMAGE.
|
|
122
|
+
|
|
123
|
+
### Numba — BSD-2-Clause
|
|
124
|
+
|
|
125
|
+
Copyright (c) 2012, Anaconda, Inc.
|
|
126
|
+
All rights reserved.
|
|
127
|
+
|
|
128
|
+
Redistribution and use in source and binary forms, with or without
|
|
129
|
+
modification, are permitted provided that the following conditions are met:
|
|
130
|
+
|
|
131
|
+
Redistributions of source code must retain the above copyright notice,
|
|
132
|
+
this list of conditions and the following disclaimer.
|
|
133
|
+
|
|
134
|
+
Redistributions in binary form must reproduce the above copyright notice,
|
|
135
|
+
this list of conditions and the following disclaimer in the documentation
|
|
136
|
+
and/or other materials provided with the distribution.
|
|
137
|
+
|
|
138
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
139
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
140
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
141
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
142
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
143
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
144
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
145
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
146
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
147
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
simlar_engine
|