Glossary

Cortexa AI Glossary · Asking well

What is a vector database?

From Cortexa Learn, by Cortexa Consulting. Last checked .

You typed "send this back" and found "Returns and refunds." The filing cabinet behind that search.


"Send this back"

On a store's help page, you type "how do I send this back," and the top result is an article called "Returns and refunds." None of your words are in that title. The search found it anyway, because it was searching by meaning. An older keyword search would have looked for the words "send" and "back," and might have come up empty. Behind a search box like that, there is often a particular kind of filing cabinet. It's called a vector database.

Cutting up the documents

The work starts before you ever type. The store's help articles are split into short passages, a few sentences or a paragraph each, because a short passage is easier to match than a whole manual. Each passage is then turned into an embedding: a long list of numbers that describes its meaning, so passages about similar things get similar numbers. Topic 71 explains how those numbers are made.23

The cabinet

A vector database is built to store those lists of numbers, which are also called vectors, and to search them by closeness. Put formally, it stores, manages, and indexes vectors, so they can be compared by how similar they are. An ordinary database is good at exact questions, like every order placed on Tuesday. A vector database answers a fuzzier one: which passages are closest in meaning to this? When you search, your question is turned into numbers with the same model, and the database looks for its nearest neighbors.13

Fast enough to feel instant

A large help center can hold a huge number of passages, and comparing your question with every one of them would be slow. So most vector databases use a shortcut called approximate nearest neighbor search. They organize the vectors ahead of time, a little like shelving books by subject, so a search only has to look in the most promising places. The trade is small. The results are very likely to be the closest matches, though that isn't guaranteed, and in return the search can be far faster.1

The cabinet behind the lookup

Vector databases are a common part of retrieval-augmented generation (RAG), the method where a chatbot looks things up before it answers. The order is retrieve, then write. Your question goes into the vector database, the closest passages come back, and they're handed to the artificial intelligence (AI) model along with your question, so its answer can lean on them. That's how a help chatbot can answer from a store's own policies, which it was never trained on. Topic 23 walks through the whole process.13

Only as good as what was filed

The database finds what is closest in meaning, and closest can still be wrong. If the returns policy changed last month and nobody updated the files, the nearest passage is out of date, and an answer built on it will be too. A passage about a different product can sound close enough to match. So when a help tool answers you, look for the source it shows, and check the date on it.

Works cited

  1. IBM, "What is a vector database?" (checked )
  2. IBM, "What is vector embedding?" (checked )
  3. IBM, "Chunking strategies for RAG tutorial using Granite." (checked )