Deployment of Medical Semantic Search with Lightweight MLOps

Lightweight and reproducible medical semantic search solution: normalization with Azure OpenAI, versioned embeddings, and vector search in Quadrant for SNOMED CT, LOINC, and RxNorm.

domingo, 17 de agosto de 2025 • 4 min read • Q2BSTUDIO Team

Artificial-Intelligence-

Client profile The client is a professional healthcare technology provider whose platform is used by multiple medical institutions to support workflows with clinical data. The project focused on enabling fast and reliable semantic search over standardized medical terminologies so that healthcare teams can extract structured meaning from free text.

Challenges The project faced several critical challenges: a manual embedding pipeline that relied on Drive transfers and manual file placement, which slowed down updates and broke reproducibility; fragmented infrastructure that prevented the ML team from controlling the behavior of the entire system; unstructured clinical input and output with abbreviated notes and lengthy descriptions that made parsing difficult; semantic quality control bottlenecks that required manual validation by experts; and a scalability shift when exceeding available RAM, forcing migration to on-disk indexes.

Solution To provide reliable semantic matching from unstructured clinical inputs, we implemented a modular and lightweight ML integration pipeline that includes LLM models hosted on Azure for real-time normalization, offline embedding generation for control and versioning, a containerized Quadrant vector database for high-speed local searches, and a containerized REST API that separates ML logic from the application core. Embedding sets are packaged as versioned files for reproducible deployments, and the solution follows MLOps and DevOps principles to ensure version governance, observability, and operational stability.

Key components Azure OpenAI models such as GPT-4 are used to transform free text into structured representations without the need for local labeling. Embeddings are generated locally with an embedding model and organized by terminology into versioned collections. Quadrant runs as a container that exposes vector similarity search via REST. A containerized Flask service offers a simple endpoint to receive free text and return standardized concepts with codes, labels, and confidence scores. Deployment is controlled by packaged embedding versions and orchestrated with per-environment configuration files for DEV and PROD.

Service features Real-time semantic normalization through a single endpoint that accepts free-text clinical input, normalizes it with an LLM, and performs vector search against versioned medical collections. Support for multiple terminologies such as SNOMED CT, LOINC, and RxNorm with independent, versioned collections. An operational introspection endpoint that exposes loaded collection versions and LLM configurations to facilitate verification by QA teams. Human-in-the-loop validation based on a reference set with ground truth mappings to partially automate QA without eliminating expert oversight.

Development process Embedding preparation: each terminology is processed locally from CSV or JSON to generate dense vectors per concept, including labels and synonyms; embeddings are generated in batches respecting API limits and packaged by version. Versioning and transfer: versioned collections are stored in a shared repository and deployed through pipelines that update the containerized stack. Environment configuration: each VM has a local volume mounted at /mnt/data/collections for the collections, and the Docker Compose stack defines the Flask and Quadrant containers with environment-specific configuration via .env files. LLM configuration: Azure OpenAI endpoints are accessed via SDK or REST with keys in environment variables and rate limit handling with exponential backoff and jitter. Query processing: an end-to-end flow where text reaches the search endpoint, is normalized with the LLM, a local embedding is generated for the query, and a similarity search is performed in Quadrant, returning ranked results with codes, labels, and scores. Logging and monitoring: structured logs from reception to delivery, including prompts, responses, retries, and duration metrics sent to Graylog for traceability. QA and validation: automated tests for embedding integrity, index loading, and scoring behavior, complemented by curated clinical tests and expert review before promoting changes to production.

Impact Scalable semantic search supporting multiple medical collections with hundreds of thousands to millions of terms. Search latencies below 1 second even after migrating to on-disk indexes due to RAM constraints. Lightweight infrastructure running on a small set of containers, with the ML component isolated for easier maintenance and independent scaling. Human-in-the-loop validation with curated test sets that reduces the need for constant manual reviews. LLM integration via Azure OpenAI enables adaptability without local training and resilience to rate limits through retry logic.

About Q2BSTUDIO Q2BSTUDIO is a software development company specialized in custom applications and bespoke software for clients in critical sectors. We are specialists in artificial intelligence and cybersecurity and offer AWS and Azure cloud services, business intelligence services, artificial intelligence solutions for companies, AI agents, and Power BI consulting. Our approach combines solid MLOps and DevOps practices to deliver reproducible, secure, and operational solutions in production. From LLM model integration to the implementation of versioned embedding pipelines and containerized deployments, Q2BSTUDIO brings technical and methodological expertise to transform clinical and business use cases into scalable products.

Services and keywords We offer custom applications and bespoke software oriented to real business value, artificial intelligence consulting, AI solutions for companies, AI agent integration, AWS and Azure cloud services, advanced analytics, and Power BI for visualization and reporting. We also provide cybersecurity and compliance services for cloud and on-premise environments, ensuring that artificial intelligence solutions and business intelligence services are deployed with observability, traceability, and version control.

Conclusion The implementation of a lightweight medical semantic search aligned with MLOps practices allows mapping free text to standardized clinical concepts with high precision and speed, reducing dependence on manual reviews and facilitating reproducible deployment across environments. Q2BSTUDIO supports healthcare organizations and companies throughout the entire development and implementation cycle, offering tailored solutions that combine artificial intelligence, cybersecurity, and AWS and Azure cloud services to maximize impact and minimize risk.

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.