An Algorithmic Framework for Hybrid Retrieval and LLM-Based Filtering in Pharmaceutical Semantic Catalogue Search

Pharmaceutical wholesalers manage vast catalogues spanning dozens of distributors and heterogeneous nomenclatures, where Customer Service Representatives (CSRs) in call centers must identify products from semantically ambiguous natural language queries, a task at which keyword-based retrieval underperforms. This paper presents the algorithmic design and production evaluation of an intelligent product catalogue assistant deployed at Bidafarma, a Spanish pharmaceutical wholesaler. The system implements a three-path query routing algorithm and an enhanced six-stage search flow algorithm that combine Elasticsearch’s multi-field retrieval with Large Language Model (LLM)-Based Filtering across three product categories and more than 30 distributors. Its central design principle is selective LLM invocation: the Routing Classifier bypasses the LLM for product ID and product name queries, reserving it for the semantically complex path. Additionally, we introduce an indexing mechanism for false positives, based on Hierarchical Navigable Small World approximate nearest-neighbor search, that incrementally updates from CSR feedback and provides continuous precision improvement without model retraining. Evaluated on 14,997 production queries gathered between November 2024 and July 2026, the system achieves 99% accuracy and an average end-to-end response time of 2.57 s, with 99% of queries served within a 15 s operational threshold (p95 = 7.4 s). A component-level analysis shows that the routing policy, which invokes the LLM on only 35% of queries, is the principal driver of this low latency, and that the LLM-Based Filtering removes 24% of the lexical-retrieval candidates. These results validate the proposed algorithmic framework as an effective and low-latency solution for semantic product search in knowledge-intensive business-to-business service operations.

Authors

Institutions

Publication Details

Journal
Algorithms
Published
2026-11-09
DOI
https://doi.org/10.3390/a19110977
Primary Topic
Information Retrieval and Search Behavior
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

An Algorithmic Framework for Hybrid Retrieval and LLM-Based Filtering in Pharmaceutical Semantic Catalogue Search

Manuel A. Sánchez-Montañés, Francisco Nanclares, Antonio Cernadas, Ignacio Gutiérrez-Peña
Algorithms
Information Retrieval and Search Behavior
article

An Algorithmic Framework for Hybrid Retrieval and LLM-Based Filtering in Pharmaceutical Semantic Catalogue Search

Manuel A. Sánchez-Montañés, Francisco Nanclares, Antonio Cernadas, Ignacio Gutiérrez-Peña
article en

Abstract

Pharmaceutical wholesalers manage vast catalogues spanning dozens of distributors and heterogeneous nomenclatures, where Customer Service Representatives (CSRs) in call centers must identify products from semantically ambiguous natural language queries, a task at which keyword-based retrieval underperforms. This paper presents the algorithmic design and production evaluation of an intelligent product catalogue assistant deployed at Bidafarma, a Spanish pharmaceutical wholesaler. The system implements a three-path query routing algorithm and an enhanced six-stage search flow algorithm that combine Elasticsearch’s multi-field retrieval with Large Language Model (LLM)-Based Filtering across three product categories and more than 30 distributors. Its central design principle is selective LLM invocation: the Routing Classifier bypasses the LLM for product ID and product name queries, reserving it for the semantically complex path. Additionally, we introduce an indexing mechanism for false positives, based on Hierarchical Navigable Small World approximate nearest-neighbor search, that incrementally updates from CSR feedback and provides continuous precision improvement without model retraining. Evaluated on 14,997 production queries gathered between November 2024 and July 2026, the system achieves 99% accuracy and an average end-to-end response time of 2.57 s, with 99% of queries served within a 15 s operational threshold (p95 = 7.4 s). A component-level analysis shows that the routing policy, which invokes the LLM on only 35% of queries, is the principal driver of this low latency, and that the LLM-Based Filtering removes 24% of the lexical-retrieval candidates. These results validate the proposed algorithmic framework as an effective and low-latency solution for semantic product search in knowledge-intensive business-to-business service operations.

AlgorithmsVol. 19(11)
Universidad Autónoma de Madrid (ES)
Information Retrieval and Search Behavior
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon