Open WebUI with pgvector: when keeping embeddings in your main PostgreSQL makes sense
If Open WebUI already stores its main database in PostgreSQL, pgvector keeps knowledge base embeddings in the same PostgreSQL family, so your team can run one database engine, one backup practice and one set of access controls for both. Open WebUI's retrieval features support 13 vector databases, and PGVector is one of them, so this is a supported choice rather than a workaround. This section is for the platform team lead, DBA or solution architect who is deciding whether a second data store is worth operating, and who needs to understand what the scaling requirements already rule out.
The scaling guide is the starting point. For multi-instance deployments, Open WebUI requires PostgreSQL instead of SQLite, because SQLite does not handle concurrent writes from multiple processes well. That requirement applies whether or not you use pgvector. The same guide warns that the default ChromaDB will crash in multi-process setups, so an external vector database is required once you run several workers or replicas. In practice, this means the default vector store is off the table for any scaled deployment, and the decision your team faces is which external store to use.
Confirm with your own environment before deciding. Check whether your PostgreSQL version is still in support, since the PostgreSQL versioning policy lists the supported majors and their end dates, and confirm that your DBA is willing to install and maintain the pgvector extension on the cluster that Open WebUI will use. Then estimate how many knowledge base documents and chunks you expect, because that drives the storage and memory the shared database must carry alongside chat history. Ask your DBA to review the sizing and backup plan together with the application settings, so that you know early whether pgvector fits your team or whether a dedicated vector database is the better fit.
Which vector store fits your deployment
A single Open WebUI instance serving an evaluation or a small team has the fewest constraints. The main question is whether you want one more database to run at all. Storing embeddings in the same PostgreSQL instance as the application data keeps backups, access control and patching in one place, which is usually the lighter path for a small footprint. The default ChromaDB is also workable at this scale, but the scaling guide only rules it out for multi-process setups, so a single-process deployment can stay on it if you prefer fewer moving parts.
- pgvector fit: Works well when one PostgreSQL instance already exists and the team can operate it.
- Dedicated store fit: Rarely justified here unless you plan to scale out soon.
- Database choice: SQLite is acceptable only with the database file on locally attached SSD or NVMe storage, not network storage.
- Change cost: Switching vector stores later requires re-indexing knowledge, so decide before users load large collections.
- Growth signal: A plan to add replicas should trigger a fresh review, because the answer changes at that point.
Confirm which vector store your installed version supports, who will own the PostgreSQL instance, and whether a second replica is planned within the expected life of this deployment.
A company deployment with several replicas needs PostgreSQL for the main database, Redis for shared state and shared file storage. The default ChromaDB is ruled out once several workers or replicas run, so an external vector store is required. Where your organization already runs a managed or DBA-supported PostgreSQL platform, pgvector lets the embeddings follow the same backup, replication and access processes, which avoids a separate service that nobody on the team has operated before.
- pgvector fit: Suits teams with an established PostgreSQL platform, an existing DBA function and tested backup and restore procedures.
- Dedicated store fit: Better when the vector workload needs its own scaling profile or the database team cannot take on extension and index maintenance.
- Extension ownership: A DBA should install and maintain the extension, with privileges kept narrow.
- Failover behavior: PostgreSQL does not detect primary failure on its own, so confirm the failover tooling covers the vector data path.
- Connection load: Confirm how replicas share connections to the database before adding a pooler.
Confirm the PostgreSQL version in use, the failover and backup design, and whether your DBA team will accept responsibility for the extension during upgrades.
Large knowledge collections with heavy metadata filtering or strict tenant separation put more pressure on the vector store than on the main database. Filtering by department, document owner or access group across many collections is where a dedicated engine can offer more controls. Open WebUI supports several dedicated options, including Qdrant and Milvus, each with its own multitenancy and hybrid search features. Choosing among them should follow your query patterns, not the database you already run.
- pgvector fit: Can remain viable when filters are modest, collections are manageable and the team is comfortable tuning PostgreSQL indexes.
- Qdrant fit: Relevant when filtering and metadata search dominate and high availability of the vector layer is a requirement.
- Milvus fit: Relevant when very large collections and multitenancy are the central requirement.
- Index maintenance: Benchmark index build and rebuild times against your own document volume, since these vary with hardware and data.
- Isolation review: Tenant separation must be tested end to end, including retrieval through the interface.
Confirm the expected collection count and growth, the filtering and tenant model your security team requires, and a test plan that measures retrieval quality on your own documents.
Configuration choices for pgvector in Open WebUI
This table compares the main decisions a team makes when it stores Open WebUI embeddings in PostgreSQL with pgvector. Read each row as a choice with a fit, a trade-off and a point where it becomes the better option. The main takeaway is that a shared database is simpler to run, while a separate vector instance isolates load, sizing and recovery.
| Decision | Option | Trade-off | When to choose it |
|---|---|---|---|
| Database placement | pgvector in the main Open WebUI database | One cluster to back up, patch and monitor, but vector load shares resources with chat and account data | Small or single-replica deployments where one DBA team already runs the cluster |
| Database placement | Separate PostgreSQL instance dedicated to vectors | Isolates index build and query load and lets sizing and recovery targets differ, at the cost of a second system to operate | Large knowledge collections or heavy re-indexing that would slow chat and login |
| Connection pooling | Direct connections from Open WebUI replicas | No extra component, but each replica and worker opens its own connections to PostgreSQL | Few replicas and a connection count the server comfortably supports |
| Connection pooling | PgBouncer in front of PostgreSQL | Adds a component to deploy, monitor and patch, and pooling modes must be checked against how Open WebUI uses sessions | Several replicas or workers that multiply connections; confirm compatibility with the Open WebUI release in use |
| Extension and database ownership | DBA installs the extension and owns the schema | Clear separation of privilege and change control, with an extra handoff when Open WebUI upgrades change the schema | Regulated environments where application accounts must not hold superuser rights |
| Extension and database ownership | Application role manages its own database objects | Fewer handoffs, but the application account gains rights that a privileged review may reject | Evaluation or small teams with no separate database administration function |
| Storage placement | Fast locally attached or dedicated volumes for the database | Higher cost per gigabyte and capacity planning, but more predictable index performance | Knowledge bases large enough that vector indexes and their memory needs grow noticeably |
| Replica routing | Single primary for all reads and writes | Simple and consistent, with no read offload and recovery tied to the primary | Most deployments until read load or recovery needs justify a standby |
| Replica routing | Hot standby for read-only queries | Can offload reads, but Open WebUI must be confirmed to route only safe queries to a standby; failover needs external tools | Read-heavy workloads or high availability goals with a tested failover process |
Setting up pgvector for Open WebUI with a DBA
This sequence moves Open WebUI embeddings into a PostgreSQL database with pgvector, with a DBA owning the database side and a test knowledge base proving the setup works end to end. Each step ends with a check that tells the team whether to continue.
Confirm the PostgreSQL major version
The DBA checks the PostgreSQL major version you plan to run against the supported list in the versioning policy. Supported versions are 18, 17, 16, 15 and 14, each with its own end-of-support date, and versions 13 and earlier are unsupported. Pick a version that stays supported for the expected life of the deployment, and confirm the pgvector build you need is available for that exact major version in your package source. The step is done when the chosen version and its end-of-support date are written into the change record.
Install the pgvector extension
A DBA installs the pgvector extension binaries on the database server or uses the vendor package for your platform, then enables the extension in the target database. Run the extension creation in the database Open WebUI will use for vectors, not in an unrelated system database. The check is a query against the extensions catalog that returns the vector extension with the installed version. If the query returns no row, stop and fix the installation before touching Open WebUI.
Create the schema and least-privilege role
The DBA creates a dedicated schema and a login role for Open WebUI, grants it only the rights it needs in that schema, and sets a strong password through your secrets process. Decide whether vectors share the main Open WebUI database or live in a separate database, and record that choice, because it drives backup and restore scope later. Authentication should use SCRAM rather than MD5 password authentication. The check is a successful connection as the new role and a failed attempt to read tables outside its schema.
Set the Open WebUI vector database configuration
Set the vector database to PGVector through the documented configuration keys for your install method, which may be environment variables in Docker Compose or Helm values in Kubernetes. Provide the connection string using the new role and the schema or database chosen in the previous step. Restart the Open WebUI service so the setting is read. Confirm the exact variable names against the features documentation for your release, because names can change between versions. The check is that the application starts without database errors in its logs.
Confirm the tables and vector index exist
After Open WebUI starts and initializes its schema, the DBA checks that the expected tables were created in the chosen schema and that a vector column exists with an index. Compare the table list before and after startup so you know exactly what Open WebUI created. The check is a catalog query that shows the vector column and index owned by the Open WebUI role. If tables appear in the wrong schema or owner, correct the role configuration before loading any documents.
Ingest a test knowledge base
Create a small knowledge base with a few documents whose answers you already know, such as a short internal policy and a product sheet. Upload them through the normal Open WebUI interface, then confirm the processing completes without errors in the logs. Count the stored chunks in the database and compare the number with what you expect from the document lengths. The check is a row count in the vector table that matches the uploaded test set.
Verify retrieval and record the baseline
Ask questions in a chat that is attached to the test knowledge base, using questions whose answers appear only in the test documents. Confirm the responses cite the expected documents and that a question with no matching content does not return unrelated text. Save the questions, expected sources and results as a baseline for future upgrades and tuning. The step is complete when every test question returns the expected source, and the database backup job has been tested against this schema.
How Open WebUI, PostgreSQL and pgvector connect
The diagram starts at the Open WebUI replicas, which send both application data and vector queries through an optional PgBouncer pool into the PostgreSQL primary. The primary holds the main database and the pgvector embeddings inside one trust boundary, and streams changes to a standby for replication. Redis and object storage sit outside that boundary as shared services every replica uses. Check that the pool, the standby and the shared services all sit on private networks the replicas can reach, and that only the replicas can open database connections.
Replicas reach pgvector through a pool, with Redis and file storage shared outside the database boundary.
Sizing pgvector for knowledge bases and shared load
Vector storage and query cost grow with the number of documents, chunks and embedding dimensions, so the size of the knowledge base you plan for today will not be the size you run in a year. Every uploaded file is split into chunks, and each chunk becomes a row holding an embedding vector. Storage, index size and the work done per similarity query all rise as those counts rise, and a higher-dimension embedding model makes each vector larger. Before the build starts, ask the Open WebUI team which embedding model and chunking settings you plan to use, then estimate chunk counts from a realistic document inventory rather than from file counts alone.
The harder problem is contention. Embedding generation, index maintenance and similarity queries compete with Open WebUI's ordinary writes (chat history, users, sessions and settings) for the same CPU, memory, disk I/O and connection slots on the PostgreSQL server. A bulk upload of a large knowledge base can slow chat responses for every user, and a busy chat load can make ingestion stall. Check the connection limit and how many connections Open WebUI opens per replica, and decide whether a pooler such as the one described in the PgBouncer documentation belongs in front of the database. The Open WebUI scaling guide is the place to request the sizing guidance for your topology, and the figures you need should come from there and from your own benchmark, not from this page.
Test with a representative corpus: the same file types, average document length, chunk settings and embedding model that production will use, loaded in full. Run a bulk ingestion, then a concurrent query test with simulated chat users, and record ingestion time, query latency, CPU, memory, disk I/O, connection counts and replication lag if you run standbys. Monitor the database continuously during the pilot with pg_stat_activity and the statistics views, and watch for long-running index builds and vacuum activity on the embedding table. Repeat the test after any change to the embedding model, because a new model usually changes the dimensions and forces re-indexing. Record the results and the numbers you accepted, so the capacity decision can be revisited when the knowledge base grows.
Securing the database that holds your embeddings
Embeddings live in the same PostgreSQL cluster as Open WebUI's own data, so the database becomes a second path to your documents. The cards below cover the controls that close that path: who can connect, how they authenticate, where traffic travels, how backups are protected and what is recorded.
Give Open WebUI its own role
Create a dedicated login role for Open WebUI with rights only on the database and schema it uses, and keep the DBA's administrative role separate. Confirm that the role cannot create roles, alter other databases or read tables owned by other applications. Review the grants after each Open WebUI upgrade, since new migrations can require new privileges. A narrow role limits the damage if the application credentials leak.
Use SCRAM, not MD5
Set password_encryption to scram-sha-256 and require scram-sha-256 in pg_hba.conf for the Open WebUI role. PostgreSQL 18 deprecated MD5 password authentication in favor of SCRAM, so a cluster that still accepts MD5 is carrying a known weakness forward. Rehash existing passwords after changing the setting, because stored MD5 hashes do not convert on their own. Confirm the Open WebUI client driver supports SCRAM before cutting over.
Encrypt connections and restrict the network
Require TLS for every connection from Open WebUI and from any pooler between them, and reject plaintext host entries in pg_hba.conf. Allow connections only from the subnet or security group where Open WebUI runs, not from the wider network. Keep the database off public addresses. Confirm that certificate validation is enabled on the client, not just that TLS is offered, so a spoofed server cannot receive the credentials.
Protect backups as sensitive data
Backups contain the full embedding table, and embeddings can reveal much of the text they were made from, so back them up with the same classification as the source documents. Encrypt backup files and the archive storage they land in, restrict who can restore them, and keep the encryption keys apart from the backup media. Ask whether restored copies in test environments are masked or deleted, because a restored staging database is an easy place for knowledge content to leak.
Continuous archiving docsRecord who connects and what changes
Enable PostgreSQL logging for connection attempts, authentication failures, disconnections and DDL statements, and ship those logs to a store the database administrators cannot quietly edit. Log checks matter most for the Open WebUI role, because a login from an unexpected host or a schema change outside an upgrade window is a strong signal. Agree in advance who reviews these logs, how often, and how long they are kept, and confirm that the log volume will not expose query text containing document content.
Remember Open WebUI permissions stop at the app
Open WebUI's groups and per-resource permissions decide what a signed-in user can see in the interface, but they do not apply to anyone who connects to PostgreSQL directly. A DBA, a backup operator or another service with the same database credentials can read every embedding and chunk regardless of knowledge base access. Decide which accounts can reach those tables, document that list, and treat direct database access as a separate access review from application access control.
Backing up embeddings alongside the main database
The core point is that pgvector embeddings are ordinary PostgreSQL data. The vector columns sit in regular tables in the same database that holds Open WebUI's users, chats and knowledge metadata, so your existing PostgreSQL backup method already covers them. Base backups combined with continuous archiving of WAL segments allow point-in-time recovery, as described in the PostgreSQL continuous archiving documentation (PostgreSQL continuous archiving and point-in-time recovery). Confirm with your DBA that the backup job targets the database Open WebUI actually uses, and that the vector tables are not excluded by a schema or table filter in the tooling. Do not assume they are covered; check the restored result.
The harder problem is consistency. Knowledge base chunks in the database point to files in the upload and storage backend, and Open WebUI needs both halves to answer questions. A database restored to 02:00 with a file store restored to 06:00 will show knowledge bases whose source documents are missing, or files that have no embeddings. Decide how the two are captured: for example, pause uploads during the backup window, snapshot the file storage at the same moment as the database, or accept a recorded gap and plan a re-index. Whichever you choose, write it down and make it the same for both sides of the restore.
Test the restore before you need it. Restore into a separate environment, start Open WebUI against it, and check that a known knowledge base returns answers that cite its source files. Record how long the restore took, since that is the figure your recovery plan depends on. Repeat the rehearsal after changes to the storage backend, the embedding model or the PostgreSQL major version. Ask your DBA and your Open WebUI administrator to agree on who signs off that the restored system is complete.
Limits to confirm before you commit to pgvector
Open WebUI can store retrieval embeddings in PostgreSQL through pgvector, but the fit depends on versions, scale behavior, tenancy, and how the database is run. The cards below list what to confirm with the vendor and in your own environment before you commit the knowledge store to this design.
Supported pgvector and PostgreSQL versions
Confirm which pgvector extension version and which PostgreSQL major version the current Open WebUI release supports, and get that in writing from the vendor or the release notes. Check the PostgreSQL version against the community support window, since a major version nearing end of life will need an upgrade plan before go-live. Record both versions in your change records so a future Open WebUI upgrade does not silently move you outside the tested pair.
PostgreSQL versioning policyIndex types and filtering at scale
Ask which pgvector index types Open WebUI creates, how they are built, and whether index parameters can be tuned without changing application code. Test filtered retrieval, such as limiting results to one knowledge base, at the document counts you expect, because filters can reduce recall or slow queries as tables grow. Benchmark with your own documents rather than relying on small demo collections.
Multitenancy support
Confirm whether Open WebUI supports isolating embeddings by tenant, department or business unit within the pgvector store, or whether isolation depends only on application permissions. If your organization needs separate data boundaries for different groups, check how deletions, re-indexing and backups behave per tenant. Treat a missing tenancy feature as a design constraint, not a configuration detail.
Migration path if you switch stores
Ask what the documented path is for moving embeddings from pgvector to another vector store such as Qdrant or Milvus, and whether it re-embeds documents or moves vectors. Re-embedding means the same embedding model must be available and the cost in time and compute repeats. Write down how you would export or re-index before the first knowledge base is loaded.
No automatic PostgreSQL failover
PostgreSQL provides hot standby and synchronous or asynchronous replication, but it does not detect a failed primary or promote a standby by itself. Any high availability design for the database that holds pgvector data needs external tooling for failure detection, promotion and client redirection, and that tooling must be tested against Open WebUI's own reconnection behavior. Confirm who owns that tooling and who is paged when it acts.
PostgreSQL failover docsQuestions buyers ask about pgvector with Open WebUI
What does a pgvector setup for Open WebUI cost and what drives the price up or down?
The cost is mostly people time, and it splits into one-time work and recurring work. One-time work covers installing the extension, sizing the database, designing high availability, setting up backups and testing a restore. Recurring work covers patching PostgreSQL, watching storage growth and handling upgrades. The main drivers are whether your DBA already runs PostgreSQL in production, how large your knowledge bases will become, whether you need failover and how much restore testing your policies require. Ask any partner for a quote that lists each of these as a separate line, with who performs each task and which environments are covered. DeployOpen does not publish prices; a quote follows from a written scope.
How long does a pgvector deployment take?
Duration depends on scope more than on the extension itself. A single-instance setup in an existing PostgreSQL estate is much smaller than a build with high availability, pooling, tested point-in-time recovery and a migration plan for existing knowledge bases. The schedule also depends on how quickly your DBA can approve changes, how long your change windows are and how many environments must be validated before production. Ask for a timeline tied to named milestones in the written scope, and confirm which of those milestones need your team's approval.
What must our team provide before the work starts?
Plan to provide the following before work begins:
- Database access: an account with rights to create the extension, or a DBA who runs the
CREATE EXTENSIONstep, plus a maintenance window for the install - Environments: a non-production PostgreSQL instance that matches production versions and storage, so sizing and restore tests are meaningful
- A test corpus: representative documents and queries, so retrieval quality and index behavior can be measured before go-live
- Backup and recovery targets: the recovery point and recovery time your organization requires, and access to your backup tooling
Confirm the exact list during scoping, since your identity, network and change-control rules may add items.
Can our own team implement this without an outside partner?
Yes, if you have people who can operate PostgreSQL and Open WebUI in production. The extension setup is short, but the work that matters is sizing, high availability design, backup and restore testing, and keeping the vector store consistent with Open WebUI's upgrades. Teams that already run PostgreSQL usually handle the database side well, while the application side needs someone who understands how Open WebUI writes embeddings. Before deciding, check whether your team has tested a restore of this exact database, not only backups that report success, and whether someone owns the work after go-live.
When is a dedicated vector database a better choice than pgvector?
Choose a dedicated vector database when vector search becomes the main workload, when collections grow large enough that index maintenance competes with your transactional database, or when you need features such as multitenancy or filtering that your current setup cannot meet. Open WebUI's retrieval features list 13 supported vector databases, including PGVector, Qdrant and Milvus. The scaling guide also states that the default ChromaDB will crash in multi-process setups, so an external store is required once you run several workers or replicas. Keeping pgvector is reasonable when your team already operates PostgreSQL well and the knowledge base is modest. Test both options with your corpus before committing.
Do we need a support retainer after go-live?
A retainer is optional, but most teams need someone to own recurring tasks. These include PostgreSQL minor updates, which replace executables and need a restart, major upgrades, which need a planned path through pg_upgrade or logical replication, restore tests and capacity reviews as knowledge bases grow. Some organizations cover this with an internal DBA and an internal Open WebUI owner. Others want a partner to run those tasks under written terms. Ask whether support includes upgrade planning, restore testing and response times, and whether the retainer covers both the database and the Open WebUI application.
How does high availability change the pgvector design?
Adding high availability changes the design more than the install does. PostgreSQL supports hot standby servers for read-only queries, and both synchronous and asynchronous replication. However, PostgreSQL does not detect a primary failure or notify the standby on its own, so automatic failover needs external tools. Open WebUI with multiple replicas also needs Redis and shared file storage, and tokens stay valid until they expire if Redis is missing. Ask whether your design includes a tested failover procedure, a clear choice between synchronous and asynchronous replication, and a way to confirm that Open WebUI reconnects after a switch.
Where to verify the current pgvector and Open WebUI behavior
Check the Open WebUI release you plan to run against its own documentation before you size or configure anything. The Open WebUI features documentation lists the vector databases the retrieval layer supports, including PGVector, and the scaling guide explains when an external vector store is required. Read both pages for the exact release, not the latest one, because the supported vector database list and the way the retrieval settings are named can change between versions. Compare the release notes on the project's GitHub releases page against your planned version, and pay attention to any note about how existing knowledge bases are migrated or re-indexed when the vector store changes.
Next, confirm the PostgreSQL side with the versioning policy and the high availability documentation. The versioning policy shows which major version is still supported and its end date, which determines how long your pgvector setup will receive fixes. The high availability pages describe replication modes and the fact that PostgreSQL does not detect a failed primary by itself, so the failover tooling you choose must be verified against the exact setup. Confirm that the pgvector extension version you install is compatible with the PostgreSQL major version on your planned server, since the extension is not covered by the core documentation.
Record what you verified in a short internal note tied to the Open WebUI version, PostgreSQL major version and pgvector build, and repeat the check before each upgrade. Ask your DBA to test the restore of a knowledge base index after every change to the vector store configuration, because documentation describes intended behavior and only a restore test shows what your environment actually does.
How DeployOpen works on this
DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks. For Open WebUI with pgvector, the work starts with a written scope that fixes which PostgreSQL instance holds the vectors, how it is sized, backed up and upgraded, and what evidence your teams receive.
How we scope
- Confirm the PostgreSQL version, hosting model and whether a DBA owns the cluster before design starts
- Record the expected user count, knowledge base volume and replica count, since these set the vector table load
- Agree in writing whether pgvector runs in the existing database or a dedicated instance, with reasons
How we build
- Install and verify the pgvector extension with your DBA, then connect Open WebUI using the documented vector database settings
- Size storage, memory and connection pooling against a test knowledge base, and document the figures used
- Test retrieval after restore, failover and index rebuild, not only on a clean first install
How we hand over
- Deliver runbooks for backup and point-in-time recovery, extension upgrades and PostgreSQL minor and major upgrades
- Document the decision record on when a dedicated vector database would be the better choice for your growth
- Provide configuration, test results and access notes so your team can operate the setup without us
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer after handover
- Track Open WebUI release changes that affect the vector store and plan upgrades in a tested staging environment
- Coordinate with your auditors and compliance team by preparing controls and evidence, without issuing any attestation

