Documentation Index
Fetch the complete documentation index at: https://docs.mixpeek.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Upsert Documents
Insert or update documents with your pre-computed vectors and JSON payload. Up to 1,000 documents per request.
requests.post(f"{BASE}/namespaces/product-search/documents/direct", headers=headers, json={
"documents": [
{
"document_id": "prod-001",
"vectors": {"text_embedding": [0.12, -0.34, 0.56, ...]},
"payload": {"title": "Noise-Canceling Headphones", "price": 149.99, "in_stock": True}
},
{
"document_id": "prod-002",
"vectors": {"text_embedding": [0.08, 0.22, -0.41, ...]},
"payload": {"title": "Bluetooth Speaker", "price": 59.99, "in_stock": True}
}
]
})
# → {"inserted": 2, "document_ids": ["prod-001", "prod-002"]}
Vector dimensions are validated against namespace config. If a document with the same ID exists, it is overwritten.
Bulk Import
For large datasets, stream NDJSON directly to shard WALs. Returns 202 Accepted with a batch ID to poll.
curl -X POST "https://api.mixpeek.com/v1/namespaces/product-search/bulk-import" \
-H "Authorization: Bearer $MIXPEEK_API_KEY" \
-H "Content-Type: application/x-ndjson" \
--data-binary @products.ndjson
{"document_id": "prod-001", "vectors": {"text_embedding": [0.12, ...]}, "payload": {"title": "..."}}
{"document_id": "prod-002", "vectors": {"text_embedding": [0.08, ...]}, "payload": {"title": "..."}}
Search
Dense (Vector)
requests.post(f"{BASE}/search", headers=headers, json={
"namespace_id": "product-search",
"queries": [{
"vector_name": "text_embedding",
"vector": query_embedding,
"top_k": 10,
"score_threshold": 0.7
}]
})
BM25 (Keyword)
Requires a text index on the target field.
requests.post(f"{BASE}/search", headers=headers, json={
"namespace_id": "product-search",
"queries": [{"text": "wireless noise canceling", "top_k": 10}]
})
Sparse
requests.post(f"{BASE}/search", headers=headers, json={
"namespace_id": "product-search",
"queries": [{"sparse_vector": {42: 0.8, 1337: 0.5, 9001: 0.3}, "top_k": 10}]
})
Hybrid
Combine multiple query types with RRF or DBSF fusion.
requests.post(f"{BASE}/search", headers=headers, json={
"namespace_id": "product-search",
"queries": [
{"vector_name": "text_embedding", "vector": query_embedding, "top_k": 20},
{"text": "wireless headphones", "top_k": 20}
],
"fusion": "rrf"
})
Filtered
Add payload filters to any query type. Filters narrow results before scoring.
requests.post(f"{BASE}/search", headers=headers, json={
"namespace_id": "product-search",
"queries": [{
"vector_name": "text_embedding",
"vector": query_embedding,
"top_k": 10,
"filters": {"price": {"$lte": 100}, "in_stock": True}
}]
})
Document Operations
| Operation | Method | Endpoint |
|---|
| Get by ID | GET | /v1/namespaces/{ns}/documents/{doc_id} |
| Update payload | PATCH | /v1/namespaces/{ns}/documents/{doc_id} |
| Delete | DELETE | /v1/namespaces/{ns}/documents/{doc_id} |
| Scroll (paginate) | POST | /v1/namespaces/{ns}/documents/scroll |
Update Vectors
| Operation | Method | Endpoint |
|---|
| Replace vectors (single doc) | PATCH | /v1/namespaces/{ns}/documents/{doc_id}/vectors |
| Batch replace vectors | POST | /v1/namespaces/{ns}/documents/update-vectors |
| Add new vector index | POST | /v1/namespaces/{ns}/documents/add-vectors |
Payload is untouched when updating vectors.