AI Vector databasesRAGAI infrastructure

Vector databases explained: Pinecone, Weaviate, pgvector and more

Vector databases let AI search by meaning rather than exact words. Here is how they work and how to choose one.

UUIUX Studio Editorial Team 5 min read
AI
Vector databases explained: Pinecone, Weaviate, pgvector and more
How vector databases power semantic search for AI
Embeddings
Text becomes numbers
An embedding model turns each passage into a vector that captures its meaning.
Vectors Split textEmbedStoreIndex
The choice
Pick for your stack
Postgres users often start with pgvector; larger or managed needs suit dedicated databases.
BEFORE✕Guesswork
AFTER✓Fit to stack
THE SHORT ANSWER

A vector database stores embeddings, numerical representations of text, images or other data, and finds the items most similar in meaning to a query. It is the search engine behind most RAG systems and AI assistants that answer from your documents. Popular options include managed services such as Pinecone, open-source databases such as Weaviate and Qdrant, and pgvector, an extension that adds vector search to PostgreSQL. Many teams start with pgvector if they already use Postgres.

KEY TAKEAWAYS
  • ✓Vector databases search by meaning using embeddings
  • ✓They power retrieval in RAG systems
  • ✓pgvector adds vector search to an existing Postgres database
  • ✓Pinecone is managed; Weaviate and Qdrant are open source with cloud options
  • ✓Choose by scale, hosting needs, filtering and existing stack

What is a vector database?

Traditional search matches words. Ask for “cancel my subscription” and a keyword search may miss a passage titled “ending your annual plan”. Vector search matches meaning. An embedding model converts each piece of text into a vector, a long list of numbers, so that passages with similar meaning sit close together. A vector database stores those vectors and quickly finds the ones nearest to the vector of a query. That is the retrieval step in retrieval-augmented generation (RAG).

How vector search works
Index
Prepare content
  • Split into chunks
  • Create embeddings
  • Store with metadata
Query
Embed the question
  • Same embedding model
  • One query vector
Match
Find nearest vectors
  • Similarity search
  • Filter by metadata
  • Return top passages

What are the main options?

Option
Type
Strengths
Consider if
pgvector
PostgreSQL extension
Vectors beside your existing data, SQL filters
You already run Postgres
Pinecone
Managed cloud service
No servers to run, scales easily
You want a fully managed service
Weaviate
Open source, with cloud option
Hybrid search, modules, self-hostable
You want open source and flexibility
Qdrant
Open source, with cloud option
Fast filtering, efficient storage
You need strong filtering and self-hosting
Built into platforms
Search services in cloud or app platforms
Fewer moving parts
Your stack already offers it

Other databases, including MongoDB, Elasticsearch and Redis, also support vector search, so check what your team already uses before adding a new system.

How do you choose one?

Which option fits?
1234
SimplestMost specialised
1
pgvector on existing Postgres
Small to mid-sized projects
2
Managed vector service
Growing workloads, little ops capacity
3
Self-hosted open source
Data control and custom tuning
4
Large distributed cluster
Very high volume and low latency
  • Scale: how many chunks today, and in a year?
  • Hosting: managed service, your cloud or on-premise?
  • Filtering: do you need to filter by user, team, date or document type?
  • Hybrid search: do you need keyword and vector search together?
  • Cost: storage, queries and the team time to run it
  • Data rules: where must the data live?

Do you need a separate vector database?

pgvector vs a dedicated vector database
Apgvector in Postgres
  • One database for app data and vectors
  • Familiar SQL and backups
  • Good for most small and mid-sized projects
  • Fewer systems to secure
BDedicated vector database
  • ✓Built for very large vector collections
  • ✓Advanced indexing and scaling features
  • ✓Managed options reduce operations work
  • ✓Another system to integrate and pay for

What does a real setup look like?

A SaaS company wants its support assistant to answer from 2,000 help articles and product docs. It already runs PostgreSQL, so it adds the pgvector extension and a table holding each chunk’s text, embedding, article title, product area and last-updated date. A nightly job re-embeds changed articles. When a customer asks a question, the app embeds it, runs a similarity search filtered to the customer’s product, and passes the top five chunks to the language model. The whole setup lives in the existing database, uses existing backups and needs no new vendor. If volumes grow to tens of millions of chunks or latency becomes a problem, the team can move the vectors to a dedicated database later.

Mashreq NEO case study
Case study · Mashreq NEO Executive dashboards and an AI assistant One view of bank performance for leadership, plus an AI assistant that answers questions from internal documents.
1View of bank performance
Power BIReporting
AzureAI platform
View case study →

What does it cost?

Costs come from three places: creating embeddings, storing vectors and running queries. Embedding is usually cheap per document but adds up when you re-index often. Managed services charge for storage and usage; self-hosted options cost server time and maintenance. For most business knowledge bases, the vector store is a small part of the total cost compared with language-model calls, which our guide to cutting LLM API costs covers.

What about security and permissions?

  • Store permission metadata with each chunk and filter every query by the user’s access
  • Keep vectors of sensitive documents in the same region and controls as the originals
  • Remember that embeddings can leak information, so protect them like the source text
  • Delete vectors when the source document is deleted

What matters more than the database?

  • The quality and freshness of the content you index
  • How you split documents into chunks
  • The embedding model you choose, and using the same one for queries
  • Adding metadata such as title, date and permissions
  • Testing retrieval with real questions before launch

Retrieval quality is covered in our RAG guide.

Start simple, measure retrieval quality on real questions and only add a specialised system when your scale or requirements clearly call for it.

Document which embedding model and chunk settings you used, because changing either later means re-indexing everything.

Plan regular re-indexing so search results stay in step with your latest documents.

Test a few embedding models on your own questions before committing; retrieval quality varies by language and domain.

How UIUX Studio helps

We design retrieval systems for AI assistants, from choosing a vector store to chunking, permissions and evaluation. Talk to our product engineering team.

Frequently asked questions

A database that stores embeddings and finds items similar in meaning to a query.

An open-source PostgreSQL extension that adds vector storage and similarity search.

Not generally; Pinecone is managed and scales easily, pgvector is simpler if you already use Postgres.

Usually, though small projects can use simpler search.

A list of numbers that represents the meaning of text or other data.

U
Written by UIUX Studio Editorial Team
Design & engineering leads, Dubai · India · Australia

For Ambitious Founders

Startup Strategy Session Discuss Your Project with Our Senior Experts

  • No Obligation
  • Expert Insights
  • Tailored Guidance