The GravixLayer SDK provides comprehensive vector database capabilities, allowing you to store, search, and manage high-dimensional vectors for AI, search, and analytics workflows.
Public Preview: Gravix Layer is currently in Public preview. Features are experimental and may have issues or break as ongoing updates to API endpoint and models continue.
Vector database operations allow you to:
- Create Indexes: Set up vector collections with specific dimensions, metrics, and cloud deployment options
- Upsert Vectors: Store and update vectors with metadata
- Search Vectors: Perform similarity searches using vectors or text
- Manage Vectors: List, retrieve, update, and delete vectors
- Batch Operations: Efficiently delete multiple vectors at once
- Text-to-Vector: Convert text to vectors using embedding models
Prerequisites
Before using vector operations, you need to set up your API key:
API Key Required: You must export your GravixLayer API key in your terminal before using vector operations. All vector operations are tied to your API key and account.
Set your API key:
Windows (CMD)
Windows (PowerShell)
Linux/macOS
set GRAVIXLAYER_API_KEY=your_api_key_here
$env:GRAVIXLAYER_API_KEY="your_api_key_here"
export GRAVIXLAYER_API_KEY=your_api_key_here
Quick Start
Here’s a simple example to get you started with vector operations:
Python SDK
JavaScript SDK
from gravixlayer import GravixLayer
client = GravixLayer()
# Create a basic index
index = client.vectors.indexes.create(
name="my-embeddings",
dimension=1024,
metric="cosine",
cloud_provider="AWS",
region="us-east-1",
index_type="serverless"
)
print(f"Created index: {index.id}")
import { GravixLayer } from 'gravixlayer';
const client = new GravixLayer({
apiKey: process.env.GRAVIXLAYER_API_KEY,
});
// Create a basic index
const index = await client.vectors.indexes.create({
name: "my-embeddings",
dimension: 1024,
metric: "cosine",
cloud_provider: "AWS",
region: "us-east-1",
index_type: "serverless"
});
console.log(`Created index: ${index.id}`);
Cloud Infrastructure
GravixLayer’s vector database supports multi-cloud deployment, allowing you to choose the best cloud provider and region for your needs.
Available Cloud Providers
| Provider | Regions | Index Types | Description |
| AWS | us-east-1 (Virginia) | serverless | Amazon Web Services |
| GCP | us-east1 (South Carolina) | serverless | Google Cloud Platform |
| Azure | eastus (Virginia) | serverless | Microsoft Azure (Coming Soon) |
| Gravix | eu-west-1 (London) | serverless | Gravix AI Cloud |
Supported Vector Types
- dense — Standard dense vectors (currently the only supported type)
Similarity Metrics
- cosine — Cosine similarity (recommended for most use cases)
- euclidean — Euclidean distance
- dotproduct — Dot product similarity
Supported Dimensions
| Model | Dimension | Description |
nomic-ai/nomic-embed-text:v1.5 | 768 | Nomic embedding model |
baai/bge-large-en-v1.5 | 1024 | BGE large English model |
microsoft/multilingual-e5-large | 1024 | Multilingual E5 model |