---
title: "Discussion on \"RAG Search Algorithms - How Retrieval Actually Works Under the Hood\" | Hashnode"
description: "Discussion on \"RAG Search Algorithms - How Retrieval Actually Works Under the Hood\". Every agentic AI system that \"looks things up\" before answering — a support bot searching a knowledge base, a coding agent searching a codebase, a research assistant searching PDFs — is running a Retr"
url: "https://hashnode.com/posts/rag-search-algorithms-how-retrieval-actually-works-under-the-hood/6a5dea666ff4fffb2f99fde2"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [RAG Search Algorithms - How Retrieval Actually Works Under the Hood](https://gauravbytes.dev/rag-search-algorithms-how-retrieval-actually-works-under-the-hood?utm_source=hashnode&utm_medium=feed)

Every agentic AI system that "looks things up" before answering — a support bot searching a knowledge base, a coding agent searching a codebase, a research assistant searching PDFs — is running a Retr

Jul 20 · 13 min read · gauravbytes.dev  
Read the article

-   [#ai](https://hashnode.com/tag/ai)
-   [#rag](https://hashnode.com/tag/rag)
-   [#algorithms](https://hashnode.com/tag/algorithms)
-   [#agentic-ai](https://hashnode.com/tag/agentic-ai)

## Written by

[Gaurav Kumar](https://hashnode.com/@gauravbytes)

@gauravbytes · New Delhi

  
[View profile](https://hashnode.com/@gauravbytes)

Backend Engineer & AI Builder

Backend engineer building ShiftMailer, an AI-powered email tool. Sharing lessons from shipping AI agents and scalable systems. Follow for real-world AI, product, and engineering insights—no fluff.

## Responses 1

Markdown supported · ⌘↵ to post

[Kartik N V J K](https://hashnode.com/@kartik-nvj)

[Jul 20](https://hashnode.com/posts/rag-search-algorithms-how-retrieval-actually-works-under-the-hood/6a5dea666ff4fffb2f99fde2/comment/6a5e4be78695ef4f83c7846a)

The BM25-vs-dense split for exact identifiers like error codes and SKUs is the detail most retrieval tutorials skip, and it is exactly where pure vector search quietly fails. One thing I would add on the HNSW section: the recall you get in practice is very sensitive to efSearch and M, so the same index can look great in eval and miss neighbors in production if those are left at defaults. Did you find IVF worth keeping around once HNSW was in place, or did it only matter for the on-disk memory case?
