import mixpeekfrom mixpeek.rest import ApiException# Configure the clientconfiguration = mixpeek.Configuration( host="https://api.mixpeek.com")# Create an API clientwith mixpeek.ApiClient(configuration) as api_client: # Create an instance of the Collections API collections_api = mixpeek.CollectionsApi(api_client) try: # List collections collections = collections_api.list_collections( authorization="Bearer sk_xxxxxxxxxxxxx", x_namespace="ns_xxxxxxxxxxxxx" ) print("Collections:", collections) except ApiException as e: print(f"Exception: {e}")
Standalone namespaces let you store and query precomputed vectors directly —
no buckets, collections, or extractors required. This is the fastest path for
agents that already have embeddings. The high-level Mixpeek client exposes the
MVS primitives ergonomically; every call sends your namespace as the
X-Namespace header automatically.
from mixpeek import Mixpeekmp = Mixpeek(api_key="sk_xxxxxxxxxxxxx", namespace="my-vectors")# 1. Create a standalone namespace with one or more vector configs.mp.namespaces.create( namespace_id="my-vectors", mode="standalone", vector_configs=[{"name": "text_8", "dimension": 8, "metric": "cosine"}],)# 2. Upsert documents with your own vectors (direct write, no pipeline).mp.namespaces.documents.upsert( namespace_id="my-vectors", documents=[ { "document_id": "doc-1", "vectors": {"text_8": [0.11, 0.32, -0.38, -0.41, 0.006, 0.34, -0.40, -0.52]}, "payload": {"body": "hello world", "category": "docs"}, } ], # Optional: request a write token for read-your-writes consistency. options={"write_token": True},)# 3. Query is unified on retrievers. Create a retriever with a feature_search# stage and execute it. The X-Namespace header is sent for you.retriever = mp.retrievers.create( retriever_name="byov-search", stages=[ { "stage_name": "feature_search", "stage_type": "filter", "config": { "stage_id": "feature_search", "parameters": { "final_top_k": 5, "searches": [ { "feature_uri": "text_8", "query": {"input_mode": "vector", "value": "{{INPUT.qv}}"}, "top_k": 5, } ], }, }, } ], input_schema={"qv": {"type": "array", "required": True}},)results = mp.retrievers.execute( retriever["retriever_id"], inputs={"qv": [0.11, 0.32, -0.38, -0.41, 0.006, 0.34, -0.40, -0.52]},)
The removed POST /v1/search endpoint has been replaced by this retriever
create + execute flow. Mixpeek.search(namespace_id=..., queries=[...]) is a
shortcut that builds and runs an ephemeral feature_search retriever for you.
A direct upsert is durable immediately, but retriever reads are eventually
consistent by default. To read your own just-written document, pass the
write_token from the upsert response back as the X-Write-Token header on
execute — it routes the read to the primary shard and bypasses caches:
res = mp.namespaces.documents.upsert( namespace_id="my-vectors", documents=[{"document_id": "doc-2", "vectors": {"text_8": [...]}, "payload": {}}], options={"write_token": True},)# res["write_token"] -> send as X-Write-Token on the next retriever execute.
Promote a standalone namespace to managed mode to map a vector index to an
inference service. After promotion the same feature_search stage accepts
input_mode: "text" and auto-embeds queries — no client-side embedding needed.
Before promotion, a standalone vector index has no inference mapping, so
input_mode: "text" / "content" queries return an actionable 400 telling you
to promote the namespace or use input_mode=vector with a precomputed embedding.