A vector database is a store that keeps lists of numbers called vectors, each one standing for the meaning of a piece of text, a picture or a product, and finds the stored vectors closest to a new one in a fraction of a second. It is the memory behind most AI search tools. When an assistant pulls a passage from a company’s documents before it answers, a vector database usually did the finding.
What is a vector database? #
An AI model turns a passage into embeddings: a long row of numbers that places the passage in a “meaning space”. Passages about the same idea land near each other. A vector database saves those rows, together with the original text and a few labels, and answers one main question very fast: which stored rows are nearest to this new row? The method of asking that question is vector search. The database is the thing that holds the data, keeps an index of it and serves the answers.
The rows are long. OpenAI’s embeddings guide gives a default length of 1,536 numbers for text-embedding-3-small and 3,072 for text-embedding-3-large, and says you can save the result in a vector database.
Is it a new kind of software or a feature? #
Both exist. Some products are built only for vectors. Others add vectors to a database you may already run. pgvector is an open-source extension that adds vector similarity search to Postgres, so the vectors sit next to normal rows and you query them with SQL. Faiss is a library, not a full database: its own site calls it a library for similarity search and clustering of dense vectors, developed mainly at Meta’s FAIR research team. Google sells a managed service, Vertex AI Vector Search, built on its ScaNN algorithm.
How does it work? #
- Split. Long pages are cut into short passages. This is content chunking.
- Embed. Each passage goes through an embedding model and comes back as a vector.
- Store. The vector is saved with its text, the page address and labels such as language, date or product type.
- Index. The database builds a structure that lets it skip most rows when it searches.
- Query. A question is embedded with the same model. The database returns the nearest passages, measured by a distance such as cosine similarity.
pgvector shows the choices plainly. It offers three main distance operators: <-> for straight-line (L2) distance, <#> for inner product and <=> for cosine distance.
Exact or approximate: what is the trade? #
Checking every stored row is exact but slow once you hold millions. So most systems use an approximate index. The pgvector README says exact search gives “perfect recall”, while an approximate index trades some recall for speed. Recall is the share of the true nearest neighbours you get back. Google’s Vector Search overview gives the example that returning 19 of the 20 true neighbours is 95% recall.
The most common approximate index is HNSW (Hierarchical Navigable Small World graphs), described by Malkov and Yashunin in a 2016 paper. It builds layers of linked points: a search starts on a sparse top layer and drops down to denser layers, a bit like zooming in on a map. pgvector also offers IVFFlat, which splits vectors into lists. Its README says HNSW has the better speed and recall balance but builds more slowly and uses more memory.
| Choice | What you gain | What you give up |
|---|---|---|
| Exact search | Every true nearest match | Speed on large sets |
| HNSW index | Fast queries with high recall | Memory and build time |
| IVFFlat index | Faster builds, less memory | Lower recall at the same speed |
Why does it matter for search? #
Classic search matched words. A score such as TF-IDF rewards a page that uses the query’s terms. A vector database matches meaning, so “kettle that switches itself off” can find a page that only says “automatic shut-off”. This is the engine room of semantic search, and it is one reason semantic SEO asks you to cover a topic clearly rather than repeat one phrase. Many systems now mix both: Google’s overview describes hybrid search that joins dense embeddings for meaning with sparse ones for exact keywords. Your internal site search may already work this way.
Why does it matter for AI answers? #
A large language model only knows what was in its training data up to its knowledge cutoff. Retrieval-augmented generation fixes that by fetching fresh passages first and placing them in the context window. Google lists this use directly: Vector Search retrieves passages to ground model answers in facts. That grounding step lowers the risk of an AI hallucination. For a business, the lesson is simple: the passage that gets fetched is the passage that gets quoted. So AEO work starts with passages a store can fetch cleanly.
Common mistakes #
- Mixing models. A question embedded with one model cannot be compared with passages embedded by another. Re-embed everything when you change model.
- Chunks too big or too small. One chunk holding five topics matches nothing well. A chunk of one line loses its context.
- Forgetting filters. pgvector notes that with an approximate index, filtering happens after the index scan, so a query with a WHERE rule can return fewer rows than you asked for.
- Stale rows. If a price changes on the page but not in the store, the assistant quotes the old price. Plan for content freshness.
- Near copies. Duplicate content fills the top results with the same passage and pushes useful ones out.
A worked example #
One small online shop has 400 product pages and a delivery page. It wants a chat helper that answers “Do you deliver to Northern Ireland?”
- Each page is cut into passages of a few short paragraphs, keeping the heading with each passage.
- Every passage is embedded and saved with its page address and a label: product, delivery or returns.
- The question is embedded. The store returns the 5 nearest passages, filtered to the delivery label.
- The model writes its answer from those 5 passages and links the delivery page.
If the delivery page had buried the answer under a long story, the nearest passage might be a product blurb that mentions “delivery” in passing. A clear heading and an answer-first paragraph make the right passage win.
How to check it #
You cannot see inside another company’s vector database, but you can make your pages easy to chunk and match:
- Preview how a page splits with our RAG chunk previewer.
- Check that each section has a clear heading with our heading checker, and plain sentences with the readability checker.
- See whether AI tools can read a clean copy with the markdown version checker and the llms.txt checker.
- Run the wider AI readiness checker. Each day you can run 2 of these for free.
- In URSY Pro, What AI reads (Pro) shows which pages AI crawlers fetch.
Questions #
Is a vector database the same as vector search? #
No. Vector search is the method of finding nearest vectors. A vector database is the system that stores them, indexes them and runs that search.
Do I need one for my website? #
Not to rank. You need one only if you build your own AI helper or smart search. The AI companies run their own.
Can it store pictures? #
Yes, if a model turns the pictures into vectors. That is how multimodal search can match a photo to a product.
Where can I learn the basics of AI search? #
Start with our beginner’s guide to AEO and the page on information retrieval.
Related words #
Sources #
- pgvector README (GitHub), checked 25 November 2026
- Faiss documentation (Meta FAIR), checked 25 November 2026
- Malkov and Yashunin, HNSW paper (arXiv, 2016), checked 25 November 2026
- Google Cloud: Vertex AI Vector Search overview, checked 25 November 2026
- OpenAI: Embeddings guide, checked 25 November 2026
Updated 25 November 2026 by URSY.
Cite this page: Vector database. URSY. Updated 25 November 2026. https://ursy.com/wiki/vector-database/ · Section links
Tools for this
- LiveAI Readiness Checkeris your site ready for ChatGPT, Gemini, Claude? Score + fixesRun the check →
- LiveAI Bot Checkerwhich AI bots your robots.txt lets inRun the check →
- LiveRobots.txt Checker + Generatortest any address against your rules, or write new onesRun the check →
- LiveSchema Markup CheckerRun the check →