The two questions similarity cannot answer
Recall retrieves by meaning (b4). But real questions carry constraints that meaning ignores. "Which SEV1s happened in March?" is not asking what a chunk is about - it is asking for chunks whose severity field equals SEV1 and whose date falls in a range. And "what did INC-401 say?" needs an exact token match, not a fuzzy neighbour. Both break pure semantic search. The fixes are metadata filters and hybrid retrieval, and together they turn Recall from a topic finder into a query engine.
where filter that narrows Corpus B by severity and date, hands-on time combining a semantic query with a metadata filter in the live playground, and a clear mental model of hybrid dense+sparse search and the alpha lever that balances them.
Filtering by metadata and time 9 min live
Every chunk in Corpus B carries structured metadata alongside its text: a severity (SEV1/SEV2/SEV3), a date (like 2026-03-14), a ticket id (INC-401). A metadata filter says "only consider chunks whose fields satisfy these conditions", and you apply it before or alongside the similarity search. The vector store still ranks by meaning - but only over the chunks that passed the filter.
LiveWhy "which SEV1s happened in March?" breaks pure semantic search3 min▶
Embed that question and cosine it against the incidents. The words "SEV1" and "March" barely move the vector - the model latches onto "happened" and "incident" and cheerfully returns SEV3 tickets from May that sound similar. Meaning search has no concept of "severity equals SEV1" or "date within March"; those are facts, not topics.
- Severity is a category, not a meaning. SEV1 and SEV3 tickets can read almost identically ("the service failed for N minutes"). Only the metadata distinguishes them.
- Time is a range, not a topic. "In March", "last quarter", "before the outage" are date comparisons. No embedding captures them reliably.
- The fix is structured. Attach the fields at index time, then filter on them at query time. Meaning search handles "what kind of incident"; the filter handles "which ones count".
Self-studyChroma where-filters, including a date range3 min▶
Chroma takes a where dictionary on query(). Equality is the common case; the comparison operators let you express ranges - and $and combines conditions:
The full operator set is $eq $ne $gt $gte $lt $lte for comparisons, $in $nin for membership, $and $or for logic, and $contains $not_contains for the document text itself. Store dates as sortable strings (ISO YYYY-MM-DD) or numbers so $gte/$lte compare the way you expect.
Live★ Build-along: semantic query, then narrow with a filter6 min▶
Here is Recall over Corpus B - eight Jira incidents, each showing its date and severity chips. The metadata filter starts preset to severity=SEV1. Run a semantic query first with the filter cleared, then add it back and watch the result set narrow to just the SEV1s.
where clause. But the two-part shape you are practising - similarity to rank, metadata to constrain - is exactly the production mechanic. Cosine ranking is real; the embedder is a toy.
Try "payment outage" with the filter empty, then with severity=SEV1: the SEV2/SEV3 tickets vanish from the results even when they scored well on meaning. That is the point - the filter overrides similarity for facts that similarity cannot see.
Hybrid retrieval: dense meaning plus sparse keywords 7 min live
Dense (embedding) search finds meaning but blurs exact tokens - it may rank INC-401 and INC-440 as near-equal because they read alike, and it can miss an error code entirely. Sparse search (keyword / BM25) is the opposite: it nails exact strings like "INC-401" or "503" but is blind to paraphrase. Hybrid runs both and fuses their scores, so you get meaning and precision at once.
LiveWhy hybrid, and what the alpha lever does3 min▶
The two retrievers fail in opposite directions, which is exactly why fusing them wins:
- Dense misses exact tokens. Ask for "INC-401" and an embedding may rank several similar-sounding tickets ahead of the one you named, because the id is just a few characters in a sea of meaning. Error codes, SKUs, ticket ids, function names - all weak spots for pure dense.
- Sparse misses meaning. BM25 scores by keyword overlap, so "money back" never matches a passage titled "Refunds" - the classic failure from b1. It cannot see paraphrase.
- Alpha fuses them. Hybrid combines the two scores with a convex weight
alphain [0, 1]:score = alpha · dense + (1 - alpha) · sparse. alpha=1.0 is pure dense, alpha=0.0 is pure sparse, alpha=0.5 weighs them evenly. You tune alpha toward sparse when exact tokens matter (incident ids, codes) and toward dense when questions are conversational.
The ticket id that vanished. A support team (anonymized) let engineers search runbooks by pasting an incident id. Pure semantic search kept surfacing thematically similar incidents and burying the exact one - "INC-401" ranked fourth behind three lookalikes. Turning on hybrid and nudging alpha toward sparse put the exact ticket back at the top without losing the paraphrase queries. One dial, both behaviours.
Self-studyTurning on hybrid in practice2 min▶
Hybrid is a first-class feature in most managed vector databases. In Pinecone you send both a dense vector and a sparse vector and set an alpha weight; the pattern generalizes across stores:
The exact API differs by store, but the idea is universal: supply a dense score and a sparse score, and hand the engine a single alpha that says how much to trust each. Sweep alpha on your own eval set - there is no globally correct value.
Find a query only a filter can answer ★ 10 min · the Corpus B playground
The sharpest way to feel why metadata matters is to find a question that similarity gets wrong and the filter gets right. Do this over the Corpus B playground above.
Run a semantic-only query. Clear the filter and search something like "which incidents were the most severe?". Read the top-3 and note whether SEV3 or SEV2 tickets sneak in despite the question being about severity.
Add the filter. Set the metadata filter to severity=SEV1 and run the same query. Confirm the non-SEV1 tickets drop out entirely, even ones that scored well on meaning.
Find the filter-only win. Craft a query where semantic search alone returns the wrong severity or wrong time period, but the filter fixes it. Write both the query and why meaning failed - "severity is a category, not a topic" is a good starting sentence.
Reflect on hybrid. The playground is dense-only, so try to name a Corpus B query where you would want sparse/BM25 too - a search for an exact ticket id like INC-410 is the obvious one. Note why dense alone would rank it poorly.
Before session b6 ◐ 40 min total
- Add metadata to your own Corpus B collection (severity, date as an ISO string) and run three
wherequeries: one$eq, one$inover two severities, and one$gte/$ltedate range wrapped in$and. - Write a query that returns the wrong answer with no filter and the right answer with a filter. Save the pair - it is a metadata test case for b9.
- If your store supports hybrid, sweep alpha across 0.0, 0.5, 1.0 for a query that names an exact ticket id, and record which alpha ranks the exact ticket first.
- Read: the Chroma metadata-filtering docs (operator list) and the Pinecone hybrid-search guide (dense + sparse, alpha weighting).
Official sources covered
Taught from official vector-database docs. This page covers ~80% of their working content on metadata filtering and hybrid search - the hosted-index setup and billing details stay with the source.
Three questions before you go 🎯 ◐ 90 seconds
1 · Why does pure semantic search struggle with "which SEV1 incidents happened in March?"
SEV1 and a date range are metadata conditions. You filter on the fields (where + $gte/$lte) and let similarity rank only the survivors.
2 · In hybrid retrieval, what does an alpha of 1.0 mean?
score = alpha·dense + (1-alpha)·sparse. alpha=1.0 is pure dense, 0.0 is pure sparse, 0.5 is an even hybrid.
3 · Sparse/BM25 retrieval is especially good at...
Sparse/BM25 scores by exact keyword overlap - great for ids and codes, blind to paraphrase. Dense is the reverse; hybrid fuses both.