Effective RAG for code often employs Hybrid Retrieval, combining keyword-based methods (like BM25) with semantic vector search for better precision and recall. Advanced techniques include Query Expansion (e.g., HyDE) to improve vague queries and Reranking to prioritize the most relevant retrieved documents before LLM generation.