Skip to Content
v1ConceptsVectors

Vectors

Vectors are the fundamental data units stored in an index. Each vector has a unique ID, an embedding array, and optional metadata and filter fields.

Dense Vector Fields

FieldRequiredDescription
IDYesUnique string identifier for the vector
VectorYesDense embedding array (must match the index dimension)
MetaNoArbitrary metadata object (returned in query results)
FilterNoKey-value pairs used to filter results during queries

meta vs filter: Use meta for data you want returned with results (titles, URLs, display text). Use filter for fields you intend to query against. Any field not declared in filter at upsert time cannot be used in a filter expression later.

index = client.get_index(name="my_index") index.upsert([ { "id": "doc1", "vector": [0.12, -0.34, 0.89, ...], "meta": {"title": "Introduction to ML"}, "filter": {"category": "tech", "year": 2024} }, { "id": "doc2", "vector": [0.55, 0.21, -0.10, ...], "meta": {"title": "Deep Learning Basics"}, "filter": {"category": "tech", "year": 2023} } ])

BM25 sparse vectors are generated from text using term-frequency weighting. Endee’s endee-model library handles this automatically. See the Sparse Vectors (BM25) guide for setup and usage.

Hybrid Vector Fields

For hybrid indexes, include sparse vector components alongside the dense vector:

FieldRequiredDescription
Sparse IndicesYesNon-zero term positions in the sparse vector
Sparse ValuesYesBM25 weights corresponding to each index position
index.upsert([ { "id": "doc1", "vector": [0.12, -0.34, 0.89, ...], "sparse_indices": [4821, 19043, 73201], "sparse_values": [1.42, 0.87, 1.15], "meta": {"title": "Introduction to ML"} } ])

sparse_indices and sparse_values must have the same length. Each position in sparse_indices maps to the weight at the same position in sparse_values.

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.

Maximum batch size is 10,000 vectors per upsert call.

Precision

The precision parameter controls how vectors are stored internally. Lower precision reduces memory and speeds up search at the cost of some accuracy.

PrecisionBitsStorageSpeedAccuracy
BINARY1-bitSmallestFastestLower
INT88-bitSmallFastGood
INT1616-bit integerMediumMediumHigher
FLOAT1616-bit floatMediumMediumHigh
FLOAT3232-bit floatLargestSlowerHighest
from endee import Precision # INT16 — recommended for most use cases client.create_index(name="my_index", dimension=384, space_type="cosine", precision=Precision.INT16) # FLOAT32 — maximum accuracy client.create_index(name="precise_index", dimension=384, space_type="cosine", precision=Precision.FLOAT32) # BINARY — minimum memory client.create_index(name="large_index", dimension=384, space_type="cosine", precision=Precision.BINARY)

Recommendations:

  • INT16: best balance of speed, memory, and accuracy for most use cases (recommended)
  • INT8: faster than INT16 with slightly lower accuracy; good for latency-sensitive workloads (default)
  • FLOAT32: use when maximum recall accuracy is critical and memory is not a concern
  • BINARY: use for very large indexes where memory is the primary constraint

Precision is set at index creation time and cannot be changed without recreating the index.


Get Vector by ID

Retrieve a single vector and its metadata by ID.

vector = index.get_vector("doc1")

Delete Vector by ID

Deletion is irreversible.

index.delete_vector("doc1")

Delete Vectors by Filter

Delete all vectors matching specific filter conditions.

index.delete_with_filter([/* filter expression */]) e.g: index.delete_with_filter([{"tags": {"$eq": "important"}}])

For filter expression , see Filtering: Operators.