Skip to Content
v1ConceptsIndexes

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.INT16 )

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.INT16 )

The endee-model BM25 sparse embedding library is currently available for Python and TypeScript only. Java supports hybrid indexes using the default sparse model. Bring your own sparse vectors generated from any BM25 implementation.

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.

The sparse_model parameter

For sparse_model you have two options depending on which sparse model you use:

  • sparse_model="endee_bm25" — use this when your sparse vectors come from endee/bm25. Endee holds the IDF weights on its server and applies them automatically, so you only need to send the TF weights from your client.
  • sparse_model="default" — use this for SPLADE models or any other BM25 model. In this case Endee treats the values you send as final scores and does no further calculation. If you are using another BM25 model (not endee/bm25), you must compute the full IDF scores yourself on the client before sending them.

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, more memory)16
EF ConstructionHNSW build-time parameter (higher values improve index quality)128
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.

EF Construction is a build-time parameter set when creating the index — it controls index quality and cannot be changed without recreating the index. EF (also called ef_search) is a separate query-time parameter that controls how many candidates are explored per search query. The two are independent. See Search: Query Parameters.

Index Management

List Indexes

indexes = client.list_indexes() for idx in indexes: print(idx)

Get Index

Returns a handle to an existing index for querying and upserting.

index = client.get_index("my_index")

Delete Index

Deletion is irreversible. All vectors in the index are permanently removed.

client.delete_index("my_index")