A vector database is a database that stores text, images or other data as vectors, which are lists of numbers that capture meaning, and finds the stored items whose meaning is closest to a question. It lets a model find a passage by what it means, even when the passage uses different words from the question. It is the usual memory behind retrieval-augmented generation (RAG).
The numbers come from an embedding model. This is a model trained to turn a piece of text into a list of numbers of fixed length, for example 768 numbers. Texts with similar meanings get similar lists. 'Subsidy for drip irrigation' and 'financial help for micro-irrigation' end up close together, even though they share almost no words. The page on vector embeddings explains how a model learns to do this.
Finding the closest vectors is the hard part. Comparing a question with every one of a crore stored vectors would be too slow. So a vector database builds an index, a structure that lets it check only a small share of the vectors. A common kind of index links each vector to its nearest neighbours, like a map of roads between nearby towns. The search starts at one point and keeps moving to whichever neighbour is closer to the question, until no neighbour is closer. This is called approximate nearest-neighbour search. It may occasionally miss the very closest item, but it answers in milliseconds.
Consider the farmers' helpline of a state agriculture department in Bhubaneswar. It stores 40,000 passages from scheme circulars, each as 768 numbers. A farmer asks, in Odia, about money for drip irrigation. The question is turned into 768 numbers too. The database checks about 2,000 of the 40,000 stored vectors, not all of them, and returns the 5 closest passages in 20 milliseconds. The best match is a passage from a circular on the 'micro-irrigation subsidy', which never uses the word 'drip'. A search by keywords would have missed it.
How is this different from keyword search, as in enterprise search? Keyword search finds documents that contain the same words as the question. A vector database finds documents with the same meaning. Many systems now use both and combine the results. Vectors can also be stored inside a general database, such as a multi-model database, instead of a separate one. Matching a CV with a job by meaning, in semantic job matching, uses the same idea.