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




































