<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/retrieval-is-filtering-not-search-a-mental-model-for-enterprise-rag-e6lf8uc9j" -->

---
title: Retrieval Is Filtering, Not Search: A Mental Model for...
description: A mental model for enterprise RAG that reframes retrieval as a filtering problem on two structured DataFrames — line_df (document text) and toc_df (table of...
canonical: https://daily.dev/posts/retrieval-is-filtering-not-search-a-mental-model-for-enterprise-rag-e6lf8uc9j
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Retrieval Is Filtering, Not Search: A Mental Model for Enterprise RAG | daily.dev
og:description: A mental model for enterprise RAG that reframes retrieval as a filtering problem on two structured DataFrames — line_df (document text) and toc_df (table of...
og:url: https://daily.dev/posts/retrieval-is-filtering-not-search-a-mental-model-for-enterprise-rag-e6lf8uc9j
og:image: https://api.daily.dev/og/posts/e6lF8uc9j.png
og:image:alt: Retrieval Is Filtering, Not Search: A Mental Model for Enterprise RAG
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieval Is Filtering, Not Search: A Mental Model for Enterprise RAG

**[Towards Data Science](https://daily.dev/sources/tds)** · 21 min read · 0 upvotes · 0 comments

## Summary

A mental model for enterprise RAG that reframes retrieval as a filtering problem on two structured DataFrames — line_df (document text) and toc_df (table of contents) — rather than a vector similarity search. The core insight is separating anchor scope (small, precise: where the signal is detected) from context scope (large, sufficient: what gets passed to the LLM for generation). The article walks through four question types that require different retrieval strategies, explains why cosine top-k fails on most of them, and introduces three context expansion strategies: paragraph, section, and window expansion. It also covers the anchor/context distinction, how the two DataFrames collaborate via section_id joins, and when to use LLM calls versus deterministic rules for section boundary detection.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://towardsdatascience.com/retrieval-is-filtering-not-search-a-mental-model-for-enterprise-rag>

## Similar posts on daily.dev

- [The Untaught Lessons of RAG Retrieval: Cosine Is Not the Foundation](https://daily.dev/posts/the-untaught-lessons-of-rag-retrieval-cosine-is-not-the-foundation-35j1wvjrr) · Towards Data Science · 1 upvotes · 0 comments
- [Anchor Detection for RAG: Parallel Detectors, Then One LLM Call at the End](https://daily.dev/posts/anchor-detection-for-rag-parallel-detectors-then-one-llm-call-at-the-end-clc4nmg97) · Towards Data Science · 1 upvotes · 0 comments
- [RAG vs. long-context LLMs: A side-by-side comparison](https://daily.dev/posts/rag-vs-long-context-llms-a-side-by-side-comparison-96pemf4d7) · Meilisearch · 1 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#rag](https://daily.dev/tags/rag), [#pandas](https://daily.dev/tags/pandas)

[View this post on daily.dev](https://daily.dev/posts/retrieval-is-filtering-not-search-a-mental-model-for-enterprise-rag-e6lf8uc9j)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Retrieval Is Filtering, Not Search: A Mental Model for Enterprise RAG","url":"https://daily.dev/posts/retrieval-is-filtering-not-search-a-mental-model-for-enterprise-rag-e6lf8uc9j","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/retrieval-is-filtering-not-search-a-mental-model-for-enterprise-rag-e6lf8uc9j"},"datePublished":"2026-06-23T15:34:38.500Z","dateModified":"2026-06-23T15:40:46.227Z","description":"A mental model for enterprise RAG that reframes retrieval as a filtering problem on two structured DataFrames — line_df (document text) and toc_df (table of...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/4517762dd9c2b13774136bd2677b6d05?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/4517762dd9c2b13774136bd2677b6d05?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Towards Data Science","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Towards Data Science","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/tds","url":"https://daily.dev/sources/tds"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/retrieval-is-filtering-not-search-a-mental-model-for-enterprise-rag-e6lf8uc9j","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,rag,pandas","timeRequired":"PT21M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Towards Data Science","item":"https://daily.dev/sources/tds"},{"@type":"ListItem","position":3,"name":"Retrieval Is Filtering, Not Search: A Mental Model for Enterprise RAG"}]}
```

