Hybrid search combines retrieval methods so each covers the others’ weaknesses. Keyword search finds exact names, codes, syntax, or special characters; vector search finds semantic matches despite different wording. section 5.2.2 section 5.2.4
A practical ranking pipeline normalizes scores from keyword and vector results, calculates a weighted average, and ranks the combined results. Exact queries such as get_user_by_id and semantic questions such as how to get user information can then share one retrieval path. section 5.2.4
Choose retrieval methods according to the information the query requires:
- Use keyword search for exact words, function names, error codes, or code syntax. section 5.2.4
- Use vector search for natural-language questions and semantic similarity, including related terms such as sofa and couch. section 5.2.2 section 5.2.4
- Add graph search for relationship traversal and structure-based search when folders, files, or archive layouts carry useful information. section 5.2.4
Table 5.1 Recommended search methods by situation
| Situation |
Recommended method |
Reason |
|---|---|---|
| Exact word/code search |
Keyword search |
Exact matching needed for |
| Natural language questions |
Vector search |
Semantic search needed for queries like “how to store data” |
| Relationship-based questions |
Graph search |
Relationship traversal needed for “code that calls this function” |
| Folder/file structure exploration |
Structure-based search |
When structure itself is information, like zip files or codebases |
| Production environments |
Hybrid search |
Combines the advantages of multiple methods |
Compare retrieval methods by query situation, matching requirement, and production use. section 5.2.4







