AI & LLMs

pgvector vector search services

pgvector is a PostgreSQL extension that stores embeddings and runs similarity search inside the database you already have. For most retrieval features it removes the need for a separate vector database entirely.

Rated 5.0 on Clutch across 41 reviews

pgvector, explained simply

pgvector is an add-on for the PostgreSQL database that lets it store embeddings and find items by similarity of meaning, not just by matching exact words.

First, two AI ideas. An embedding is a list of numbers an AI model produces to capture what a piece of text means; that list is called a vector. Texts with similar meaning get similar numbers, even with different words. Imagine a library where books are shelved by topic rather than title, so ’cancel my plan’ sits beside ’end subscription’. pgvector adds that kind of shelving to PostgreSQL, a widely used database that many products already run on.

Each document, help article or product description is split into passages and sent to an embedding model, which returns a vector for each. Those vectors are saved in a column next to the original rows. When a user searches or asks a question, their words are turned into a vector the same way, and the database returns the closest matches. An index, a kind of shortcut map, keeps this fast. Ordinary filters, such as customer or permission, apply in the same query.

If you already run PostgreSQL, pgvector is usually the simplest way to add AI search to an existing product, or the retrieval step behind RAG and knowledge systems: no new system to buy, back up or secure, and your team already knows how to operate it. It is an extension installed into the existing database, not a migration. Very large or very busy search workloads can eventually outgrow it, and then a dedicated vector database is worth considering, but we measure before suggesting that move.

Words you’ll hear

Embedding
A list of numbers an AI model produces to represent the meaning of a piece of text, an image or other content.
Vector
The list of numbers itself. Vectors that sit close together stand for content with similar meaning.
Semantic search
Search that matches what the user means rather than the exact words they typed.
RAG
Retrieval-augmented generation: finding the relevant passages in your own content first, then giving them to a model to answer from.

Where we use pgvector

pgvector is part of the stack on these 2 services. Each page covers how we work, what you get and what it costs to start.

pgvector in practice

pgvector adds a vector column type and similarity search to PostgreSQL, so embeddings live in the same rows, tables and transactions as the data they describe. That sounds like a small convenience and turns out to be most of the argument: permissions, backups, joins and deletes keep working, and there is no second system to keep in sync.

Where it needs care is in the details of approximate search. Indexes have to be built and tuned, filters interact with the index in ways that can return fewer results than you asked for, and a change of embedding model means re-embedding everything. None of that is hard, but it is easy to get wrong by default, and the symptom is a retrieval feature that quietly returns worse answers rather than one that fails loudly.

What we build with pgvector

The search step that finds the right passages before a model answers, with citations back to the source.

Search that matches meaning rather than exact words, next to the filters your users already use.

Related documents, products or tickets, computed where the data already lives.

Is pgvector right for you?

Ask us

A good fit when

  • You already run PostgreSQL and want retrieval without another system
  • Search must respect the same permissions as the rest of your data
  • Embeddings should be updated and deleted in the same transaction as their source rows
  • Your managed PostgreSQL service already supports the extension

Probably not when

  • Vector search load is heavy enough to compete with your main application traffic
  • You need features a dedicated vector database offers, such as built-in sparse-dense hybrid search
  • The vector index is far larger than the rest of your data and needs its own scaling
  • Your database host does not allow the extension and moving host is not an option

What we run alongside pgvector

The rest of the setup, and why each piece is there. We keep this list short on purpose — every dependency is something someone has to maintain.

PostgreSQL full-text search
Keyword search in the same database, combined with vectors for hybrid retrieval.
HNSW indexes
The index type most retrieval features should use, with recall and speed tuned to your data.
Supabase, Amazon RDS or Cloud SQL
Managed PostgreSQL services that support the extension.
An embedding model
From OpenAI, Mistral, Google or an open model — chosen by measured retrieval quality, not by default.
Row-level security
PostgreSQL’s own access rules applied to retrieval, so search cannot leak what a user could not open.

Why pgvector

Start your project

One database, not two

Embeddings sit beside the rows they describe, so permissions, backups and joins keep working.

Filters for free

Ordinary SQL conditions combine with similarity search, which is how access rules are enforced on retrieval.

Familiar operations

Your team already knows how to run, back up and monitor PostgreSQL.

What we get called in to fix

Get a second opinion

Search with no index

Similarity queries scanning every row because no vector index was created. Fine in testing, slow in production.

Filters that shrink the results

A filter applied after the approximate search, so a query for ten results returns three. Index settings and query structure fix it.

Mixed embedding models

Vectors from an old and a new model stored side by side and compared with each other. Re-embedding with one model, tracked per row, is the only reliable fix.

pgvector or the alternative

The comparisons we are actually asked to make, answered the way we would answer them on a call.

pgvector keeps one database and one set of operations. Qdrant earns its place when vector search becomes a large, busy system of its own.

If you already run a search cluster with strong keyword search, adding vectors there can make sense. If you do not, pgvector avoids introducing one.

When I’ve seen Keyra in action, she has felt exactly like the project I’ve pictured.

Denis Andrei Valcu
CEO, Royal Keys Market Limited
Bookster
Shepherd
Planable
Omniconvert
Salt & Pepper
Bookr
OPEN
NNC Services

Generating growth for 60+ clients across the globe

See all case studies
Delmain
ABIT
EO SEE
Rezolvit
Zerotak
Life in Codes
TEDx Cluj
around25
ialoc
addo
Tickbird
CANGO Mobility

Planning a project with pgvector? Let’s talk.

Tell us the short version

This could be the first step towards a new and successful collaboration. A one-line idea and a finished spec are both fine — tell us the problem, the deadline you’re working to and what’s in your way.

We reply within one working day.

  • A free intro call, no obligation
  • A rough budget and timeline within 48 hours
  • A free second opinion on your existing code

Rather talk it through first?

Sales & Consulting:
Cluj-Napoca & London
Delivery Center:
Cluj-Napoca

Give us a ping!

We’re always open to new ideas.

Budget (optional)
When would you like to start? (optional)

Explore our technologies, services and work

Questions about pgvector Vector Search Services

pgvector until scale or search features demand more. Most products never reach that point, and one database is simpler to run.

With HNSW indexes it handles millions of vectors comfortably on a well-sized instance. We benchmark on your data before deciding.

No, if you run a recent PostgreSQL. It is an extension installed into the database you already have.

Every stored vector has to be regenerated, because vectors from different models cannot be compared. We plan that as a background job with both versions available until the switch.

Yes. PostgreSQL’s full-text search runs alongside vector search, and the two result lists are merged — useful when exact codes or names matter.