Weaviatedatabase

Integrating Weaviate with Your AI MVP: A Practical Guide

Weaviate is an open-source vector database that combines semantic vector search with traditional keyword search (BM25) in a single query, making it a strong choice for AI products where neither pure vector search nor pure keyword search is sufficient on its own. For SpeedMVPs clients who need self-hosted vector storage for data sovereignty reasons, or who are building search products where exact term matching and semantic similarity are both important, Weaviate is the tool we reach for. Based in Hemel Hempstead, SpeedMVPs delivers Weaviate-integrated AI MVPs within our standard two to three week timeline, with fixed pricing from GBP 8,000 and full code ownership handed over on completion. The self-hosting option separates Weaviate from managed-only alternatives: for UK law firms, NHS-adjacent organisations, and financial services teams where ICO guidance or FCA data classification rules prevent sending document content to a US-based cloud service, running Weaviate on infrastructure the client controls is a compliance requirement, not a preference. The EU AI Act's Article 10 requirements around data governance also create pressure toward auditable, self-hosted vector infrastructure for higher-risk AI use cases. SpeedMVPs has delivered self-hosted Weaviate deployments for regulated UK clients where no managed cloud vector service was acceptable, with full GDPR documentation included in the handover. This guide covers where Weaviate fits in a production AI stack, its hybrid search capabilities, and how its self-hosting option serves UK and EU clients with strict data residency requirements.

What Is Weaviate and Why SpeedMVPs Uses It

Weaviate is an open-source vector database built in Go, offering both a managed cloud service (Weaviate Cloud) and a self-hosted deployment via Docker or Kubernetes. Its defining capability is hybrid search: a single query can blend BM25 keyword relevance scoring with vector similarity scoring using a configurable alpha parameter, returning results ranked by a weighted combination of both signals. SpeedMVPs uses Weaviate in two specific scenarios. The first is self-hosted deployment for clients with strict data residency requirements. NHS Digital-regulated data, financial data classified as sensitive by FCA guidance, and any data subject to ICO enforcement action for improper transfers cannot flow to a US-based managed cloud service without adequate safeguards. Weaviate running on a client's own infrastructure (or a cloud region they control) satisfies these requirements in a way that Pinecone's managed cloud cannot. The second scenario is hybrid search requirements: products where users expect both keyword precision (searching for a specific product SKU, a legal case reference, or a contract clause with exact phrasing) and semantic understanding (finding documents about "employment dismissal" when the query is "fired from job"). The alpha parameter in Weaviate's hybrid search lets you tune the keyword-to-semantic balance per query based on the detected query type.

Setting Up Weaviate in a Production AI Project

Weaviate can be deployed as a managed cloud service or self-hosted. The setup differs significantly between the two. For Weaviate Cloud (managed): Create an account and provision a cluster in the appropriate region (EU West for UK/EU data residency). Generate an API key and store it in your secret manager. The Weaviate Cloud console provides a schema explorer and query playground for initial development. For self-hosted (Docker): Pull the Weaviate Docker image and define a docker-compose.yml that includes the Weaviate service, a volume for data persistence, and optional module containers (text2vec-openai for automatic embedding via OpenAI, or text2vec-transformers for local embedding). Configure the ENABLE_MODULES environment variable to specify which vectoriser and module capabilities to activate. Set AUTHENTICATION_APIKEY_ENABLED and define API keys for access control. For production self-hosting on Kubernetes: Use Helm chart deployment with persistent volume claims for data storage. Set resource requests and limits appropriate for your vector dataset size - Weaviate is memory-intensive because it loads the HNSW index into RAM for fast nearest-neighbour search. A dataset of one million 1536-dimension vectors requires roughly 6 GB of RAM for the index alone. Schema design in Weaviate uses Classes (equivalent to collections or tables). Each class has properties (fields) with data types, and a vectoriser configuration specifying how vectors are generated. Define your schema deliberately before ingesting data - changing schema after ingestion requires re-ingestion of affected data. Configure tokenisation settings on text properties used for BM25 search. The word tokenisation is appropriate for most English text; use whitespace tokenisation for code or hyphenated identifiers where word-level tokenisation produces incorrect tokens. Set up backup configuration from the start. Weaviate supports S3-compatible backup targets. For self-hosted deployments, configure automated daily backups to prevent data loss from container or volume failures.

Key Features and Capabilities

Hybrid search is Weaviate's most distinctive feature. A single GraphQL query can specify both a nearText (semantic) vector search and a bm25 (keyword) search, with an alpha parameter (0 to 1) controlling the blend. Alpha of 0 is pure BM25 keyword search; alpha of 1 is pure vector similarity search; alpha of 0.5 gives equal weight to both. This allows per-query tuning: use higher alpha for conceptual questions, lower alpha for precise term lookups. Weaviate's module system extends its capabilities. The text2vec-openai module automatically generates embeddings via the OpenAI API at ingest and query time, removing the need to manage a separate embedding step in your pipeline. The generative-openai module integrates RAG directly into the database query: retrieve relevant objects and generate a response in a single API call. The reranker-cohere and reranker-transformers modules add a reranking step after initial retrieval, improving precision for multi-stage retrieval pipelines. Multi-tenancy is a first-class feature in Weaviate 1.20 and later. Each tenant gets an isolated shard within the same class, with tenant-level activation and deactivation for cost management (inactive tenants' shards are offloaded to disk, reducing memory consumption). For SaaS AI products with many customers, this is more efficient than maintaining separate Weaviate instances per customer. Weaviate's HNSW (Hierarchical Navigable Small World) index algorithm provides fast approximate nearest-neighbour search with tunable precision via ef and efConstruction parameters. Increasing ef improves recall at the cost of query latency; decreasing it favours speed. For production RAG applications, the default parameters provide a good balance, but tuning for your specific dataset size and query latency requirements is worth the effort. The GraphQL and REST APIs are well-documented and supported by official Python and JavaScript clients, as well as integration adapters in LangChain and LlamaIndex.

Real-World Workflow: Weaviate in an AI MVP

An example from SpeedMVPs' portfolio: an AI legal research tool for a UK law firm handling employment law cases. The product needed to search across case law, internal precedents, and client-specific notes - all held on the firm's own infrastructure under their data classification policy. Self-hosted Weaviate on the firm's on-premise server was the only viable option. A Docker Compose deployment included Weaviate, the text2vec-transformers module (using a locally-run all-mpnet-base-v2 model for embeddings without any external API calls), and a volume-backed data directory. All AI processing - embedding generation and vector search - ran on the firm's own hardware with zero data leaving their network. The schema defined three classes: CaseLaw (public case law from BAILII), InternalPrecedent (firm's own case notes), and ClientMatter (client-specific research notes with stricter access controls). Multi-tenancy within InternalPrecedent and ClientMatter isolated each solicitor's work product from colleagues without billing permissions to view it. Search queries used hybrid mode with alpha 0.4 for case law (keyword precision matters for case references like [2023] UKSC 15) and alpha 0.7 for semantic search over internal precedents (conceptual similarity matters more than exact phrasing). The 20 most relevant results were ranked and the top 5 passed to the LLM prompt, generating a research summary with citations. Because embedding ran locally via the transformers module, there was no per-embedding API cost and no data leaving the network. The only external API call was to the LLM for response generation - and even that was routed through Azure OpenAI UK South, keeping all data within UK infrastructure.

Cost and Pricing Considerations

Self-hosted Weaviate is free (MIT licensed). The cost is your infrastructure: a server or cloud VM with sufficient RAM for your HNSW index, CPU for query processing, and persistent storage for data and backups. For a dataset of one million vectors, a cloud VM with 8 GB RAM and 4 vCPUs (roughly GBP 50 to 80 per month on AWS or GCP UK regions) is sufficient. Larger datasets scale proportionally with RAM requirements. Weaviate Cloud (managed) pricing is instance-based. Sandbox clusters are free for development with limited resources and no SLA. Standard and Enterprise tiers are priced by instance size, with costs starting around USD 25 per month for a small cluster. Check current Weaviate Cloud pricing directly, as the structure has evolved as the product has matured. The economic argument for self-hosting Weaviate versus Pinecone depends on your dataset size and query volume. At small scale (under 500,000 vectors, moderate query volume), Pinecone Serverless is cheaper and simpler. At larger scale, or when data residency requires on-premise hosting, self-hosted Weaviate becomes the more cost-effective option. SpeedMVPs models both scenarios as part of architecture decisions for projects where vector database selection is not pre-determined by compliance requirements.

Alternatives to Weaviate

Pinecone is the managed alternative most teams consider alongside Weaviate. Pinecone is easier to operate (fully managed, no infrastructure to configure), has a larger community and more third-party integrations, and its Serverless tier has no minimum cost. The tradeoff is that Pinecone is cloud-only (no self-hosting), US-headquartered (relevant for some GDPR transfer assessments), and its hybrid search is available only on pod-based indexes. PostgreSQL with pgvector is the simplest alternative for products already running Postgres. Hybrid search in Postgres requires combining pgvector for semantic search with full-text search (tsvector/tsquery) in a single query, which is achievable but less elegant than Weaviate's native hybrid search API. For teams without a dedicated database operations function, keeping everything in Postgres simplifies the operational model significantly. Qdrant is an open-source vector database with a strong performance profile and a managed cloud option. It supports payload filtering (equivalent to Weaviate's property filtering) and sparse-dense hybrid search. Its REST and gRPC APIs are well-designed, and it is increasingly used as a self-hosted alternative to Pinecone. SpeedMVPs evaluates Qdrant alongside Weaviate for clients with self-hosting requirements.

Frequently Asked Questions

What is hybrid search in Weaviate and when should I use it?+

Weaviate's hybrid search combines BM25 keyword relevance scoring with dense vector similarity scoring in a single query. The alpha parameter controls the blend: 0 is pure keyword, 1 is pure vector. Use hybrid search when your users alternate between conceptual queries (where semantic similarity is most relevant) and precise term lookups (where exact keyword matching matters). For most enterprise search and RAG applications, a default alpha of 0.5 to 0.7 provides better overall recall than either pure approach. Pure vector search is the right choice only when exact keyword matching would never improve results.

Can Weaviate be deployed on-premise for NHS or financial services data?+

Yes. Weaviate is MIT licensed and can be deployed on any infrastructure you control: on-premise servers, private cloud VMs, or air-gapped environments. This makes it appropriate for NHS Digital-regulated datasets, FCA-classified financial data, and any data subject to ICO restrictions on international transfers. You are responsible for the infrastructure security, backup, and availability - Weaviate provides the software, not a managed service guarantee. SpeedMVPs has delivered self-hosted Weaviate deployments for regulated industry clients with full GDPR documentation of the data processing architecture.

How does Weaviate multi-tenancy work for SaaS AI products?+

Weaviate multi-tenancy assigns each tenant a separate shard within a class. All tenants share the same schema definition but have isolated data storage. Queries and mutations specify a tenant parameter to target the correct shard. Inactive tenants can be deactivated to offload their shard from memory to disk, reducing RAM consumption proportionally. This is more memory-efficient than separate classes per tenant for large numbers of customers. Enable multi-tenancy at class creation time - it cannot be added to an existing class.

Does Weaviate support automatic embedding generation, or do I handle embeddings myself?+

Both options are available. Weaviate modules (text2vec-openai, text2vec-cohere, text2vec-transformers) handle embedding generation automatically: you provide text at ingest time, and Weaviate generates and stores the vector. This simplifies the ingestion pipeline but couples your embedding model to Weaviate's module availability. Alternatively, bring your own vectors: generate embeddings in your application and provide them directly to Weaviate at ingest time. SpeedMVPs usually prefers bring-your-own-vectors in production for greater control over embedding model versions and the ability to migrate embedding models without schema changes.

How does Weaviate performance compare to Pinecone at scale?+

Benchmarks vary by hardware, dataset, and query pattern, but self-hosted Weaviate on appropriate hardware is competitive with Pinecone for datasets under 10 million vectors. At very large scale (tens of millions of vectors), Pinecone's managed infrastructure and purpose-built ANN algorithms typically offer more consistent latency without operational tuning. For most AI MVPs, both perform adequately, and the decision between them is driven more by compliance, cost, and operational model preferences than by raw performance differences.

SpeedMVPs integrates Weaviate into production AI products for UK and EU clients requiring self-hosted vector search, delivering complete AI MVPs in two to three weeks from GBP 8,000. Get a free consultation at speedmvps.co.uk

Get a Free Quote