Upload pre-computed embeddings for advanced similarity search.
This endpoint accepts vector embeddings that you’ve generated externally,
allowing you to integrate with custom embedding models or existing vector databases.
The embeddings represent chunks of your content as numerical vectors.
The system stores these embeddings and makes them available for semantic search and similarity matching.
Use this when you want to leverage specialized embedding models or have existing vector representations.
When upsert=True, existing embeddings with the same chunk_id will be updated.
POST
/
embeddings
/
insert-raw-embeddings
Error
Copy
A valid request URL is required to generate request examples
Hit the Try it button to try this API now in our playground. It’s the best way to check the full request and response in one place, customize your parameters, and generate ready-to-use code snippets.
# Async usage is similar, just use async_client and awaitresult = client.upload.upload_embeddings( tenant_id="tenant_1234", sub_tenant_id="sub_tenant_4567", embeddings=[ [0.123413, 0.655367, 0.987654, 0.123456, 0.789012], [0.123413, 0.655367, 0.987654, 0.123456, 0.789012] ], file_id="CortexDoc1234")
Upload pre-computed embedding vectors directly to your tenant’s knowledge base. This is useful when you have your own embedding model or want to use embeddings from external sources.
Dimensional consistency validation across the tenant
Vector range and format validation
Database storage verification
Processing Time: Pre-computed embeddings are typically processed and searchable within 30 seconds to 2 minutes. Large embedding batches (1000+ vectors) may take up to 5 minutes. You can check processing status using the document ID returned in the response.
Default Sub-Tenant Behavior: If you don’t specify a sub_tenant_id, the embeddings will be uploaded to the default sub-tenant created when your tenant was set up. This is perfect for organization-wide embeddings that should be accessible across all departments.
Maximum dimensions: 2000 rows × 3024 columns; i.e, 2000 chunks with the dimensions, not more than 3024
Format: 2D array of numeric values (int or float)
Consistency: All embedding vectors must have the same dimension
Content: Embeddings array cannot be empty
Processing: Generates unique chunk IDs in format {batch_id}_{index} for each row.
Consider them as references of that particular embeddings vector. You will get back these chunk_ids, when you query something.
In the example on your right, the reference to [0.1, 0.2, 0.3, 0.4, 0.5] is CortexEmbeddings123_0
You can use these chunk IDs to link the original text which is being embedded
Dimensional consistency per tenant: All embedding vectors within a tenant must have identical dimensions. Different dimensional vectors require separate tenants
File ID Management: When you provide a file_id as a key in the document_metadata object, that specific ID will be used to identify your content. If no file_id is provided in the document_metadata, the system will automatically generate a unique identifier for you. This allows you to maintain consistent references to your content across your application while ensuring every piece of content has a unique identifier.
When you upload embeddings with a file_id that already exists in your tenant:
Overwrite Behavior: The existing embeddings with the same file_id will be completely replaced with the new embeddings
Processing: The new embeddings will go through validation and direct indexing (no embedding generation needed)
Search Results: Previous search results and vector data from the old embeddings will be replaced with the new embeddings
Idempotency: Uploading the same embeddings with the same file_id multiple times is safe and will result in the same final state
Important: When overwriting existing embeddings, all previous vector data, chunk IDs, and search indexes associated with that file_id will be permanently removed and replaced. This action cannot be undone.
Example Success Response for Duplicate File ID:
Copy
{ "message": "Embeddings uploaded successfully. Existing embeddings with file_id 'emb_123456' have been overwritten.", "file_id": "emb_123456", "status": "success"}