Skip to main content

vectors.upload

Uploads pre-computed vectors to a vector namespace. This is a synchronous operation.

Parameters

str
required
The name of the target vector namespace.
List[Dict]
required
A list of dictionaries. Each dict requires an id and a vector key.
Returns: Dict[str, Any] - A dictionary confirming the upload status. Raises: NamespaceNotFound, InvalidInputError.

Example

Upload Vectors Example

Vector Data Structure

For vector uploads, ensure your vectors match the namespace dimension:
Vector Structure

Complete Example

Complete Vector Upload Example

Important Notes

Synchronous Processing: Vector uploads are processed immediately and are available for search right away.
Dimension Match: Vectors must match the exact dimension specified when the namespace was created. All vectors in a batch must have the same dimension.

Vector Requirements

  • Dimension Match: Must match namespace dimension exactly
  • Common Dimensions: 384, 768, 1536, 3072
  • Value Range: Normalized vectors preferred (typically -1.0 to 1.0)
  • Batch Size: Max 1000 vectors per request, Recommended 100-500
  • Precision: Float32 precision, up to 7 decimal places

Common Embedding Models

  • OpenAI text-embedding-3-large: 3072 dimensions
  • OpenAI text-embedding-3-small: 1536 dimensions
  • OpenAI text-embedding-ada-002: 1536 dimensions
  • Sentence-BERT: 384 or 768 dimensions
  • Universal Sentence Encoder: 512 dimensions

Best Practices

  • Use high-quality, domain-appropriate embedding models
  • Normalize vectors to unit length for cosine similarity
  • Ensure consistent preprocessing and tokenization
  • Test with sample searches before large uploads
  • Upload 100-500 vectors per request for best performance
  • Use meaningful IDs for easier management and updates
  • Include original text when possible for result display