Indexes
Indexes are the vector stores where your data lives. Every vector you upsert belongs to an index.
Index Types
Endee supports two types of indexes:
Dense Indexes
Dense indexes enable semantic search — finding items based on meaning rather than exact keyword matches. Each vector is a list of numbers — one number per dimension — representing the meaning of your content.
Use dense indexes when you want to:
- Find semantically similar documents
- Power recommendation systems
- Enable image/video similarity search
Python
from endee import Endee, Precision
client = Endee()
client.create_index(
name="my_index",
dimension=384, # must match your embedding model's output size
space_type="cosine",
precision=Precision.INT8
)Hybrid Indexes
Hybrid indexes combine dense vector search with sparse vector search (e.g keyword matching). This gives you the best of both worlds: semantic similarity and exact term matching in a single query.
Use hybrid indexes for:
- Document retrieval in RAG pipelines
- Search where both meaning and keywords matter
- Any use case where dense-only search misses exact terminology
Python
client.create_index(
name="hybrid_index",
dimension=384,
sparse_model="endee_bm25", # enables hybrid search with BM25
space_type="cosine",
precision=Precision.INT8
)Sparse Model Options:
| Model | Description |
|---|---|
| default | Bring your own sparse vectors — you provide custom indices and values |
| endee_bm25 | Use Endee’s BM25 model via the endee-model package to generate sparse vectors — see Sparse Vectors (BM25) |
See the Sparse Vectors (BM25) guide for installing endee-model and generating BM25 embeddings.
Index Parameters
When creating an index, configure the following parameters:
| Parameter | Description | Default |
|---|---|---|
| Name | Unique name for your index | Required |
| Dimension | Dense vector dimensionality (max 10,000) | Required |
| Space Type | Distance metric: cosine, l2, or ip (inner product) | Required |
| Sparse Model | Enables hybrid search: default or endee_bm25 | None |
| M | HNSW graph connectivity — higher values improve recall but use more memory | 16 |
| EF Construction | HNSW build-time parameter — higher values improve index quality | 128 |
| Precision | Vector quantization level (see Precision) | INT8 |
Python
# All parameters explicitly set
client.create_index(
name="my_index",
dimension=768,
space_type="cosine",
M=32, # higher connectivity = better recall, more memory
ef_con=200, # higher = better index quality, slower build
precision=Precision.FLOAT32
)Distance Metrics
Choose the appropriate distance metric based on your embedding model and use case:
| Metric | Value | Description | Best For |
|---|---|---|---|
| Cosine | cosine | Measures the angle between vectors (direction only) | Text embeddings, normalized vectors |
| L2 | l2 | Euclidean distance (magnitude and direction) | Image embeddings, spatial data |
| Inner Product | ip | Dot product similarity | Maximum inner product search (e.g., recommendation) |
Most embedding models (e.g., Sentence Transformers, OpenAI) produce normalized vectors — use cosine by default.
HNSW Algorithm
Both index types use the HNSW (Hierarchical Navigable Small World) algorithm for Approximate Nearest Neighbor (ANN) searches. The two build-time parameters (M and EF Construction) control the quality vs. memory/build-time trade-off.
| Parameter | Effect of Increasing |
|---|---|
| M | Higher recall, more memory usage |
| EF Construction | Better index quality, slower build time |
The defaults (M=16, EF Construction=128) are good starting points for most workloads.