Skip to main content

Weaviate

Weaviate is a production-ready vector database solution that provides advanced querying capabilities, gRPC support for high performance, and flexible schema management for production deployments.

Key Features

  • gRPC Support: Enhanced performance with gRPC connections
  • Advanced Filtering: Complex query operations with multiple conditions
  • Schema Management: Flexible schema definition for different data types
  • Cloud & Self-Hosted: Support for both Weaviate Cloud and self-hosted deployments
  • Scalable Storage: Handle millions of vectors with efficient indexing

Setup & Installation

Weaviate Cloud: Local Weaviate:
# Using Docker
docker run -d \
  --name weaviate \
  -p 8080:8080 \
  -e QUERY_DEFAULTS_LIMIT=25 \
  -e AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED='true' \
  -e PERSISTENCE_DATA_PATH='/var/lib/weaviate' \
  semitechnologies/weaviate:latest

Configuration Options

// Configure Weaviate vector store
vectorConfig := &vectorstore.Config{
    Enabled: true,
    Type:    vectorstore.VectorStoreTypeWeaviate,
    Config: vectorstore.WeaviateConfig{
        Scheme: "http",           // "http" for local, "https" for cloud
        Host:   "localhost:8080", // Your Weaviate host
        APIKey: "your-weaviate-api-key", // Required for Weaviate Cloud; optional for local/self-hosted

        // Enable gRPC for improved performance (optional)
        GrpcConfig: &vectorstore.WeaviateGrpcConfig{
            Host:    "localhost:50051", // gRPC port
            Secured: false,             // true for TLS
        },
    },
}

// Create vector store
store, err := vectorstore.NewVectorStore(context.Background(), vectorConfig, logger)
if err != nil {
    log.Fatal("Failed to create vector store:", err)
}
gRPC host should include the port. If no port is specified, port 80 is used for insecured connections and port 443 for secured connections.

Advanced Features

gRPC Performance Optimization: Enable gRPC for better performance in production:
vectorConfig := &vectorstore.Config{
    Type: vectorstore.VectorStoreTypeWeaviate,
    Config: vectorstore.WeaviateConfig{
        Scheme: "https",
        Host:   "your-weaviate-host",
        APIKey: "your-api-key",

        // Enable gRPC for better performance
        GrpcConfig: &vectorstore.WeaviateGrpcConfig{
            Host:    "your-weaviate-grpc-host:443",
            Secured: true,
        },
    },
}

Production Considerations

Performance: For production environments, consider using gRPC configuration for better performance and enable appropriate authentication mechanisms for your Weaviate deployment.
Authentication: Always use API keys for Weaviate Cloud deployments and configure proper authentication for self-hosted instances in production.
For the VectorStore interface API and usage examples, see Vector Store Architecture. For semantic caching setup, see Semantic Caching.