SysArt
Book a briefing
SysArt

Private LLMs and RAG

Vector Database Architecture for On-Premises RAG Pipelines

How to choose and run a self-hosted vector database for on-premises RAG: pgvector, Qdrant, Milvus or Weaviate, memory sizing, quantisation, tenancy and upkeep.

Last reviewed by SysArt AI Architecture Team6 min readHow we review

In short

For on-premises RAG, choose the vector database your team can operate reliably. pgvector suits teams already running PostgreSQL; Qdrant, Milvus and Weaviate are dedicated engines with more vector-specific features, at the cost of another system to run. Size memory from vector count and dimensions, enforce access control on every query, and test restores of the index.

Key takeaways

  • pgvector keeps vectors next to relational data under one backup and access model; dedicated engines such as Qdrant, Milvus and Weaviate add vector-specific features but are another stateful system to run.
  • Raw float32 vectors need 4 bytes per dimension: five million 1,536-dimension embeddings take about 31 GB before index, metadata and replicas.
  • Quantisation cuts memory, by about four times for scalar and 32 times for binary quantisation in Qdrant, usually with rescoring against the original vectors.
  • Derive tenant and permission filters from the authenticated identity on the server for every query; in shared collections, one missing filter can leak data.
  • Store the embedding model and version with every vector, because changing the model means re-embedding the corpus.
Engineer standing in front of a large server infrastructure

Why is the vector database an infrastructure decision?

The vector database stores the embeddings that retrieval-augmented generation (RAG) searches, so its recall, latency and access control shape every answer. On-premises it is also a long-lived, stateful service that must fit your backup routines, security controls and capacity planning. Treating it as a configuration detail tends to surface later as memory pressure, unclear replication behaviour or upgrades that need a full re-index.

This post compares the main self-hosted options, then covers memory sizing, the embedding pipeline, tenant isolation and day-to-day operations. If embeddings are new to you, start with our explainer on vector embeddings.

Which self-hosted vector databases fit on-premises RAG?

Four open-source options cover most on-premises deployments. pgvector adds vector search to PostgreSQL, while Qdrant, Milvus and Weaviate are dedicated vector databases.

  • pgvector is a PostgreSQL extension. It offers HNSW indexes, which build more slowly and use more memory but give a better speed-recall trade-off, and IVFFlat indexes, which build faster and use less memory. It can index vectors of up to 2,000 dimensions, or up to 4,000 with half-precision vectors. You keep relational joins, one backup target and PostgreSQL’s access controls.
  • Qdrant is a dedicated vector search engine. Its capacity planning guide describes memory tiers, from data pinned in RAM to memory-mapped files loaded on demand, and it supports several quantisation methods.
  • Milvus is built as a distributed system: an access layer of stateless proxies, a coordinator, and worker nodes for streaming data, queries and background work such as compaction and index building. It relies on etcd for metadata, object storage such as MinIO or S3, and a write-ahead log service such as Woodpecker, Kafka or Pulsar.
  • Weaviate is a vector database with built-in multi-tenancy that stores each tenant on a separate shard.
OptionArchitectureFits best whenWhat you take on
pgvectorExtension inside PostgreSQLYou already run PostgreSQL and want vectors next to relational dataIndex tuning inside your database; dimension limits for indexes
QdrantDedicated vector search engineYou need filtering, quantisation and memory tiers in a dedicated serviceAnother stateful service to secure, back up and upgrade
MilvusDistributed system with separate access, coordination, worker and storage layersLarge or multi-team workloads that need to scale outetcd, object storage and a log service to operate
WeaviateVector database with shard-per-tenant multi-tenancyMany tenants that need data isolationAnother stateful service and tenant lifecycle management

Pick the option your team can operate. A dedicated engine pays off when your scale or feature needs exceed what you can comfortably run inside PostgreSQL.

How much memory does a vector index need?

Start from the raw vectors. A float32 vector needs 4 bytes per dimension, so five million 1,536-dimension embeddings need about 31 GB for the vectors alone, per replica. Qdrant’s capacity guide calculates dense vector size as the number of points, times the replication factor, times the dimensions, times the bytes per dimension. It then adds the HNSW graph, payload, payload indexes and identifier tracker separately, and plans 20% headroom in its worked example.

Several techniques reduce the footprint:

  • Half precision. pgvector can index vectors at half precision for smaller indexes.
  • Scalar quantisation. Qdrant reduces each float32 component to one byte, cutting vector memory by a factor of four, and reports that the error introduced is usually less than 1% in its experiments.
  • Binary quantisation. One bit per component reduces memory by a factor of 32. Qdrant notes that it is efficient only for high-dimensional vectors with a centred distribution and recommends rescoring with the original vectors. pgvector also supports binary quantisation through expression indexes, with re-ranking recommended.
  • Product quantisation. Qdrant offers up to 64 times compression, with a loss of accuracy.
  • Disk-backed storage. With memory-mapped vectors, the operating system caches only recently used pages, at the cost of slower queries for data that is not cached.

Rescoring reads the original vectors, so if those sit on disk it slows search down. Measure recall on your own queries before accepting any of these trade-offs; our post on RAG evaluation describes how.

How should the embedding pipeline connect to the database?

Treat the embedding model as part of the index schema. Embeddings from different models are not comparable, so changing the model means re-embedding and re-indexing every document, which takes time and GPU capacity for a large corpus.

  • Store the model name and version with every vector, so you always know which model produced it.
  • Run old and new indexes side by side during a model change, re-embed incrementally, and switch traffic only after the new index matches or beats the old one on a held-out set of real queries.
  • Separate ingestion from serving. Run bulk embedding jobs on workers that do not compete with interactive queries for GPU capacity, and size that capacity with the LLM GPU sizing calculator.
  • Keep keyword search in view. Test whether keyword search, alone or combined with vector search, finds exact identifiers such as contract or part numbers better on your queries.

Our post on the embedding model lifecycle covers model changes in detail.

How do you isolate tenants and enforce permissions?

Choose between physical separation and filtered sharing, and enforce either one on the server. Separate collections or databases per tenant give the strongest isolation but multiply index memory, backups and migrations. Shared collections are cheaper to run but depend on every query carrying the right filter.

  • Weaviate stores each tenant on a separate shard, so data in one tenant is not visible to another.
  • pgvector inherits PostgreSQL row-level security, which restricts the rows each user can read or change. Once it is enabled, access is denied by default unless a policy allows it. Superusers, roles with the BYPASSRLS attribute and, normally, table owners bypass it, so the application must not connect as those roles, or the table must use FORCE ROW LEVEL SECURITY.
  • Shared collections in any engine need a gateway that injects tenant and permission filters from the authenticated session, rather than trusting the client to supply them.

Filtering interacts with approximate search. pgvector applies filters after scanning the index, so a filtered query can return fewer results than requested: with HNSW and the default search setting of 40 candidates, a filter that matches 10% of rows returns about four rows on average. pgvector’s iterative index scans keep scanning until enough results are found. Our post on policy-enforced RAG boundaries covers the policy model behind these filters.

How do you operate a vector database day to day?

Monitor retrieval quality as well as infrastructure health. Useful signals include query latency per collection, recall on a fixed set of probe queries run on a schedule, index size and memory use per tier, ingestion backlog and replica health.

Plan background work. Compaction and index building consume resources, and Milvus runs them on dedicated data nodes for that reason, so schedule heavy jobs away from peak hours or isolate them. In PostgreSQL, review maintenance settings for tables that receive heavy ingestion.

Include the vector database in backup and restore testing. Measure how long a full restore and any re-indexing take, and record that recovery time alongside your other services. Test version upgrades on a copy before they reach production.

For the wider design, see our explainer on retrieval-augmented generation and how SysArt implements enterprise RAG with permission-aware retrieval and evaluation.

Featured image by Donald Wu on Unsplash.

Frequently asked questions

Which vector database is best for on-premises RAG?

There is no single best option. If you already run PostgreSQL, pgvector keeps vectors, metadata and access control in one database with one backup. Qdrant and Weaviate add dedicated features such as quantisation, memory tiers or built-in multi-tenancy. Milvus suits large distributed workloads but brings more components to operate. Choose the one your team can secure, back up and upgrade.

How much memory does a vector index need?

Start with the raw vectors: number of vectors times dimensions times 4 bytes for float32, multiplied by the number of replicas. Five million 1,536-dimension embeddings need about 31 GB per replica before the index graph, metadata and payload indexes. Qdrant's capacity guide adds these separately and plans 20% headroom in its worked example. Quantisation or disk-backed storage reduces the memory needed.

Is pgvector enough for enterprise RAG?

Often, if your corpus and query load fit one PostgreSQL deployment. pgvector offers HNSW and IVFFlat indexes, indexes vectors of up to 2,000 dimensions, or 4,000 at half precision, and inherits PostgreSQL's backup and row-level security. Filters are applied after the approximate index scan, so filtered queries can return too few results unless you enable iterative index scans.

How should multi-tenancy work in a vector database?

Use separate collections or databases where tenants need strict isolation, and shared collections with server-side filters where there are many small tenants. Weaviate stores each tenant on its own shard. PostgreSQL row-level security restricts rows per user and denies access by default once enabled, but superusers, roles with BYPASSRLS and normally table owners bypass it, so applications must not connect as those roles.

Do we need to re-index when changing the embedding model?

Yes. Embeddings from different models are not comparable, so a new embedding model means re-embedding every document. Store the model name and version with each vector, build the new index alongside the old one, compare retrieval quality on a held-out set of real queries, and switch traffic only when the new index performs at least as well.

Sources

  1. pgvector: README (version 0.8.7) · checked 27 October 2026
  2. Qdrant documentation: capacity planning · checked 27 October 2026
  3. Qdrant documentation: quantization · checked 27 October 2026
  4. Milvus documentation: architecture overview · checked 27 October 2026
  5. Weaviate documentation: multi-tenancy · checked 27 October 2026
  6. PostgreSQL 18 documentation: row security policies · checked 27 October 2026

Related insights

Plan your private AI with people who build it

Book a briefing. We look at your use case, data and constraints, and you leave with the deployment options and governance steps that fit.