liveBook · Manning

Vector database

As explained in Vibe Engineering

A vector database is a database specialized for storing vector embeddings and retrieving them by similarity.

A vector database stores embedding vectors for semantic retrieval. In AI coding assistance, it turns a repository into searchable context: files are chunked, embedded, indexed, and matched against an embedded user query. section 3.5.1

A typical context-retrieval pipeline follows these steps:

  • Index source files, documentation, and configuration as meaningful chunks such as functions, classes, and Markdown sections. section 3.5.1
  • Convert each chunk and the user request into numerical vectors, then run a similarity search. section 3.5.1
  • Inject the highest-ranked chunks into the prompt before response generation, while treating semantic closeness as an assumption to validate rather than proof of relevance. section 3.5.1

Repository refactoring request

For “refactor the login service to use the new JWT library,” retrieval may surface the target function, library-usage examples, and relevant error-handling patterns. Embedding retrieval is not automatically superior: Claude Code, Cline, Windsurf, and Sourcegraph Amp use agentic search, while Cursor uses indexed retrieval, increasingly in hybrid form. 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.

Trace the query embedding, similarity match, context injection, and generated response as one retrieval flow. section 3.5.1

How Vibe Engineering covers it

How deep it goes
Traces chunking, embedding, similarity search, and prompt augmentation, then flags relevance as an unresolved engineering question.
Examples
Uses repository chunks and a JWT login-service refactoring request to illustrate indexed retrieval.
What you can do after
Evaluate indexed retrieval against agentic search while checking whether retrieved context is actually needed.
How it connects
Connects embeddings, similarity search, retrieval-augmented generation, agentic search, and prompt augmentation.

Also explained in

Compare how 34 books explain vector database →

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.