Embedding-based retrieval ranks indexed content by matching a query embedding against embedded chunks, then injects the closest results into an LLM prompt. Its appeal is fast, automatic selection; its central risk is that similarity does not reliably identify everything needed. section 3.5.1
Evaluate the technique against these operational trade-offs:
- Gain millisecond-scale retrieval, but accept stale content and chunk boundaries that may split relevant context. section 3.5.1
- Use it especially for external documentation, libraries, and organizational wikis, where indexed knowledge remains useful. section 3.5.1
- Compare it with agentic search when live repository state, reference-following, or broader reasoning matters more than latency. section 3.5.1
Repository assistance
A developer query is embedded, matched against an indexed codebase, and used to supply a function, usage examples, and error-handling patterns to the model. The result can still omit needed context when “closest” and “needed” diverge. 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 retrieval pipeline from query embedding through indexed matching to prompt injection and model generation. section 3.5.1



