Keyword search relies on exact word matching, while semantic search uses vector embeddings to understand meaning and context. RAG relies on semantic similarity because it allows the system to retrieve conceptually relevant information even when the query and document don't share exact keywords, leading to more accurate and contextually appropriate answers.
Keyword search (also known as lexical search) is a traditional technique that looks for exact word matches between the user's query and indexed documents[reference:7]. It is precise for specific terms but fails when users express intent in natural, varied language. Semantic search, on the other hand, converts both documents and user queries into vector embeddings and finds relevant chunks based on similarity in embedding space[reference:8]. This allows it to understand context and meaning, surfacing conceptually related information even if the exact keywords are missing[reference:9]. For example, a query for 'lightweight running shoes' might surface 'breathable trail runners'[reference:10]. RAG relies on semantic search because it enables the retrieval system to find the most contextually appropriate information to ground the LLM's response, which is essential for answering complex, open-ended questions[reference:11].