User Story
As the Hybrid Search experiment team, we need to adopt a Search API that supports both lexical and semantic retrieval in a single contract, so that the Android app can reliably run Hybrid Search experiments and compare retrieval approaches.
Description
Adopt (or extend) a Search API that supports lexical search, and semantic retrieval via embeddings, suitable for use in the Android Hybrid Search MVP.
This task establishes the server-side contract required to power all Hybrid Search experiment variants, including:
- Lexical-first layouts
- Semantic-first layouts
This task is a blocking dependency for Hybrid Search downstream UX experimentation.
Requirements
API Availability & Contract
- A Search API endpoint is available to Android that supports:
- Lexical retrieval
- Semantic retrieval via embeddings
- API response includes, at minimum:
- Result type (lexical or semantic)
- Article title
- Section identifier (when applicable) that supports highlighting text
- Excerpt/snippet text (for semantic results)
- Provenance metadata sufficient for UI labeling
- API supports limiting result counts independently for:
- Lexical results (e.g., top N)
- Semantic results (e.g., top N excerpts)
Routing & Fallback Behavior
- API supports or clearly defines:
- Failure and timeout behavior for semantic retrieval
- In the event semantic retrieval fails or times out:
- Lexical results are still returned
- No API error blocks search execution
Performance & Reliability
- Median response latency for hybrid requests is documented
Experiment Support
- API responses include metadata allowing:
- Experiment variant attribution
- Retrieval-path logging (including query)
- API can be safely gated behind feature flags or experiment cohorts
Design: TBA
Copy and Translation: TBA