A quiet cafe is more than a place with a coffee tag. A business hotel with a gym is still a hotel. WhatsDo’s venue search needs to distinguish a place’s primary identity from incidental words in its description, then check whether it meets the user’s constraints.
Adding Seb judgments to the existing candidate lists lifted mean nDCG@5 from 0.852 to 0.973 across 219 held-out queries. This case study covers the ranking result, the three-way relevance rubric, and the implementation choices that keep the search path bounded and available.
WhatsDo search, before and after.

WhatsDo helps people find places and activities across restaurants, cafes, hotels, fitness studios, spas, and parks. Its existing search path already parsed requests, retrieved geographically eligible venues, and scored them. The weak point was distinguishing what a place mainly is from concepts mentioned incidentally in its tags or description.
| Stage | Before | With Seb reranking |
|---|---|---|
| Parse | Keywords, tags, location, filters | Keep existing parser |
| Retrieve | PostgreSQL text/tag + geography | Keep existing candidate retrieval |
| Score | Weighted relevance, rating, proximity | Keep baseline score for blending / fallback |
| Judge | No semantic reranker | Up to 10 candidate questions per Seb request |
| Return | Heuristic order | Semantic order, cache, bounded fail-open |
PostgreSQL text/tag search and geographic constraints supply the candidates. Seb judges relevance within that candidate set; the database and hard eligibility filters stay in place.
The failure modes that motivate the rubric
- “Quiet cafe with outdoor seating for working.” A loud late-night cocktail bar can match a secondary cafe tag and have many reviews. Those signals do not make it a quiet coffee shop with a suitable place to work.
- “Business hotel with a gym.” A standalone fitness studio or CrossFit gym matches the amenity word while failing the requested primary venue type: a hotel.
- “Park to visit.” An event planner or party venue may mention nearby parks without being a public park someone can visit.
These examples illustrate the ranking failure: category membership and constraint satisfaction need to be evaluated together. More tag matches need not mean a better result.
Ranking quality on the frozen candidate lists
The retrospective evaluation contains 219 held-out queries and 1,724 judged candidates, averaging 7.87 candidates per query. These query IDs are outside the harness’s named 60-case tuning set. Each output order was checked to be a permutation of its input candidate IDs.
| Measure | Baseline order | Seb order |
|---|---|---|
| Mean nDCG@5 | 0.852 | 0.973 |
| Paired mean gain | Reference | +0.122 |
| 95% paired bootstrap interval | — | +0.100 to +0.143 |
| Wins / ties / losses | Reference | 142 / 66 / 11 |
Unrounded means: 0.8516923 and 0.9732336; paired gain 0.1215413. The displayed rounded means differ by 0.121, while the unrounded paired gain rounds to +0.122. Relevance grades came from an automated judge with three replicates, not independently verified human gold.
nDCG@5 rewards putting more relevant venues near the top. It is a ranking metric, not “97.3% accuracy” or a measure of how many eligible venues the database retrieved. The reranker improves ordering within the same candidate set; it cannot recover a missing venue. Eleven queries regressed, so the mean gain is not a guarantee for every search.
Inside the reranker, one venue at a time.
The implementation below follows the inspected semantic_rerank.py development snapshot. It shows a production-oriented integration with batching, reuse, observability, and fallback. Reranking is optional and disabled by default in the inspected configuration; the supplied artifacts do not verify the currently deployed production backend.
1. Carry the evidence each judgment needs
The request’s shared state holds user_query and user_location. Each candidate question includes a compact place record: name, coarse category, address, up to 30 tags, rating, and up to 700 characters of summary. The question builder trims the summary when necessary and caps instructions at 2,000 characters.
The instruction explicitly warns that categories are coarse: a deli that sells coffee is not necessarily a coffee shop, and a planner is not a venue. This makes the rubric about primary identity and explicit requirements, rather than topic association.
2. Grade strong, partial, and wrong
- Strong: the right kind of place, matching every explicit constraint.
- Partial: the right kind of place, but a vibe, occasion, price, amenity, or cuisine constraint is missing or not evidenced.
- Wrong: the wrong kind of place, the wrong named city or neighborhood, incidental topic overlap, or contradiction of an explicit constraint.
“Not evidenced” matters. A record that says nothing about outdoor seating should not be promoted as a confirmed patio. Preserve the underlying fields so callers can distinguish missing information from a verified attribute. Geographic radius and other hard eligibility constraints stay in deterministic retrieval and filters.
body = {
"model": "general",
"state": {"user_query": query, "user_location": location_text},
"questions": {
f"p{i}": {
"type": "choice",
"instructions": instructions_with_this_place,
"criteria": {
"strong": "Right kind of place; every explicit constraint matches.",
"partial": "Right kind; one constraint missing or not evidenced.",
"wrong": "Wrong kind/location, incidental match, or contradiction.",
},
}
# Repeat for each candidate, up to 10 questions per request.
},
}
semantic = P("strong") + 0.5 * P("partial")This abbreviated shape explains the inspected integration; it is not a complete standalone client. For a new public API integration, pin model_version: "v3" and follow the current typed-decision contract. Seb returns probabilities; the application computes the ranking score.
3. Blend scores and preserve the candidate boundary
The semantic score is an expected relevance value on the rubric: P(strong) + 0.5 × P(partial). The service blends it with the existing score using a configurable weight α:
semantic = probabilities["strong"] + 0.5 * probabilities["partial"]
final = alpha * semantic + (1 - alpha) * baseline_total
# Judge and sort only the configured top-N head.
# Keep the tail's order, scaling its totals by (1 - alpha).
# Publish score.semantic and score.total rounded to four decimals.The replay used α = 1.0 for Seb, so its measured order is entirely semantic within the judged candidate set. The application supports a blend; the benchmark does not establish the best blend for another workload.
Only the first configured top-N rows are judged and reordered; the tail retains its order. The inspected configuration supports a top-20 path, so a full head can require two 10-candidate requests. Scaling tail totals by 1 − α keeps published scores consistent with the head-first ordering when baseline totals are nonnegative and initially sorted. With fewer than two head candidates, the service returns immediately.
4. Batch misses and reuse connections
The implementation splits uncached candidates into chunks of at most 10 questions, sends the chunks concurrently, and concatenates results in chunk order. This reduces request overhead without treating independent candidate prompts as one flat-priced judgment. The deployed serving runtime still determines how those questions are scheduled; a multi-question HTTP call alone does not prove one GPU forward pass.
A shared HTTP client allows 200 connections, keeps up to 100 idle connections, and uses a 120-second keep-alive expiry. This avoids rebuilding the connection pool for every search. The source retries HTTP 429 up to three attempts with incremental 0.2-second waits; the outer configured timeout bounds the judging operation. These are code settings, not a production concurrency benchmark.
5. Cache by content, not just venue ID
The published integration description specifies a Redis v3 cache (seb_rerank:v3:<hash>) with a seven-day TTL. The inspected source snapshot uses the older prefix rerank:noul:v1:seb:. We retain this distinction because the source does not establish that v3 is currently deployed.
In the inspected implementation, the hash input contains the configured model, normalized query, normalized location, and compact candidate content, serialized with stable key ordering and hashed with SHA-256. Query normalization lowercases and collapses whitespace. Changing a candidate’s evidence changes its cache key; changing the rubric requires a namespace/version bump.
Redis MGET fetches the candidate scores together. Only misses go to Seb, and a nontransactional pipeline writes fresh numeric scores with the seven-day expiry. Cache connection and socket timeouts are 100 ms. Cache read failure becomes a set of misses; cache write failure is logged without discarding the ranked result.
6. Fail open and measure the fallback
A disabled reranker or missing backend key returns the original rows. A judging timeout or request error also returns the existing eligible order. Detected missing or exceptional per-candidate results cause a fallback rather than publishing a partial ranking. The integration tracks outcome counters, cache-served judgment counts, and a rerank-duration histogram.
This fallback preserves the existing search path; it does not make incorrect model scores detectable or replace hard filters. The recorded duration is around the judging operation for cache misses, rather than a complete full-search timer including retrieval, cache access, and response construction. Track full request latency and fallback rate separately when evaluating a rollout.
153 ms per batch, with a separate search clock.
The November 6 remeasurement used 16 saved searches, each with 10 binary candidate judgments, sent sequentially in alternating service order. It recorded zero errors. This timing workload differs from the three-class ranking replay above; it is a small serial sizing sample, not a load test of the final production search path.
| Measurement | Median | Scope |
|---|---|---|
| Historical legacy search | 921 ms | 515 May replay requests, full client search route |
| Seb server_ms | 153 ms | 152.75 ms, 10-candidate batch, 16-search sample |
| Server time / candidate | 15.3 ms | Batch median divided by 10, amortized |
| Seb API e2e_ms | 175 ms | 175.15 ms, same remeasurement |
| Observed local client wall | 400 ms | 399.5 ms, includes local MCP connector overhead |
The legacy replay p95 was 1,158 ms (1,158.3 ms), with zero recorded errors. These different periods and boundaries cannot establish a 921 → 153 ms full-search speedup. 15.3 ms is amortized server time, not an independently measured single-candidate latency.
The earlier 279-case stage run, with Redis disabled and concurrency unrecorded, logged 854 ms p50 / 1,269 ms p95 for Seb and no recorded fail-open. Those historical stage timings should not be added to or subtracted from the May full-search replay. The newer serial sample does not establish p95 or throughput under production concurrency.
What the $0.048 figure pays for
The 16-search sample metered a median 2,294 input tokens per 10-candidate batch. At $0.021 per million, that rounds to $0.048 per 1,000 searches: about $0.000048 per search, or 0.0048 cents. This is a normalization of the metered sample’s median batch cost, not a complete monthly WhatsDo bill.
The archived ranking cache does not preserve a complete token ledger. The measured binary timing sample therefore cannot be presented as the exact bill for the 219-query three-class quality replay. Query parsing, PostgreSQL, Redis, hosting, network transport, and any answer generation remain additional costs.
For the replay’s roughly eight candidates per search, an explicit no-cache scenario of 300–500 input tokens per candidate gives $0.0504–$0.0840 per 1,000 searches. Batch calls reduce HTTP overhead; every question still meters its own full prompt. Measure actual cache hit rates rather than assuming repeated searches are free.
Methods, limits, and the next measurement.
The WhatsDo figures come from internal historical replay artifacts, recomputed by verify_whatsdo.py and summarized with input SHA-256 hashes in whatsdo-evidence.json. The latency and usage sample is recorded in latency-remeasure.json. The implementation discussion follows the inspected development snapshot identified in the evidence notes as 5abf101b.
- Retrospective evidence: 219 query IDs are outside the named tuning set, but the historical order cache lacks a complete immutable run manifest. Exact backend/version provenance was not independently established. This was not a prospectively preregistered experiment.
- Automated relevance labels: the labels use three model-judge replicates per candidate. They are not independent human gold. The positive paired bootstrap interval does not remove label bias or establish gains on other users and cities.
- Candidate recall comes first: if lexical retrieval misses synonyms or relevant venues, use query expansion, richer metadata, a larger candidate pool, or dense/hybrid retrieval. A reranker cannot create missing candidates.
- Deployment remains separate: code supports the integration, and the publication describes the intended production pattern. The supplied replay and source snapshot do not verify a current live rollout, cache version, or traffic-level quality gain.
- Report complete clocks and costs: recall@K before reranking, nDCG/MRR after reranking, answer accuracy separately, server and client p50/p95, cache hit and fallback rates, and actual billing plus unmetered infrastructure.
Try Seb with your own evidence.
Read the documentation and quickstart, use the interactive playground, or connect your agent through the agent plugin and MCP guide. Keep deterministic checks in code, retrieve missing facts, and use Seb for bounded judgments over the evidence supplied.
WhatsDo case study based on internal replay evidence prepared November 6, 2026, and the inspected search integration. A related Hugging Face article ↗ introduces the retrieval approach. This post contains the expanded WhatsDo implementation details. No fresh model evaluation or live production verification is claimed. The venue illustration is hosted locally.