Skip to Content
ConceptsIndexes

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
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
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:

ModelDescription
defaultBring your own sparse vectors — you provide custom indices and values
endee_bm25Use 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:

ParameterDescriptionDefault
NameUnique name for your indexRequired
DimensionDense vector dimensionality (max 10,000)Required
Space TypeDistance metric: cosine, l2, or ip (inner product)Required
Sparse ModelEnables hybrid search: default or endee_bm25None
MHNSW graph connectivity — higher values improve recall but use more memory16
EF ConstructionHNSW build-time parameter — higher values improve index quality128
PrecisionVector quantization level (see Precision)INT8
# 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:

MetricValueDescriptionBest For
CosinecosineMeasures the angle between vectors (direction only)Text embeddings, normalized vectors
L2l2Euclidean distance (magnitude and direction)Image embeddings, spatial data
Inner ProductipDot product similarityMaximum 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.

ParameterEffect of Increasing
MHigher recall, more memory usage
EF ConstructionBetter index quality, slower build time

The defaults (M=16, EF Construction=128) are good starting points for most workloads.