Objects
Objects are the fundamental data units stored in a collection. Each object has a unique ID, an embedding array, and optional metadata and filter fields.
Dense Object Fields
| Field | Required | Description |
|---|---|---|
| ID | Yes | Unique string identifier for the object |
| Vector | Yes | Dense embedding array (must match the collection dimension) |
| Meta | No | Arbitrary metadata object (returned in query results) |
| Filter | No | Key-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.
Python
collection = client.get_collection(name="my_collection")
collection.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 Object Fields
For hybrid collections, include sparse vector field components alongside the dense vector field:
| Field | Required | Description |
|---|---|---|
| Sparse Indices | Yes | Non-zero term positions in the sparse vector |
| Sparse Values | Yes | BM25 weights corresponding to each index position |
Python
collection.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 fields and sparse_model
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 you set at collection creation controls how Endee interprets these values: use endee_bm25 to send TF weights only (Endee applies IDF server-side), or default to send final scores as-is for SPLADE or custom BM25 models.
Maximum batch size is 10,000 objects per upsert call.
Precision
The precision parameter controls how objects are stored internally. Lower precision reduces memory and speeds up search at the cost of some accuracy.
| Precision | Bits | Storage | Speed | Accuracy |
|---|---|---|---|---|
| BINARY | 1-bit | Smallest | Fastest | Lower |
| INT8 | 8-bit | Small | Fast | Good |
| INT16 | 16-bit integer | Medium | Medium | Higher |
| FLOAT16 | 16-bit float | Medium | Medium | High |
| FLOAT32 | 32-bit float | Largest | Slower | Highest |
Python
from endee import Precision
# INT16 — recommended for most use cases
client.create_collection(name="my_collection", dimension=384,
space_type="cosine", precision=Precision.INT16)
# FLOAT32 — maximum accuracy
client.create_collection(name="precise_collection", dimension=384,
space_type="cosine", precision=Precision.FLOAT32)
# BINARY — minimum memory
client.create_collection(name="large_collection", 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 collections where memory is the primary constraint
Precision is set at collection creation time and cannot be changed without recreating the collection.
Get Object by ID
Retrieve a single object and its metadata by ID.
Python
obj = collection.get_object("doc1")Delete Object by ID
Deletion is irreversible.
Python
collection.delete_object("doc1")Delete Objects by Filter
Delete all objects matching specific filter conditions.
Python
collection.delete_with_filter([/* filter expression */])
e.g: collection.delete_with_filter([{"tags": {"$eq": "important"}}])For filter expression , see Filtering: Operators.