Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Node.js Retrieval Architecture: Metadata Pre- vs Post-Filters (Choose Pre-Filtering at 10M)

TL;DR Choose metadata pre-filtering for a multi-tenant customer-support knowledge base once the corpus approaches 10 million chunks, because tenant, entitlement, locale, product, and validity constraints should reduce both the candidate set and the amount of duplicated index state before semantic ranking begins. Post-filtering is defensible for a small, low-cardinality corpus whose filters change…

Metadata pre-filtering is recommended for a large, multi-tenant customer-support knowledge base once the corpus reaches 10 million chunks. Tenant, entitlement, locale, product, and validity constraints should reduce the candidate set and duplicated index state before semantic ranking begins. Post-filtering is only suitable for small, low-cardinality corpora with frequently changing filters, as it is not a safe default for access control and becomes expensive when the eligible slice is thin.

The primary cost of metadata filtering in a customer-support knowledge base depends on the unit model: N chunks multiplied by bytes for vector data, metadata, retained text or pointers, replication factor, and engine overhead. An uncertain overhead factor can be measured on a representative shard. At 10 million chunks, even small per-record fields should be scrutinized.

The decision to use pre-filtering or post-filtering depends on the eligible slice size, variability by tenant, and frequency of constraint changes. Pre-filtering is preferred when the eligible slice is small or highly variable by tenant, and when constraints are primarily entitlement, tenancy, and validity. Post-filtering is acceptable when most documents qualify and constraints change more often than embeddings.

A hybrid approach, using pre-filtering for stable constraints and post-filtering for volatile preferences, is also viable. Regardless of the chosen approach, it is crucial to record ingestion details in a ledger to ensure auditability and manage updates efficiently when entitlement mappings change.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Why your translated video gets no views (it is not the translation)

You translated the video. You published it. It got 40 views, all from your existing subscribers, none from the market you translated for. I have watched this failure enough times to see the pattern.

  • Publishing translated video on same channel as original limits visibility to English speakers
  • Localize metadata (title, description, tags) to make video searchable in target language

Streaming 1 GiB CSV Diffs in a Web Worker Without Corrupting Leading Zeros

Reconciling two large CSV exports in the browser usually fails in one of three ways: Calling await file.text() on two 400 MB files blows past the tab heap limit before parsing even starts.

  • Web Worker architecture streams 1 GiB CSV diffs locally without exceeding tab heap limits
  • Preserve leading zeros and raw strings to accurately compare invoice IDs and other composite keys

More from Monday 23 November →