liveBook · Manning

Vector database

As explained in Natural Language Processing in Action, Second Edition

A vector store is a software component that stores and retrieves numerical vectors, typically with similarity-search indexes.

A vector database stores numerical embedding vectors and indexes them for fast similarity search. It lets a query find documents by meaning rather than requiring exact word matches. section 10.3.3 section 10.3.7

A semantic-search pipeline embeds documents and queries into the same vector space, compares their similarity, and ranks the closest results. Splitting documents into paragraphs or sentences improves retrieval but greatly increases the number of vectors, making brute-force comparison impractical. section 10.3.3

A production vector-search system typically combines:

  • An embedding model that converts text into meaningful numerical representations. section 10.3.3
  • An approximate-nearest-neighbor index that retrieves ranked matches without comparing every stored vector. section 10.3.4
  • A generation or question-answering model that uses the retrieved documents as context. section 10.3.7

Choosing an implementation

Open-source options include Milvus, Weaviate, and Qdrant. PostgreSQL can add vector search through pgvector, while Elasticsearch, OpenSearch, FerretDB, and Valkey can also store vectors. Hosted services such as Pinecone, Milvus, or OpenSearch manage scaling for larger applications; a local implementation such as Knowt emphasizes private-data handling. section 10.3.4 section 10.3.7

>>> rag_pipe = Pipeline()
>>> rag_pipe.add_node(component=retriever, name="Retriever", inputs=["Query"])
>>> rag_pipe.add_node(component=prompt_node, name="prompt_node", inputs=["Retriever"])

The pipeline listing shows how a retriever connects a vector-search component to a prompt node, making the database’s role in retrieval-augmented generation concrete. section 10.3.11

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains embeddings, similarity ranking, ANN indexing, storage, updates, and deployment choices without detailing every indexing algorithm.
Examples
Names Milvus, Weaviate, Qdrant, pgvector, OpenSearch, Pinecone, Haystack, and Knowt as implementation or pipeline examples.
What it assumes
Assumes familiarity with embeddings and similarity search while explaining the need for indexes, document chunking, and scalable storage.
What you can do after
Build semantic-search and RAG pipelines by selecting embeddings, ANN indexes, vector stores, and retrieval frameworks.
How it connects
Connects vector databases to embeddings, semantic search, approximate nearest neighbor search, retrieval-augmented generation, and question answering.

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 Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.