Lee Siang Fong

Blog › AI

Vector Databases Explained: Embeddings in Plain English

Vector databases explained simply: what vectorised data and embeddings are, how similarity search works, when you need a vector database and how to choose one.

A vector database stores data as lists of numbers, called vectors or embeddings, that capture what the data means. It lets you search by meaning instead of exact words, so a search for "refund policy" can find a document titled "returns and money back".

That is why vector databases sit behind many AI chatbots that answer questions about company documents. This guide explains the idea without the maths.

What is vectorised data?

To "vectorise" data means to turn it into a vector: a fixed-length list of numbers.

An AI model called an embedding model does this. You give it a sentence, a paragraph or even an image. It gives back a list of numbers. OpenAI's text-embedding-3-small model, for example, returns 1,536 numbers by default, and the larger model returns 3,072.

Each number on its own means little. Together, they place the text at a point in a "meaning space". Texts with similar meaning land close together.

A simple picture

Imagine a map of Penang. Places that are close on the map are close in real life.

Embeddings work the same way, just with hundreds or thousands of directions instead of two. "Kopi O" and "black coffee" sit close together. "Kopi O" and "car insurance" sit far apart.

Where the idea came from

The idea became famous with Google's Word2Vec research in 2013. It showed that word vectors could capture relationships, such as the well-known example where "king" minus "man" plus "woman" lands near "queen". Modern embedding models are far more capable, but the core idea is the same.

How a vector database works

A vector database does three main jobs.

  1. Store each vector, plus a link back to the original item (a document, product or image) and extra details like date or category.
  2. Search for the vectors closest to a query vector. Closeness is measured with a distance formula, often "cosine distance", which compares the direction of two vectors.
  3. Filter results, for example "only documents from 2026" or "only products in stock".

Comparing a query against every stored vector gives perfect results but gets slow with millions of items.

So most systems use an index for approximate search. The pgvector documentation explains this trade-off clearly: by default it does exact search with perfect recall, and adding an index such as HNSW (a layered graph that jumps quickly towards close neighbours) trades a little accuracy for much more speed.

For most business uses, approximate search is fine.

What vector databases are used for

OpenAI lists the main uses of embeddings as search, clustering, recommendations, anomaly detection and classification. In practice that looks like:

  • Company knowledge chatbots. A staff question is turned into a vector, the closest policy paragraphs are found and the AI answers using them. This pattern is called RAG (retrieval-augmented generation). See RAG vs AI agents vs agentic RAG.
  • Smarter site search. A Shopee-style seller can let customers search "baju for wedding" and find "formal kurung" even if the words differ.
  • Recommendations. Suggest products similar to what a customer just viewed.
  • Spotting duplicates and odd items. Find near-duplicate support tickets, or transactions that look unlike the rest.
  • Image search. Multimodal models can put pictures and text in the same space. See multimodal AI explained.

Do you need a separate vector database?

Not always. You have three broad choices.

Option Good fit Trade-off
Add vectors to your existing database (for example Postgres with pgvector) Small to medium data, teams already using that database One less system, but you tune it yourself
Dedicated vector database Very large collections, heavy search traffic Another system to run, secure and pay for
Vector search built into a search engine or cloud AI service Teams wanting a managed option Less control, possible lock-in

My advice for most small and mid-sized companies: start with what you already run. pgvector adds vector search to Postgres, so your vectors sit next to your normal data. Move to a dedicated system only when you hit real limits.

Things to watch

  • Embeddings are still your data. A vector made from customer records can still reveal information about them. Treat the vector store with the same access controls and PDPA care as the source data.
  • Changing models means re-embedding. Vectors from one embedding model don't mix with another. If you switch models, you re-process everything.
  • Chunking matters. Long documents are split into pieces before embedding. Pieces that are too big or too small give poor search results.
  • Test with real questions. Collect 30 to 50 genuine questions from staff and check whether the right passages come back.

For the wider picture of compute and storage choices, read AI infrastructure basics.

Conclusion

A vector database stores the meaning of your data as numbers, so you can search by meaning, not just keywords. It is a key part of AI search and company chatbots. Start simple, often inside a database you already use, and test with real questions before you scale.

Quick answers

What is a vector database in simple terms?

It is a database that stores data as number lists representing meaning, so it can find items that are similar in meaning to your query.

What is the difference between a vector and an embedding?

In everyday AI talk they mean nearly the same thing. An embedding is a vector produced by an AI model to represent the meaning of some data.

Can I use PostgreSQL as a vector database?

Yes. The open-source pgvector extension adds vector storage and similarity search to Postgres, including HNSW and IVFFlat indexes.

Do vector databases replace normal databases?

No. They complement them. You still need normal databases for transactions, records and reports.

Sources

Read next