liveBook · Manning

Similarity search

As explained in The Art of AI Product Development

Search is the process of locating information relevant to a query from one or more sources.

A team preparing a product presentation may need evidence scattered across a wiki, shared files, and email. Searching each repository separately slows the work, especially when nobody knows where the latest document lives. Similarity search helps locate information related to a query even when the document does not repeat the query’s exact words. It can power a search experience on its own or supply relevant documents to a retrieval-augmented generation (RAG) system. section 7.2.1 section 7.3

One approach is semantic search. An embedding model represents text as vectors that reflect meaning and context: words used in similar contexts tend to have similar representations. Documents are embedded and stored in an embedding database; a query can then be matched with semantically similar content. This offers a different route to relevance from keyword search, which depends on matching strings. It does not make keywords obsolete: combining semantic and lexical search, with metadata filters where useful, can make retrieval more precise. section 7.2 section 7.2.2 section 7.4

Figure 7.6 The process of semantic search
A diagram of a diagram

AI-generated content may be incorrect.

The semantic-search process connects an incoming query to relevant content stored as embeddings. section 7.2.2

Treat retrieval quality as a product decision, not just a model setting:

  • Start with real tasks. Ask users whether results answer their query or force them to dig through irrelevant documents; have evaluators assess relevance more systematically as the system matures. section 7.2.3
  • Choose chunks for the task. Shorter chunks can expose a specific statistic; longer ones can preserve the background needed for an open-ended report. Add document context when an isolated chunk would be ambiguous. section 7.2.4
  • Investigate domain-specific misses before changing everything. Possible adjustments include the embedding model, chunking, lexical search, and metadata filters; evaluation helps identify which change is warranted. section 7.2.3 section 7.4

Finding case-study evidence

Suppose a marketer searches for “API integration case studies.” Reviewing whether the returned documents meet that intent reveals more than whether the system returned results quickly. If useful evidence is missing, the team can inspect retrieval and adjust it before relying on those results to generate customer-facing content. section 7.2.3 section 7.2.1

In RAG, retrieved documents become context in the prompt so a language model can answer directly rather than leaving users to synthesize a results list. Poor retrieval can still undermine a polished answer. Search therefore needs its own relevance checks, alongside checks that generated answers are grounded in the retrieved context. section 7.3 section 7.4

How The Art of AI Product Development covers it

How deep it goes
Explains embedding-based retrieval and develops evaluation and optimization choices, without a mathematical derivation.
Examples
Uses cross-repository product-document searches, case-study relevance assessments, and ambiguous document chunks.
What it assumes
Introduces embeddings through contextual similarity while assuming familiarity with queries, documents, and workplace information needs.
What you can do after
Practice/perform relevance assessment and choose retrieval adjustments for a standalone search or RAG workflow.
How it connects
Connects semantic embeddings and embedding databases to keyword search, metadata filtering, and retrieval-augmented generation.

Also explained in

Compare how 22 books explain similarity search →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Art of AI Product Development. The section links point to the parts of the book it draws on.