Healthcare Search Discovery Using ML and Generative AI on E-commerce Platform

amazon_health_services · Healthcare · 2025 · source Agentic: no · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: healthcare ecommerce search and discovery

Amazon Health Services needed Amazon.com search to understand healthcare intent and surface relevant healthcare products and services, even when customers searched with symptoms, conditions, treatments, or lay terminology rather than exact product names.

Constraints:

Architecture

Amazon Health Services built a three-part search discovery system on AWS. A query-understanding pipeline uses Amazon search engagement data, PySpark on EMR, Athena, SageMaker, and trained ML models to detect health-related searches, distinguishing lower-funnel prescription-medication searches from broader health condition searches. A product knowledge base combines Amazon catalog metadata with LLM-augmented health conditions, symptoms, and treatment keywords generated through Amazon Bedrock batch inference; the knowledge base is embedded and indexed with FAISS for semantic retrieval. A relevance optimization layer retrieves and reranks candidate healthcare offerings, then applies ESCI relevance labels through a combination of human labeling and LLM-based batch classification to connect health search keywords with products and services such as Amazon Pharmacy, One Medical, and Health Benefits Connector.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  A["Amazon search query"] --> B["Query understanding pipeline"]
  B --> C["Pharmacy classifier"]
  B --> D["Health NER model"]
  E["Amazon search engagement data"] --> C
  F["Health ontology sources"] --> D
  F --> G["Bedrock term expansion"]
  G --> D
  G --> H["Product knowledge base builder"]
  H --> I["FAISS similarity index"]
  I --> J["Retrieval and reranking pipeline"]
  J --> K["ESCI relevance labeling"]
  K --> L["Human labeling team"]
  K --> M["LLM ESCI labeling"]
  M --> N["Amazon S3 storage"]
  H --> N
  J --> O["Healthcare search experience"]
  B --> O
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Amazon search query Customer health-related search input, ranging from exact medication names to broad symptoms or conditions. Query understanding pipeline
Query understanding pipeline Classifies searches as health-related, specific medication intent, or broader condition/service intent. Pharmacy classifier, Health NER model, Healthcare search experience
Pharmacy classifier Classification model trained from anonymized Amazon search engagement data to detect prescription-medication searches. Amazon search engagement data, Healthcare search experience
Health NER model Medical entity recognition model that detects conditions, diseases, treatments, injuries, medications, and related concepts in broad health queries. Health ontology sources, Bedrock term expansion, Healthcare search experience
Health ontology sources Domain vocabulary used to seed health concepts and alternate terms for NER training. Health NER model, Bedrock term expansion
Bedrock term expansion LLM batch inference used to expand health concepts, product keywords, and relevance labels. Health NER model, Product knowledge base builder, LLM ESCI labeling
Product knowledge base builder Combines Amazon catalog metadata and ASIN attributes with LLM-enhanced health information for products and services. FAISS similarity index, Amazon S3 storage
FAISS similarity index Embedding index used to match health query embeddings against healthcare product and service knowledge. Retrieval and reranking pipeline
Retrieval and reranking pipeline Search app and model repository path that retrieves candidates, reduces to top K, and reranks health search results. ESCI relevance labeling, Healthcare search experience
ESCI relevance labeling Exact, substitute, complement, irrelevant relevance framework used to judge query-product matches. Human labeling team, LLM ESCI labeling
Human labeling team Creates ground-truth relevance labels for a substantial sample using AHS-tailored ESCI guidance. ESCI relevance labeling
LLM ESCI labeling Bedrock batch-inference classifier that labels top health-search product matches using product context and few-shot ESCI guidance. ESCI relevance labeling, Amazon S3 storage
Amazon S3 storage Stores training data, knowledge bases, embeddings files, and large-scale inference outputs. Product knowledge base builder, LLM ESCI labeling
Healthcare search experience Amazon.com experience that surfaces medically vetted relevant offerings and refinement options for healthcare searches. —

Data flow

An Amazon health search first flows through query-understanding models. Specific lower-funnel medication queries are identified by a pharmacy classifier trained from anonymized search engagement data, while broad health queries are annotated by an NER model trained from health ontologies and LLM-expanded alternate terms. Separately, healthcare product and service metadata is enriched with Bedrock-generated health keywords, embedded, and indexed with FAISS. At search time, a query embedding retrieves candidate products or services from the FAISS index. Candidate query-product pairs are reranked and labeled using the ESCI framework with both human labeling and Bedrock batch inference, producing relevant healthcare offerings and discovery pathways in the Amazon search experience.

3 supporting quotes
“Query understanding pipeline – Uses ML models to identify and classify health-related searches, distinguishing between specific medication queries and broader health condition searches”article, stated
“With our product knowledge base built from Amazon catalog metadata and ASIN attributes, we were ready to support new queries from customers.”article, stated
“After matches were found in the previous step, we retrieved the top products and used them as prompt context for our generative model.”article, stated

Why this architecture

AHS combined classifiers, NER, LLM augmentation, vector retrieval, and ESCI relevance labeling because healthcare search has both exact medication intent and ambiguous symptom/condition intent. The system needed ontology-aware query understanding, semantically enriched product knowledge, and validated relevance matching, not only traditional ecommerce keyword matching. AWS batch and ML services let the team scale ontology expansion, embeddings, and LLM labeling without relying on manual work for every query-product pair.

3 supporting quotes
“Healthcare discovery on ecommerce domains presents unique challenges that traditional product search wasn’t designed to handle.”article, stated
“This unique nature of healthcare offerings called for developing specialized approaches to connect customers with relevant services.”article, stated
“Scaling this process manually would have required orders of magnitude more financial budget.”article, stated

Models used: pharmacy classifier · health NER model · large language model · Amazon Bedrock models · FAISS embeddings · bi-encoder · cross-encoder

Scale

Alternatives considered (roads not taken)

Use traditional product search algorithms unchanged

Rejected because: Traditional ecommerce search was not designed to map symptoms, conditions, treatments, and healthcare services to each other.

“Healthcare discovery on ecommerce domains presents unique challenges that traditional product search wasn’t designed to handle.”article, stated
“Existing search algorithms optimized for physical products might not match these service-based health offerings”article, stated

Use only exact medication/product intent

Rejected because: The search experience needed to serve both spearfishing medication queries and broad upper-funnel condition queries such as back pain, acne, or high blood pressure.

“On one end are what we call “spearfishing queries” or lower funnel searches, where customers have a clear product search intent”article, stated
“On the other end are broad, upper funnel queries where customers seek inspiration, information, or recommendations with general product search intent”article, stated

Depend only on existing ontology terms

Rejected because: For health concepts without enough alternate terms, the team used LLMs to expand the knowledge base with lay and medically relevant variants.

“For health concepts where we did not have enough alternate terms in our knowledge base, we used LLMs to expand our knowledge base.”article, stated
“alternate terms for the condition “acid reflux” might be “heart burn”, “GERD”, “indigestion”, etc.”article, stated

Use only human labeling for relevance

Rejected because: Human labels established reliable ground truth, but Bedrock batch jobs scaled labeling across top health searches and product matches.

“First, we worked with a human labeling team to establish ground truth on a substantial sample size”article, stated
“Second, we implemented LLM-based labeling using Amazon Bedrock and batch jobs.”article, stated

Use customer-level personal data for matching

Rejected because: The implementation guidance says the approach does not use individual customer data, relying instead on aggregated search keywords, product metadata, ontology data, and labels.

“Using a mix of high-confidence human and LLM-based labels, we established a true ground truth.”article, stated
“we created semantic connections between customer queries and relevant healthcare solutions without relying on individual customer data.”article, stated

Patterns

rag-retrieval (retrieval)

AHS implemented RAG-style semantic matching by embedding customer health queries, searching a FAISS index built from LLM-enhanced product knowledge, and retrieving candidate healthcare offerings for reranking and labeling.

“A core component of our solution was implementing the Retrieval Augmented Generation (RAG) design pattern.”article, stated
“When a customer search query arrived, we converted it to an embedding and used it as a search key for matching against our index.”article, stated

fine-tuning-adaptation (model adaptation)

The team trained a pharmacy classifier from Amazon search engagement data and fine-tuned a health NER model from ontology and LLM-expanded health concepts.

“we analyzed anonymized customer search engagement data for Amazon products and trained a classification model”article, stated
“Both feed into a knowledge building process that stores training data in Amazon S3. The pipeline continues to AWS SageMaker Studio for training a base NER model”article, stated

human-in-the-loop-gate (evaluation)

Human labelers created a substantial ground-truth benchmark using ESCI guidance tailored to AHS products and services before LLM labeling was used at scale.

“First, we worked with a human labeling team to establish ground truth on a substantial sample size, creating a reliable benchmark for our system’s performance”article, stated
“The labeling team was given guidance based on the ESCI framework and tailored towards AHS products and services.”article, stated

eval-driven-development (evaluation)

Relevance quality was evaluated through ESCI exact/substitute/complement/irrelevant labels, human benchmarks, LLM batch classification, and high-confidence labels used as ground truth.

“we implemented a two-pronged approach to relevance labeling. We used an established scheme to tag each offering as exact, substitute, complement, or irrelevant”article, stated
“Using a mix of high-confidence human and LLM-based labels, we established a true ground truth.”article, stated

structured-output-contract (data contract)

The system used the ESCI framework as a structured relevance contract and maintained mappings from embeddings back to original knowledge base items for accurate reverse lookups.

“We used an established scheme to tag each offering as exact, substitute, complement, or irrelevant to the keyword.”article, stated
“We maintained careful mappings from each embedding back to the original knowledge base items, making sure we could perform accurate reverse lookups when needed.”article, stated

privacy-preserving-processing (privacy)

The search discovery system connected aggregated health search keywords and product metadata without relying on individual customer data.

“we created semantic connections between customer queries and relevant healthcare solutions without relying on individual customer data.”article, stated
“Our approach doesn’t use individual customer data. * Cost optimization: * Use Amazon EMR on EC2 Spot Instances for batch processing jobs”article, stated

cost-aware-routing (operations)

The implementation guidance routes batch processing to cost-efficient infrastructure such as EMR on EC2 Spot Instances and uses caching for frequently searched queries.

“Use Amazon EMR on EC2 Spot Instances for batch processing jobs”article, stated
“Implement caching for frequently searched queries”article, stated

Tradeoffs

Combine classifier and NER approaches for query understanding

Chose separate models for spearfishing prescription intent and broad health concept detection over one generic health-search classifier.

Rationale: Exact medication searches and ambiguous symptom/condition searches sit at opposite ends of the search-intent spectrum and require different handling.

“We approached the customer search journey by recognizing its two distinct ends of the spectrum.”article, stated
“Building upon Amazon search capabilities, we developed additional query understanding models to serve the full spectrum of healthcare searches.”article, stated

Use Bedrock LLMs to augment knowledge and labels

Chose LLM expansion and batch labeling with few-shot prompts over manual ontology/product curation and labeling only.

Rationale: LLMs expanded health terminology and relevance labels at a scale that would otherwise require far more manual budget.

“with a fine-tuned prompt and few-shot examples to layer in additional relevant health conditions, symptoms, and treatment-related keywords”article, stated
“using Amazon Bedrock batch inference was a key differentiator. It provided us with powerful LLMs for knowledge augmentation and relevance labeling”article, stated

Use FAISS embeddings for healthcare product matching

Chose semantic vector search over enriched product knowledge over keyword-only product matching.

Rationale: Healthcare search requires semantic connections between lay health queries and relevant products or services, which embeddings can capture better than exact keyword matching alone.

“we improved our ability to connect customers with relevant healthcare offerings.”article, stated
“This similarity search used FAISS with matching criteria based on the threshold against the similarity score.”article, stated

Use both human and LLM relevance labels

Chose hybrid ESCI labeling with human ground truth and LLM batch classification over all-human labels or all-LLM labels.

Rationale: Human labels provide trustworthy benchmark data, while LLM batch jobs scale relevance labeling across large health-search candidate sets.

“we implemented a two-pronged approach to relevance labeling.”article, stated
“Second, we implemented LLM-based labeling using Amazon Bedrock and batch jobs.”article, stated

Avoid individual customer data

Chose aggregated search keywords, product metadata, ontology terms, and labels over personalized health matching based on individual customer data.

Rationale: The healthcare search implementation guidance explicitly emphasizes privacy and compliance by not using individual customer data.

“Our approach doesn’t use individual customer data. * Cost optimization: * Use Amazon EMR on EC2 Spot Instances for batch processing jobs”article, stated
“Our approach doesn’t use individual customer data. * Cost optimization: * Use Amazon EMR on EC2 Spot Instances for batch processing jobs”article, stated

Gotchas (what bit them)

Healthcare service offerings do not behave like ordinary ecommerce products.

Root cause: A query such as back pain treatment may imply medications, doctor appointments, virtual physical therapy, or other services that traditional product search does not surface.

Resolution: AHS built specialized query understanding and matching to connect health intent with service-based offerings as well as physical or pharmacy products.

“a customer searching for “back pain treatment” might be looking for a variety of solutions”article, stated
“This unique nature of healthcare offerings called for developing specialized approaches to connect customers with relevant services.”article, stated

Broad health queries are ambiguous until the system understands intent.

Root cause: Queries such as high blood pressure may refer to medical care, prescription medication, monitors, books, or other informational and product categories.

Resolution: The NER and query-understanding system detects broad health concepts and triggers experiences that help customers refine or disambiguate intent.

“we detect the broad “high blood pressure” symptom but don’t know the customer’s intention.”article, stated
“we trigger an experience that gives them multiple options to make the search more specific.”article, stated

Ontology coverage can be too sparse for customer language.

Root cause: Health concepts may lack enough alternate lay terms, synonyms, misspellings, or treatment-related keywords in the existing knowledge base.

Resolution: AHS used LLMs through Bedrock to expand alternate terms and enrich product knowledge before embedding and search.

“For health concepts where we did not have enough alternate terms in our knowledge base, we used LLMs to expand our knowledge base.”article, stated
“with a fine-tuned prompt and few-shot examples to layer in additional relevant health conditions, symptoms, and treatment-related keywords”article, stated

Semantic retrieval needs reverse lookups to avoid losing product identity.

Root cause: Embeddings support similarity search, but the system still needs to map each vector result back to the original product or service knowledge item.

Resolution: The team maintained careful mappings from embeddings to original knowledge base items.

“and we created an index file to enable efficient similarity searches.”article, stated
“We maintained careful mappings from each embedding back to the original knowledge base items, making sure we could perform accurate reverse lookups when needed.”article, stated

Manual relevance labeling alone would not scale economically.

Root cause: Large-scale health search-product matching requires labeling many query-product pairs across top health searches.

Resolution: Use human labels for reliable benchmark creation and Bedrock batch inference for large-scale ESCI labeling.

“First, we worked with a human labeling team to establish ground truth on a substantial sample size”article, stated
“Scaling this process manually would have required orders of magnitude more financial budget.”article, stated

Evaluation

AHS evaluated relevance through a two-pronged ESCI labeling process: human labelers created ground truth on a substantial sample with AHS-tailored guidance, and Bedrock batch jobs labeled top retrieved healthcare product matches with few-shot ESCI examples. The system also used high-confidence human and LLM labels to establish ground truth, thresholded FAISS similarity search, and ongoing model-performance monitoring/retraining recommendations.

Metrics: ESCI labels: exact, substitute, complement, irrelevant · human ground-truth sample for system performance · LLM-based batch labeling of top health-search product matches · FAISS similarity-score thresholding · model performance monitoring and retraining as needed

3 supporting quotes
“We used an established scheme to tag each offering as exact, substitute, complement, or irrelevant to the keyword.”article, stated
“Using a mix of high-confidence human and LLM-based labels, we established a true ground truth.”article, stated
“Regularly update your health ontology datasets * Monitor model performance and retrain as needed * Keep your product knowledge base current”article, stated

Outcomes

The production system uses AWS services for daily health-related Amazon searches, processing search data at scale with EMR and Athena, scheduled SageMaker jobs for knowledge-base embeddings, Bedrock batch inference for large-scale LLM labeling, and FAISS vector search for healthcare product/service matching.

4 supporting quotes
“This solution is now used daily for health-related search queries, helping customers find everything from prescription medications to primary care services.”article, stated
“Today, customers searching for health solutions on Amazon—whether for acute conditions like acne, strep throat, and fever or chronic conditions”article, stated
“By extending the powerful ecommerce search capabilities of Amazon to address healthcare-specific opportunities, we’ve created additional discovery pathways”article, stated
“By combining these approaches, we’ve created a more intuitive and effective way for customers to discover healthcare offerings on Amazon.”article, stated