Marketplace Engineering Two-Sided Search and Recsys Planning Best Practices
Comprehensive planning, design and diagnostic guide for search and recommendation systems
in two-sided trust marketplaces. Covers OpenSearch index, query and ranking patterns, the
methodology for planning retrieval work, the handoff points to recommendation-specific
tooling, and the instrumentation and dashboard layer that turns measurement into ongoing
decision making. Contains 57 rules across 10 categories ordered by cascade impact, plus
two playbooks (plan a new system from scratch, diagnose an existing one) and explicit
living-artefact conventions (decisions log, golden set, gotchas).
When to Apply
Reference this skill when:
- Planning a new marketplace retrieval project from scratch
- Reviewing an existing retrieval system that feels stale, unfair, or unpersonalised
- Designing the OpenSearch index mapping, analyzers, or query DSL
- Choosing retrieval primitives per product surface (search, recs, hybrid, curated)
- Deciding which search quality metrics to track and dashboard
- Running the weekly search-quality review ritual
- Diagnosing a silent regression in ranking, coverage, or zero-result rate
- Deciding when a retrieval problem is actually a personalisation problem
This skill is the precursor to marketplace-personalisation. Start here for
planning and search work; hand off to the personalisation skill when the diagnosed
bottleneck is impression tracking, feedback-loop bias, or AWS Personalize-specific
design.
Living Context
This skill treats the system as evolving. Three living artefacts carry context across
sessions, releases, and team changes — read them before making suggestions, update them
after every shipped change:
gotchas.md (in this skill folder) — append-only diagnostic lessons. Every gotcha
has a date and a short description of what surprised the team and how it was resolved.
- Decisions log (maintained in the product repo, typically
decisions/*.md) —
every ranking change, schema tweak, and synonym edit recorded with its hypothesis,
offline and online evidence, ship criterion, outcome, and rollback path. See rule
plan-maintain-a-decisions-log.
- Golden query set (frozen per eval cycle, committed to the product repo) — the
reference set of queries against which every ranking change is offline-evaluated
before an online test. See rule
plan-version-the-golden-set.
Rule Categories
Categories are ordered by cascade impact on the retrieval lifecycle: intent
misunderstanding poisons architecture; wrong architecture poisons index; wrong index
poisons retrieval forever until a reindex; every downstream layer inherits the upstream
error.
| # |
Category |
Prefix |
Impact |
| 1 |
Problem Framing and User Intent |
intent- |
CRITICAL |
| 2 |
Surface Taxonomy and Architecture |
arch- |
CRITICAL |
| 3 |
Index Design and Mapping |
index- |
HIGH |
| 4 |
Planning and Improvement Methodology |
plan- |
HIGH |
| 5 |
Query Understanding |
query- |
MEDIUM-HIGH |
| 6 |
Retrieval Strategy |
retrieve- |
MEDIUM-HIGH |
| 7 |
Relevance and Ranking |
rank- |
MEDIUM-HIGH |
| 8 |
Search and Recommender Blending |
blend- |
MEDIUM |
| 9 |
Measurement and Experimentation |
measure- |
MEDIUM |
| 10 |
Instrumentation, Dashboards and Decision Triggers |
monitor- |
MEDIUM |
Quick Reference
1. Problem Framing and User Intent (CRITICAL)
intent-map-queries-to-intent-classes — classify before retrieving
intent-separate-known-item-from-discovery — different failure modes, different strategies
intent-audit-live-query-logs-first — design from real data, not imagined data
intent-distinguish-transactional-from-exploratory — precision vs diversity
intent-reject-one-search-for-everything — per-surface query shapes
intent-treat-no-search-as-first-class-choice — curated is a legitimate answer
2. Surface Taxonomy and Architecture (CRITICAL)
arch-map-surface-to-retrieval-primitive — a single-source-of-truth routing table
arch-split-candidate-generation-from-ranking — two-stage pipelines
arch-design-zero-result-fallback — declare fallback owner per surface
arch-design-for-cold-start-from-day-one — cold start is permanent, not bootstrap
arch-avoid-mono-stack-retrieval — diversify primary dependencies
arch-route-surfaces-deliberately — every routing decision recorded
3. Index Design and Mapping (HIGH)
index-design-mappings-conservatively — reindex is expensive
index-use-keyword-and-text-as-multi-fields — full-text plus exact match
index-match-index-and-query-time-analyzers — tokens must agree
index-use-language-analyzers-for-language-fields — language-aware stemming
index-separate-searchable-from-display-fields — index only what you search
index-use-index-templates-for-consistency — prevent mapping drift
index-stream-listing-updates-via-cdc — freshness in seconds, not hours
4. Planning and Improvement Methodology (HIGH)
plan-audit-before-you-build — instrumentation gate on kick-off
plan-build-golden-query-set-first — the first artefact, not the last
plan-find-bottleneck-before-optimising — theory of constraints
plan-maintain-a-decisions-log — living context across team changes
plan-version-the-golden-set — frozen per eval cycle
plan-handoff-to-personalisation-skill — recognise the boundary
5. Query Understanding (MEDIUM-HIGH)
query-normalise-before-anything-else — canonical string in
query-use-language-analyzers-for-stemming — double-digit recall wins
query-curate-synonyms-by-domain — domain vocabulary not thesaurus
query-use-fuzzy-matching-for-typos — 10-15% of queries have typos
query-classify-before-routing — single-pass classifier
query-build-autocomplete-on-separate-index — latency isolation
6. Retrieval Strategy (MEDIUM-HIGH)
retrieve-use-filter-clauses-for-exact-matches — filter cache wins
retrieve-use-bool-structure-deliberately — must vs should vs filter
retrieve-run-expensive-signals-in-rescore — rescore window limits cost
retrieve-combine-bm25-and-knn-via-hybrid-search — lexical plus semantic
retrieve-paginate-with-search-after — constant-cost deep pagination
retrieve-choose-embedding-model-deliberately — re-embedding is expensive
7. Relevance and Ranking (MEDIUM-HIGH)
rank-tune-bm25-parameters-last — upstream levers first
rank-use-function-score-for-business-signals — explicit named functions
rank-deploy-ltr-only-after-golden-set-exists — supervised learning needs labels
rank-apply-diversity-at-rank-time — after scoring, not before
rank-normalise-scores-across-retrieval-primitives — comparable scales
8. Search and Recommender Blending (MEDIUM)
blend-use-search-alone-for-specific-intent — precision queries
blend-combine-search-and-personalisation-scores — normalised weighted sum
blend-keep-hybrid-blending-explainable — traceable results
blend-never-return-zero-results — guaranteed cascade to non-empty
9. Measurement and Experimentation (MEDIUM)
measure-define-session-success-per-surface — one definition per surface
measure-track-ndcg-mrr-zero-result-rate — three metrics for one picture
measure-track-reformulation-rate-as-failure-signal — cheapest failure metric
measure-use-click-models-for-implicit-judgments — scale beyond human judges
measure-run-interleaving-as-cheap-ab-proxy — 10x less sample needed
10. Instrumentation, Dashboards and Decision Triggers (MEDIUM)
monitor-log-every-query-with-full-context — structured replayable events
monitor-scrub-pii-from-query-logs — redact before warehouse ingestion
monitor-build-search-health-dashboard — threshold lines, colour bands
monitor-alert-on-decision-triggers — quality metrics, not error rates
monitor-track-ranking-stability-churn — RBO churn as leading indicator
monitor-run-weekly-search-quality-review — calendar-driven ritual
Planning and Improving
Two playbooks compose the rules into end-to-end workflows:
references/playbooks/planning.md — Plan a new marketplace retrieval system from scratch. Nine-step workflow from intent audit through the first A/B-tested online lift, with explicit exit criteria per step.
references/playbooks/improving.md — Diagnose and improve an existing retrieval system. Decision tree that walks through telemetry, index freshness, coverage, baseline gap, cold start, segment regressions, and algorithm iteration in that order, with hand-off points to marketplace-personalisation when the bottleneck is personalisation-specific.
Read the playbooks first when the task is "design a new search and recommender project"
or "this retrieval system needs to get better". Read individual rules when a specific
question arises during implementation or review.
How to Use
- Read
references/_sections.md for category structure and cascade rationale.
- Read
gotchas.md for diagnostic lessons accumulated from prior incidents.
- Read
references/playbooks/planning.md to plan a new system.
- Read
references/playbooks/improving.md to diagnose an existing one.
- Read individual rule files when a specific task matches the rule title.
- Use
assets/templates/_template.md to author new rules as the skill grows.
Related Skills
marketplace-personalisation — The companion skill covering AWS Personalize implementation, impression tracking, schema design, two-sided matching, feedback loops, and the personalisation-specific diagnostic playbook. Hand off to this skill when the diagnostic identifies a personalisation-specific bottleneck.
Reference Files
| File |
Description |
| references/_sections.md |
Category definitions and impact ordering |
| references/playbooks/planning.md |
Plan a new retrieval system |
| references/playbooks/improving.md |
Diagnose an existing retrieval system |
| gotchas.md |
Accumulated diagnostic lessons (living) |
| assets/templates/_template.md |
Template for authoring new rules |
| metadata.json |
Version, discipline, references |
1---2name: marketplace-search-recsys-planning3description: Search and recommendation system planning for a two-sided trust marketplace built on OpenSearch — user-intent framing, product-surface architecture, index design, query understanding, retrieval strategy, ranking, search-plus-recs blending, measurement, and a dashboard-and-alerting layer for ongoing decision making. Triggers on tasks involving marketplace search, homefeeds, ranking, relevance tuning, OpenSearch query DSL, analyzers, synonyms, golden sets, NDCG, A/B testing, or diagnosing an existing retrieval system. Use this skill BEFORE marketplace-personalisation when planning new work; hand off when the diagnosed bottleneck is personalisation-specific.4---5# Marketplace Engineering Two-Sided Search and Recsys Planning Best Practices
6
7Comprehensive planning, design and diagnostic guide for search and recommendation systems
8in two-sided trust marketplaces. Covers OpenSearch index, query and ranking patterns, the
9methodology for planning retrieval work, the handoff points to recommendation-specific
10tooling, and the instrumentation and dashboard layer that turns measurement into ongoing
11decision making. Contains 57 rules across 10 categories ordered by cascade impact, plus
12two playbooks (plan a new system from scratch, diagnose an existing one) and explicit
13living-artefact conventions (decisions log, golden set, gotchas).
14
15## When to Apply
16
17Reference this skill when:
18
19- Planning a new marketplace retrieval project from scratch
20- Reviewing an existing retrieval system that feels stale, unfair, or unpersonalised
21- Designing the OpenSearch index mapping, analyzers, or query DSL
22- Choosing retrieval primitives per product surface (search, recs, hybrid, curated)
23- Deciding which search quality metrics to track and dashboard
24- Running the weekly search-quality review ritual
25- Diagnosing a silent regression in ranking, coverage, or zero-result rate
26- Deciding when a retrieval problem is actually a personalisation problem
27
28This skill is the **precursor** to `marketplace-personalisation`. Start here for
29planning and search work; hand off to the personalisation skill when the diagnosed
30bottleneck is impression tracking, feedback-loop bias, or AWS Personalize-specific
31design.
32
33## Living Context
34
35This skill treats the system as evolving. Three living artefacts carry context across
36sessions, releases, and team changes — read them before making suggestions, update them
37after every shipped change:
38
39- **`gotchas.md`** (in this skill folder) — append-only diagnostic lessons. Every gotcha
40 has a date and a short description of what surprised the team and how it was resolved.
41- **Decisions log** (maintained in the product repo, typically `decisions/*.md`) —
42 every ranking change, schema tweak, and synonym edit recorded with its hypothesis,
43 offline and online evidence, ship criterion, outcome, and rollback path. See rule
44 [`plan-maintain-a-decisions-log`](references/plan-maintain-a-decisions-log.md).
45- **Golden query set** (frozen per eval cycle, committed to the product repo) — the
46 reference set of queries against which every ranking change is offline-evaluated
47 before an online test. See rule
48 [`plan-version-the-golden-set`](references/plan-version-the-golden-set.md).
49
50## Rule Categories
51
52Categories are ordered by cascade impact on the retrieval lifecycle: intent
53misunderstanding poisons architecture; wrong architecture poisons index; wrong index
54poisons retrieval forever until a reindex; every downstream layer inherits the upstream
55error.
56
57| # | Category | Prefix | Impact |
58|---|----------|--------|--------|
59| 1 | Problem Framing and User Intent | `intent-` | CRITICAL |
60| 2 | Surface Taxonomy and Architecture | `arch-` | CRITICAL |
61| 3 | Index Design and Mapping | `index-` | HIGH |
62| 4 | Planning and Improvement Methodology | `plan-` | HIGH |
63| 5 | Query Understanding | `query-` | MEDIUM-HIGH |
64| 6 | Retrieval Strategy | `retrieve-` | MEDIUM-HIGH |
65| 7 | Relevance and Ranking | `rank-` | MEDIUM-HIGH |
66| 8 | Search and Recommender Blending | `blend-` | MEDIUM |
67| 9 | Measurement and Experimentation | `measure-` | MEDIUM |
68| 10 | Instrumentation, Dashboards and Decision Triggers | `monitor-` | MEDIUM |
69
70## Quick Reference
71
72### 1. Problem Framing and User Intent (CRITICAL)
73
74- [`intent-map-queries-to-intent-classes`](references/intent-map-queries-to-intent-classes.md) — classify before retrieving
75- [`intent-separate-known-item-from-discovery`](references/intent-separate-known-item-from-discovery.md) — different failure modes, different strategies
76- [`intent-audit-live-query-logs-first`](references/intent-audit-live-query-logs-first.md) — design from real data, not imagined data
77- [`intent-distinguish-transactional-from-exploratory`](references/intent-distinguish-transactional-from-exploratory.md) — precision vs diversity
78- [`intent-reject-one-search-for-everything`](references/intent-reject-one-search-for-everything.md) — per-surface query shapes
79- [`intent-treat-no-search-as-first-class-choice`](references/intent-treat-no-search-as-first-class-choice.md) — curated is a legitimate answer
80
81### 2. Surface Taxonomy and Architecture (CRITICAL)
82
83- [`arch-map-surface-to-retrieval-primitive`](references/arch-map-surface-to-retrieval-primitive.md) — a single-source-of-truth routing table
84- [`arch-split-candidate-generation-from-ranking`](references/arch-split-candidate-generation-from-ranking.md) — two-stage pipelines
85- [`arch-design-zero-result-fallback`](references/arch-design-zero-result-fallback.md) — declare fallback owner per surface
86- [`arch-design-for-cold-start-from-day-one`](references/arch-design-for-cold-start-from-day-one.md) — cold start is permanent, not bootstrap
87- [`arch-avoid-mono-stack-retrieval`](references/arch-avoid-mono-stack-retrieval.md) — diversify primary dependencies
88- [`arch-route-surfaces-deliberately`](references/arch-route-surfaces-deliberately.md) — every routing decision recorded
89
90### 3. Index Design and Mapping (HIGH)
91
92- [`index-design-mappings-conservatively`](references/index-design-mappings-conservatively.md) — reindex is expensive
93- [`index-use-keyword-and-text-as-multi-fields`](references/index-use-keyword-and-text-as-multi-fields.md) — full-text plus exact match
94- [`index-match-index-and-query-time-analyzers`](references/index-match-index-and-query-time-analyzers.md) — tokens must agree
95- [`index-use-language-analyzers-for-language-fields`](references/index-use-language-analyzers-for-language-fields.md) — language-aware stemming
96- [`index-separate-searchable-from-display-fields`](references/index-separate-searchable-from-display-fields.md) — index only what you search
97- [`index-use-index-templates-for-consistency`](references/index-use-index-templates-for-consistency.md) — prevent mapping drift
98- [`index-stream-listing-updates-via-cdc`](references/index-stream-listing-updates-via-cdc.md) — freshness in seconds, not hours
99
100### 4. Planning and Improvement Methodology (HIGH)
101
102- [`plan-audit-before-you-build`](references/plan-audit-before-you-build.md) — instrumentation gate on kick-off
103- [`plan-build-golden-query-set-first`](references/plan-build-golden-query-set-first.md) — the first artefact, not the last
104- [`plan-find-bottleneck-before-optimising`](references/plan-find-bottleneck-before-optimising.md) — theory of constraints
105- [`plan-maintain-a-decisions-log`](references/plan-maintain-a-decisions-log.md) — living context across team changes
106- [`plan-version-the-golden-set`](references/plan-version-the-golden-set.md) — frozen per eval cycle
107- [`plan-handoff-to-personalisation-skill`](references/plan-handoff-to-personalisation-skill.md) — recognise the boundary
108
109### 5. Query Understanding (MEDIUM-HIGH)
110
111- [`query-normalise-before-anything-else`](references/query-normalise-before-anything-else.md) — canonical string in
112- [`query-use-language-analyzers-for-stemming`](references/query-use-language-analyzers-for-stemming.md) — double-digit recall wins
113- [`query-curate-synonyms-by-domain`](references/query-curate-synonyms-by-domain.md) — domain vocabulary not thesaurus
114- [`query-use-fuzzy-matching-for-typos`](references/query-use-fuzzy-matching-for-typos.md) — 10-15% of queries have typos
115- [`query-classify-before-routing`](references/query-classify-before-routing.md) — single-pass classifier
116- [`query-build-autocomplete-on-separate-index`](references/query-build-autocomplete-on-separate-index.md) — latency isolation
117
118### 6. Retrieval Strategy (MEDIUM-HIGH)
119
120- [`retrieve-use-filter-clauses-for-exact-matches`](references/retrieve-use-filter-clauses-for-exact-matches.md) — filter cache wins
121- [`retrieve-use-bool-structure-deliberately`](references/retrieve-use-bool-structure-deliberately.md) — must vs should vs filter
122- [`retrieve-run-expensive-signals-in-rescore`](references/retrieve-run-expensive-signals-in-rescore.md) — rescore window limits cost
123- [`retrieve-combine-bm25-and-knn-via-hybrid-search`](references/retrieve-combine-bm25-and-knn-via-hybrid-search.md) — lexical plus semantic
124- [`retrieve-paginate-with-search-after`](references/retrieve-paginate-with-search-after.md) — constant-cost deep pagination
125- [`retrieve-choose-embedding-model-deliberately`](references/retrieve-choose-embedding-model-deliberately.md) — re-embedding is expensive
126
127### 7. Relevance and Ranking (MEDIUM-HIGH)
128
129- [`rank-tune-bm25-parameters-last`](references/rank-tune-bm25-parameters-last.md) — upstream levers first
130- [`rank-use-function-score-for-business-signals`](references/rank-use-function-score-for-business-signals.md) — explicit named functions
131- [`rank-deploy-ltr-only-after-golden-set-exists`](references/rank-deploy-ltr-only-after-golden-set-exists.md) — supervised learning needs labels
132- [`rank-apply-diversity-at-rank-time`](references/rank-apply-diversity-at-rank-time.md) — after scoring, not before
133- [`rank-normalise-scores-across-retrieval-primitives`](references/rank-normalise-scores-across-retrieval-primitives.md) — comparable scales
134
135### 8. Search and Recommender Blending (MEDIUM)
136
137- [`blend-use-search-alone-for-specific-intent`](references/blend-use-search-alone-for-specific-intent.md) — precision queries
138- [`blend-combine-search-and-personalisation-scores`](references/blend-combine-search-and-personalisation-scores.md) — normalised weighted sum
139- [`blend-keep-hybrid-blending-explainable`](references/blend-keep-hybrid-blending-explainable.md) — traceable results
140- [`blend-never-return-zero-results`](references/blend-never-return-zero-results.md) — guaranteed cascade to non-empty
141
142### 9. Measurement and Experimentation (MEDIUM)
143
144- [`measure-define-session-success-per-surface`](references/measure-define-session-success-per-surface.md) — one definition per surface
145- [`measure-track-ndcg-mrr-zero-result-rate`](references/measure-track-ndcg-mrr-zero-result-rate.md) — three metrics for one picture
146- [`measure-track-reformulation-rate-as-failure-signal`](references/measure-track-reformulation-rate-as-failure-signal.md) — cheapest failure metric
147- [`measure-use-click-models-for-implicit-judgments`](references/measure-use-click-models-for-implicit-judgments.md) — scale beyond human judges
148- [`measure-run-interleaving-as-cheap-ab-proxy`](references/measure-run-interleaving-as-cheap-ab-proxy.md) — 10x less sample needed
149
150### 10. Instrumentation, Dashboards and Decision Triggers (MEDIUM)
151
152- [`monitor-log-every-query-with-full-context`](references/monitor-log-every-query-with-full-context.md) — structured replayable events
153- [`monitor-scrub-pii-from-query-logs`](references/monitor-scrub-pii-from-query-logs.md) — redact before warehouse ingestion
154- [`monitor-build-search-health-dashboard`](references/monitor-build-search-health-dashboard.md) — threshold lines, colour bands
155- [`monitor-alert-on-decision-triggers`](references/monitor-alert-on-decision-triggers.md) — quality metrics, not error rates
156- [`monitor-track-ranking-stability-churn`](references/monitor-track-ranking-stability-churn.md) — RBO churn as leading indicator
157- [`monitor-run-weekly-search-quality-review`](references/monitor-run-weekly-search-quality-review.md) — calendar-driven ritual
158
159## Planning and Improving
160
161Two playbooks compose the rules into end-to-end workflows:
162
163- [`references/playbooks/planning.md`](references/playbooks/planning.md) — Plan a new marketplace retrieval system from scratch. Nine-step workflow from intent audit through the first A/B-tested online lift, with explicit exit criteria per step.
164- [`references/playbooks/improving.md`](references/playbooks/improving.md) — Diagnose and improve an existing retrieval system. Decision tree that walks through telemetry, index freshness, coverage, baseline gap, cold start, segment regressions, and algorithm iteration in that order, with hand-off points to `marketplace-personalisation` when the bottleneck is personalisation-specific.
165
166Read the playbooks first when the task is "design a new search and recommender project"
167or "this retrieval system needs to get better". Read individual rules when a specific
168question arises during implementation or review.
169
170## How to Use
171
172- Read [`references/_sections.md`](references/_sections.md) for category structure and cascade rationale.
173- Read [`gotchas.md`](gotchas.md) for diagnostic lessons accumulated from prior incidents.
174- Read [`references/playbooks/planning.md`](references/playbooks/planning.md) to plan a new system.
175- Read [`references/playbooks/improving.md`](references/playbooks/improving.md) to diagnose an existing one.
176- Read individual rule files when a specific task matches the rule title.
177- Use [`assets/templates/_template.md`](assets/templates/_template.md) to author new rules as the skill grows.
178
179## Related Skills
180
181- **`marketplace-personalisation`** — The companion skill covering AWS Personalize implementation, impression tracking, schema design, two-sided matching, feedback loops, and the personalisation-specific diagnostic playbook. Hand off to this skill when the diagnostic identifies a personalisation-specific bottleneck.
182
183## Reference Files
184
185| File | Description |
186|------|-------------|
187| [references/_sections.md](references/_sections.md) | Category definitions and impact ordering |
188| [references/playbooks/planning.md](references/playbooks/planning.md) | Plan a new retrieval system |
189| [references/playbooks/improving.md](references/playbooks/improving.md) | Diagnose an existing retrieval system |
190| [gotchas.md](gotchas.md) | Accumulated diagnostic lessons (living) |
191| [assets/templates/_template.md](assets/templates/_template.md) | Template for authoring new rules |
192| [metadata.json](metadata.json) | Version, discipline, references |