Skip to main content

Create Vector Database

Create a new vector database configuration to store and query high-dimensional vectors for semantic search.

Request Body

provider
string
required
Vector database provider:
  • PINECONE - Pinecone vector database service
  • ASTRA_DB - DataStax Astra DB vector search
  • WEAVIATE - Weaviate vector database
  • QDRANT - Qdrant vector search engine
  • SUPABASE - Supabase with pgvector extension
options
object
required
Provider-specific configuration options (see provider sections below for details)

Response

Returns the created vector database configuration.
id
string
Vector database configuration unique identifier
provider
string
Vector database provider
options
string
Encrypted configuration options
project_id
string
ID of the project this vector database belongs to
created_at
string
When the configuration was created (ISO 8601 format)
updated_at
string
When the configuration was last updated (ISO 8601 format)
curl --location --request POST 'https://api.plaisolutions.com/vector-db' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "provider": "PINECONE",
  "options": {
    "api_key": "your-pinecone-api-key",
    "environment": "us-west1-gcp-free",
    "index_name": "plai-vectors"
  }
}'

List Vector Databases

List all vector database configurations in the current project.

Response

vector_dbs
array
Array of vector database configuration objects
curl --location --request GET 'https://api.plaisolutions.com/vector-dbs' \
--header 'Authorization: Bearer YOUR_TOKEN'

Get Vector Database

Get detailed information about a specific vector database configuration.

Path Parameters

vector_db_id
string
required
The unique identifier of the vector database configuration

Response

Returns the vector database configuration object with all details.
curl --location --request GET 'https://api.plaisolutions.com/vector-dbs/vectordb_123' \
--header 'Authorization: Bearer YOUR_TOKEN'

Update Vector Database

Update vector database configuration settings.

Path Parameters

vector_db_id
string
required
The unique identifier of the vector database configuration

Request Body

provider
string
Updated vector database provider
options
object
Updated provider-specific configuration options

Response

Returns the updated vector database configuration object.
curl --location --request PATCH 'https://api.plaisolutions.com/vector-dbs/vectordb_123' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "options": {
    "api_key": "new-pinecone-api-key",
    "environment": "us-east1-gcp",
    "index_name": "plai-vectors-prod"
  }
}'

Provider Configuration

Each vector database provider requires specific configuration options:

Pinecone

{
  "api_key": "your-pinecone-api-key",
  "environment": "us-west1-gcp-free",
  "index_name": "your-index-name",
  "namespace": "default"
}
  1. Create a Pinecone account at pinecone.io
  2. Create a new project and get your API key
  3. Create an index with the desired dimensions (typically 1536 for OpenAI embeddings)
  4. Choose the appropriate environment/region
  5. Optionally specify a namespace for data isolation
  • Fully managed vector database
  • High-performance approximate nearest neighbor search
  • Real-time updates and deletes
  • Metadata filtering
  • Horizontal scaling

DataStax Astra DB

{
  "token": "your-astra-db-token",
  "api_endpoint": "https://your-database-id-region.apps.astra.datastax.com",
  "keyspace": "your-keyspace",
  "collection": "your-collection"
}
  1. Create an Astra DB account at astra.datastax.com
  2. Create a new vector database
  3. Generate an application token
  4. Create a keyspace and collection
  5. Configure the collection for vector search
  • Serverless vector database built on Cassandra
  • Multi-cloud availability
  • ACID transactions
  • JSON document model with vector search
  • Global distribution capabilities

Weaviate

{
  "url": "https://your-cluster.weaviate.network",
  "api_key": "your-weaviate-api-key",
  "class_name": "Document",
  "additional_headers": {
    "X-OpenAI-Api-Key": "your-openai-key"
  }
}
  1. Create a Weaviate cluster (cloud or self-hosted)
  2. Configure authentication if required
  3. Create schema classes for your data
  4. Set up vectorization modules (OpenAI, Cohere, etc.)
  5. Configure any additional modules needed
  • Open-source vector database
  • GraphQL and REST APIs
  • Built-in vectorization modules
  • Semantic search and hybrid search
  • Multi-modal support (text, images)

Qdrant

{
  "url": "https://your-cluster.qdrant.io",
  "api_key": "your-qdrant-api-key",
  "collection_name": "plai_vectors",
  "vector_size": 1536,
  "distance": "Cosine"
}
  1. Set up Qdrant (cloud or self-hosted)
  2. Create a collection with appropriate vector size
  3. Configure distance metric (Cosine, Euclidean, Dot product)
  4. Set up authentication if required
  5. Optionally configure payload indexing
  • High-performance vector similarity search
  • Rich payload support with filtering
  • Distributed deployment
  • Real-time updates
  • Advanced indexing algorithms (HNSW)

Supabase

{
  "url": "https://your-project.supabase.co",
  "key": "your-anon-key",
  "table_name": "documents",
  "vector_column": "embedding",
  "content_column": "content",
  "metadata_column": "metadata"
}
  1. Create a Supabase project
  2. Enable the pgvector extension in your database
  3. Create tables with vector columns
  4. Set up Row Level Security (RLS) policies
  5. Configure API keys and authentication
  • PostgreSQL with pgvector extension
  • Full SQL capabilities with vector operations
  • Row-level security
  • Real-time subscriptions
  • Built-in authentication and storage

Best Practices

1

Choose the Right Provider

Select a vector database provider based on your performance, scalability, and budget requirements
2

Dimension Consistency

Ensure all vectors have the same dimensions as configured in your vector database
3

Index Configuration

Configure appropriate index parameters for your expected query patterns and data size
4

Security

Store API keys and credentials securely, never expose them in client-side code
5

Monitoring

Monitor query performance and storage usage to optimize costs and performance

Vector Database Selection Guide

High Performance

Pinecone or Qdrant for maximum query speed and throughput

Cost Effective

Supabase with pgvector for budget-conscious projects with SQL needs

Enterprise

Astra DB for enterprise features, global distribution, and ACID compliance

Flexibility

Weaviate for multi-modal search and complex schema requirements

Performance Optimization

  • Use appropriate vector dimensions (768, 1536, 3072 are common)
  • Implement efficient batch operations for bulk updates
  • Consider using namespaces or collections to organize data
  • Monitor and tune index parameters based on your query patterns

Security Considerations

Vector databases often contain sensitive information:
  • Use encrypted connections (HTTPS/TLS)
  • Implement proper access controls and authentication
  • Regularly rotate API keys and credentials
  • Monitor access logs for unusual activity
  • Consider data residency requirements for compliance

Common Use Cases

Configure your vector database to power semantic search across documents, enabling users to find content based on meaning rather than exact keyword matches.

Recommendation Systems

Use vector similarity to build recommendation engines that suggest similar products, content, or services based on user behavior and preferences.

Retrieval-Augmented Generation (RAG)

Combine your vector database with language models to provide contextually relevant information for AI-powered applications.

Duplicate Detection

Identify duplicate or near-duplicate content by finding vectors with high similarity scores within your dataset.

Clustering and Classification

Group related items together or classify new content by finding the closest matching vectors in your database.