sim_LAR
Python search library combining keyword, semantic, and hybrid search into a single ranked result list — with first-class LangChain, LlamaIndex, and Haystack support.
Installation
Both the open wrapper and the engine are on public PyPI:
pip install simlar
pip install simlar-engine
simlar-engine is TekDatum's proprietary binary, licensed under a Commercial EULA — installing it means accepting those terms. See docs/installation.md for the compatible version matrix between simlar and simlar-engine.
Quick start
Keyword search
No embeddings required. Index your text and search.
from simlar import RelevanceIndex
corpus = [
"cancer treatment with immunotherapy",
"machine learning transformers",
"climate change renewable energy",
]
ids = [f"doc_{i}" for i in range(len(corpus))]
idx = RelevanceIndex()
idx.add(ids=ids, texts=corpus)
results = idx.search("immunotherapy clinical trial", k=1)
for r in results:
print(r.rank, r.id, f"{r.score:.4f}")
Semantic search
Provide pre-computed embedding vectors alongside your document IDs.
import numpy as np
from simlar import SimlarEngine
# vectors: (n_docs, dim) float32, ideally L2-normalised
vectors = np.load("corpus_embeddings.npy")
ids = [f"doc_{i}" for i in range(len(vectors))]
idx = SimlarEngine()
idx.add(ids=ids, vectors=vectors)
query_vec = np.load("query_embedding.npy") # shape (1, dim)
results = idx.search(query_vec, k=5)
for r in results:
print(r.rank, r.id, f"{r.score:.4f}")
Exact-term matching
Like keyword search, but scores by term overlap alone, with no relevance ranking — a lighter-weight option when you don't need BM25's IDF/length-normalization.
from simlar import LookupIndex
idx = LookupIndex()
idx.add(ids=ids, texts=corpus)
results = idx.search("immunotherapy clinical trial", k=1)
Hybrid search
Combine keyword relevance and semantic similarity into one ranked list.
import numpy as np
from simlar import HelixIndex, RelevanceIndex, SimlarEngine, ReciprocalRankFusion
corpus = ["cancer treatment with immunotherapy", "machine learning transformers", ...]
ids = [f"doc_{i}" for i in range(len(corpus))]
vectors = np.load("corpus_embeddings.npy") # shape (n, dim)
index = HelixIndex(
text_index=RelevanceIndex(),
vector_index=SimlarEngine(),
fusion=ReciprocalRankFusion(),
top_k=20,
)
index.add(ids=ids, texts=corpus, vectors=vectors)
query_vec = np.load("query_embedding.npy")
results = index.search(
query_text="immunotherapy clinical trial",
query_vector=query_vec,
k=10,
)
for r in results:
print(r.rank, r.id, f"{r.score:.4f}")
Framework integrations
sim_LAR works as a drop-in component in:
- LangChain — docs/examples/04_langchain_integration.ipynb
- LlamaIndex — docs/examples/06_llamaindex_integration.ipynb
- Haystack — docs/examples/05_haystack_integration.ipynb
Index types at a glance
| Index | Best for |
|---|---|
RelevanceIndex |
Keyword search over text — no embeddings required |
LookupIndex |
Fast exact-term matching over text, no relevance ranking |
SimlarEngine |
Semantic search over pre-computed embedding vectors |
HelixIndex |
Both signals combined; corpus fits in memory |
StreamingHybridIndex |
Both signals; very large corpora added in batches |
Producing embeddings
sim_LAR is model-agnostic — it accepts any (n, dim) float32 NumPy array. Use whichever embedding library fits your project. Example with sentence-transformers:
pip install sentence-transformers
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("WhereIsAI/UAE-Large-V1")
corpus_vectors = model.encode(corpus, normalize_embeddings=True) # (n, dim) float32
query_vec = model.encode(["my search query"], normalize_embeddings=True) # (1, dim)
Saving and loading indexes
Every index type shares the same save/load interface.
# Save
index.save("/path/to/dir")
# Load (type is detected automatically)
from simlar import load_from_directory
index = load_from_directory("/path/to/dir")
Extending sim_LAR
Register a custom index class to make it compatible with load_from_directory() and the rest of the library:
from simlar import VectorIndex, register
@register("my_index")
class MyIndex(VectorIndex):
...
Contributing
Contributions to simlar are welcome. Because this is a dual-licensed open-core project, we require all contributors to agree to a Contributor License Agreement (CLA) before we can merge. This lets us keep the open-core model viable and continue offering simlar under Apache 2.0. See CONTRIBUTING.md for details.
We do not accept contributions to the proprietary engine.
Trademarks
"sim_LAR", "TekDatum", and associated logos are trademarks of TekDatum. The Apache 2.0 license for the open code does not grant rights to use these marks. You may build on and redistribute the open code, but you may not use our names or logos in a way that implies endorsement or that misrepresents the origin of a fork. See TRADEMARKS.md.
Documentation
| Document | Description |
|---|---|
| Concepts | Architecture and design decisions |
| API Reference | Full public API |
| Installation | Setup and the simlar/simlar-engine compatibility matrix |
| Examples | Runnable scripts |
License
- The contents of this repository are licensed under the Apache License, Version 2.0 — see LICENSE.
- The proprietary
simlar-enginebinary is licensed under a Commercial EULA — see EULA.md. - Third-party components and their licenses are listed in NOTICE.
License Boundary
This project uses an open-core model. It has two layers with different licenses:
| Layer | Package | License | Where it lives |
|---|---|---|---|
| Open wrapper + SDK | simlar |
Apache License 2.0 | This repo · public PyPI |
| Proprietary engine | simlar-engine |
Commercial EULA (closed binary) | public PyPI |
What this means in practice:
- The code in this repository is free and open under Apache 2.0. You can read it, fork it, modify it, and build on it, including commercially, subject to the Apache 2.0 terms.
- The wrapper depends on a separate, proprietary binary package (
simlar-engine) that contains TekDatum's core IP. That binary is not open source. Installing and using it requires accepting the Commercial EULA and, for production use, a license from TekDatum. - Calling the proprietary engine through this open SDK does not make your own code subject to the EULA — your application code is yours. The EULA governs only the proprietary binary itself.
If you only want to read or contribute to the open layer, you never need a license. If you want to run the full product, you need the engine.
What's open and what's not
Open (Apache 2.0, in this repo):
- The SDK and public API surface (
RelevanceIndex,LookupIndex,HelixIndex,StreamingHybridIndex,ReciprocalRankFusion) - Framework adapters (LangChain / LlamaIndex / Haystack)
- The
load_from_directory()loader and@registerextension API - Configuration schema, type stubs, examples, and docs
Proprietary (Commercial EULA, separate binary):
- The core
SimlarEnginevector search implementation - Compiled ranking and retrieval algorithms
We keep this boundary deliberate and documented so you always know which terms apply to which code.
© 2026 TekDatum.
Metadata
Release files for simlar 1.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 | |
|---|---|---|---|
| simlar-1.1.0.tar.gz | 34.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simlar-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 72.7 kB
Release files / simlar-1.1.0.tar.gz
| Download URL | simlar-1.1.0.tar.gz |
|---|---|
| Size | 34.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e6237f548dfb3dfdd1b18ba325588cd09bf4f351de20d485f0975e481d646ba
|
|
BLAKE2b-256 checksum How to use checksums |
eb2a17ee6eab1161e7623d138e3d0b8bf33fbee7f39ed79e944a651f5cf49304
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / simlar-1.1.0-py3-none-any.whl
| Download URL | simlar-1.1.0-py3-none-any.whl |
|---|---|
| Size | 38.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71a40c9528352ed169821a86a8aadee7ac6bddfe1a6e5cf2f6e194315a7bfcfa
|
|
BLAKE2b-256 checksum How to use checksums |
544741fe15a3b21ec859b1b0e6866c269ce6dc9bb77f28b887c8796e797d9428
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|