liveBook · Manning

Similarity search

As explained in Vibe Engineering

Similarity search retrieves items whose vector representations are nearest to a query vector according to a similarity measure.

Similarity search compares a query vector with indexed code and documentation chunk vectors, then retrieves semantically relevant chunks to augment an agent’s prompt. section 3.5.1

For code retrieval, weigh the indexed approach against live search:

  • Vector-index retrieval can respond in milliseconds, but may return stale chunks cut at arbitrary boundaries. section 3.5.1
  • Agentic search reads live code and follows references, but costs more tokens. section 3.5.1
Figure 3.7 Context-aware assistance flow. The developer's query is converted into an embedding, matched against the indexed codebase, and the most relevant chunks are injected into the prompt before the model generates its response.

Shows how a query embedding retrieves indexed chunks that are added to the prompt before generation. section 3.5.1

How Vibe Engineering covers it

How deep it goes
Explains query and chunk embeddings, vector-database matching, and prompt augmentation, but names no similarity metric.
Examples
Uses a request to refactor a login service with a new JWT library as a retrieval example.
What you can do after
Evaluate indexed retrieval against agentic search using speed, freshness, and token cost trade-offs.
How it connects
Links embeddings and vector databases to retrieval-augmented generation and agentic search.

Also explained in

Compare how 37 books explain similarity search →

Related concepts

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