Create Vector Store
Create a new vector store for storing and querying document embeddings.
The vector store name must be unique within your account and follow naming conventions (3-63 characters, alphanumeric with hyphens/underscores). Once created, the embedding configuration and dimensions are immutable and cannot be changed. To use a different model, you must create a new vector store.
Embedding Configuration: Provide embedding_config (for base or custom model deployments),
embedding_model (shorthand for a base model), or dimensions only (raw embeddings).
- With
embedding_configorembedding_model: dimensions are auto-derived, and documents can be upserted with text content (auto-embedded) or with pre-computed embeddings. - With
dimensionsonly: the store accepts only pre-computed embeddings. Semantic/hybrid queries are not supported (lexical search only).
Indexed Fields: Optionally specify metadata fields to index at creation time. Only indexed fields can be used for filtering — indexing is required, not just a performance optimization. Additional indexed fields can be added later using the configure endpoint, but cannot be removed once added. Keep in mind that each indexed field increases write latency and storage overhead, so only index fields you actively filter on.
Create Vector Store
import os
from scale_gp_beta import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
vector_store = client.vector_stores.create(
name="name",
)
print(vector_store.id){
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"embedding_dimensions": 0,
"name": "name",
"updated_at": "2019-12-27T18:11:19.117Z",
"embedding_config": {
"model_deployment_id": "model_deployment_id",
"type": "models_api"
},
"indexed_metadata_fields": {
"foo": "string"
}
}Returns Examples
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"embedding_dimensions": 0,
"name": "name",
"updated_at": "2019-12-27T18:11:19.117Z",
"embedding_config": {
"model_deployment_id": "model_deployment_id",
"type": "models_api"
},
"indexed_metadata_fields": {
"foo": "string"
}
}