liveBook · Manning

Vector database

As explained in Software Testing with Generative AI

A vector database is a database specialized for storing and retrieving numerical vector representations using similarity-based search.

A vector database stores multidimensional vector representations and retrieves data by similarity to a query. In retrieval-augmented generation (RAG), it keeps contextual data separate from the language model, making sources easier to select and update. section 11.3 section 11.4

In a RAG workflow, vector databases help to:

  • Find data relevant to a user query through similarity algorithms. section 11.4
  • Pull multiple relevant files into a single query and provide context that can improve response accuracy. section 11.4
  • Expose a control and privacy tradeoff when hosted platforms obscure storage choices or relevancy algorithms. section 10.2.3

RAG query

A RAG framework can query a vector database with a user question, retrieve several relevant files, and add them to the prompt. Retrieval errors can still supply inaccurate context and produce incorrect responses. section 11.4

How Software Testing with Generative AI covers it

How deep it goes
Defines similarity-based storage and retrieval, but defers database internals and algorithm details.
Examples
Uses querying a database to pull multiple relevant files into a prompt.
What it assumes
Assumes familiarity with RAG, prompts, user queries, and language models.
What you can do after
Operate vector databases in RAG frameworks to retrieve contextual files for prompts.
How it connects
Connects vector databases with retrieval-augmented generation, similarity algorithms, prompts, context windows, and language models.

Also explained in

Compare how 26 books explain vector database →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Testing with Generative AI. The section links point to the parts of the book it draws on.