Search for AI for pharmacies and what comes back is dispensing robots and headlines about diagnosis. Neither describes the daily reality of a neighbourhood chemist or a four-to-ten-person pharmacy on a busy avenue. There, the business is decided in three very unglamorous places: the stock you buy, the product that expires in the drawer, and the minutes the pharmacist spends doing things that aren't serving patients.
This guide is about those three. Which parts of that work can realistically be automated today with the data a pharmacy already generates — sales from the dispensing software, order history, dispensations — what each one costs in effort, and where you should stop dead because the data is health data and it doesn't tolerate experiments.
The usual warning first: if nobody in your pharmacy can say within two minutes which ten lines produced the most margin last month and how many euros went in the bin through expiry, the problem isn't AI yet. It's that the software stores that data and nobody looks at it. Fixing that comes first, costs far less, and everything else depends on it.
What is actually broken in a pharmacy before we talk about AI?
Spend a week behind the counter and the same gaps show up:
- Supply shortages nobody sees coming. Partial deliveries from the wholesaler, intermittent supply, an active ingredient that disappears for three weeks. The long-term patient finds out at the counter.
- Seasonal overstock. Cold and flu lines bought in November based on last year's winter, still sitting there in March.
- Expiry discovered too late. Control is a manual drawer check or a quarterly report. Anything expiring in 60 days isn't promoted, it's thrown away.
- Ordering out of habit. You reorder to a minimum somebody set four years ago, without looking at real rotation or at what buying direct from the lab would cost.
- A counter swamped at peak. Forty per cent of the day's footfall arrives between 10 and 1, and the phone rings while there's a queue.
- Professional services that don't get followed up. Dosette boxes, screenings, adherence follow-up: started and abandoned because nobody has time to call the patient.
None of those six is an artificial intelligence problem. They are information-arrives-too-late problems. AI helps because almost all of that information is already written down — every sale, every order, every shortage — and right now nobody reads it systematically.
Which systems do you have to touch in a pharmacy?
Before promising anything, look at where each piece of data comes from and what it costs to get out. In a mid-sized pharmacy the map looks like this:
| Source | What it gives you | Usual problem | |---|---|---| | Dispensing / pharmacy software | Line-by-line sales, stock, margin, expiry dates | Limited export; API only in some products | | Wholesaler orders | What you ordered, what arrived, what was short | Shortage history isn't kept: the most valuable data, routinely lost | | Electronic prescription | Dispensation and dosage | Health data; restricted and logged access | | POS and payments | Basket, time of day, average ticket | Doesn't always reconcile with the sales line | | Catalogues and labs | Prices, terms, promotions, equivalences | A different spreadsheet per sales rep | | Website / click and collect | OTC and beauty, reservations | Lives apart from the real shop stock |
The practical rule: start with what already produces structured data — sales and orders — and leave anything touching electronic prescription for later. The first block is business management; the second is health data and the bar is completely different.
If your software has no decent API, that isn't fatal: a daily export into a small data warehouse covers 80% of what this article describes. The patterns and the traps are the same as in ERP and CRM integration.
How do you automate stock and wholesaler ordering?
This is the best effort-to-result case, and the one almost no pharmacy exploits.
A pharmacy handles between 4,000 and 10,000 active lines with radically different behaviour: the chronic medication dispensed every month like clockwork, seasonal OTC lines, the antibiotic that moves in spikes, and the reference you sell three times a year. Treating them all with one min-max rule guarantees you overstock some and run out of others.
What you can build with 18 to 24 months of sales:
- Classification by rotation and variability. Separate the predictable (chronic medication) from the erratic (acute, seasonal) before calculating anything. This is inventory optimisation applied to a small warehouse with a lot of lines.
- Safety stock per line, not per category. A fast-moving chronic line with stable wholesaler service needs very little; one that suffers recurring shortages needs cover — and that decision comes out of your shortage history, not the catalogue.
- Seasonal forecasting. Cold and flu, allergy, sun care and insect repellent have a clear annual pattern, and two or three years of history is enough to sharpen the buy. The mechanics are those of demand forecasting, with one nuance: here external signals (pollen, temperature, published flu incidence) genuinely add value.
- Early warning of likely shortages. When a line is part-filled on two consecutive orders, that's the early signal. Warning the chronic patient before they reach the counter is the kind of detail that builds loyalty better than any promotion.
And one money point that isn't AI but almost nobody checks: compare what you buy from the wholesaler against what you could buy direct from the lab at volume, line by line. It's a well-built spreadsheet, and it often pays for the whole project before the modelling even starts.
In a pharmacy, AI doesn't start by predicting illness. It starts by getting you to stop buying badly.
What can you do about expiry dates and shrinkage?
Expired stock is money you already paid for and are about to throw away. Most of it is caught late because the control is manual and quarterly.
With stock and rotation in the same place, the calculation is close to arithmetic: for each batch, days of cover at the current sales rate versus days until expiry. If cover exceeds the expiry window, that unit will not sell. That produces a short, actionable weekly list:
1. Rotate before it hurts. Return to the wholesaler if the terms allow, promote it at the counter, or move it to another branch if you have one. 2. Fix the buying. The same line expiring every year is telling you the minimum is wrong. The value isn't in the rescue promotion; it's in never buying it that way again. 3. Separate what cannot be promoted. A prescription medicine is not a face cream. The list has to distinguish OTC from everything else, and the system must know that before it proposes anything.
Do you need AI for this? Not for the base calculation: you need the data in one place and somebody who looks at the list on Monday. The model adds value on the layer above — estimating future sales of that specific line in that specific pharmacy — and in spotting shrinkage that isn't expiry: mismatches between what came in, what sold and what's left. That second part is classic anomaly detection, the same logic as fraud detection, and what turns up is almost never theft: it's a goods-in procedure nobody follows the same way twice.
What does AI add at the counter and in patient service?
Here the boundary needs to be stated plainly: pharmaceutical advice is not automated. What gets automated is everything that stops you giving it.
What works today:
- The phone at peak hours. "Have you got this in?" and "is my order here yet?" eat the counter shift. An assistant that checks availability and order status, and transfers anything else to a person, frees up real time. The limits of this technology — latency, handover, what it can and can't take — are in AI voice agents.
- Out-of-hours orders and reservations. A web or WhatsApp channel where the patient leaves an order and gets a message when it arrives. That's logistics, not clinical advice, and it's where the quick return is. What that channel can and can't do is in WhatsApp chatbots for business.
- Internal search over datasheets and protocols. Interactions, dosage, storage conditions, professional body protocols. A search assistant over your own documentation that cites the source and shows the exact paragraph saves the team minutes a day, and the pharmacist checks it. The right architecture is RAG: retrieve and cite, never generate from memory. How to evaluate whether it answers well is in internal document search.
- Service reminders. The next dosette box, the chronic prescription renewal, the screening follow-up. Simple, cheap, and the thing that keeps professional services alive past week three.
What should not be done, however it's sold:
- An assistant answering patients' health questions unsupervised. A wrong piece of advice is paid for by a person, and professional liability isn't delegated to a software vendor.
- Recommending products by cross-referencing dispensation data with no legal basis. Technically trivial, legally another matter.
- Replacing pharmacist validation at dispensing. The system flags and ranks; the pharmacist decides and signs.
Where is the limit with health data?
This is what separates a pharmacy from any other retail business, and it has to be written down before, not after.
What a pharmacy dispenses reveals the health status of an identified person. That makes it a special category of data under GDPR, with a far stricter regime than a supermarket receipt. The practical consequences:
- Stock management doesn't need to know who bought what. To forecast demand, calculate cover and place the order, aggregates by line and date are enough. If the use case works on aggregated data, don't put the patient identifier in it. That's the minimisation rule, and it also makes the project simpler. The concrete techniques are in data anonymisation.
- Patient services do require a legal basis and clear information. Adherence, dosette boxes, follow-up: that is personal health data, and you need to know on what basis it's processed, how long it's kept and who can access it.
- Watch where processing happens. Sending text containing health data to an external service with no processor agreement and no idea where it's handled is the most common mistake and the easiest to avoid.
- Access traceability. Who looked at what, and when. If you can't answer that, the system isn't ready to touch electronic prescription.
None of this is exotic, and it doesn't block 80% of the cases in this article, because 80% is business management and never touches the patient. The essentials are in GDPR and AI, and the full clinical criterion is covered in AI for clinics.
Where should a pharmacy start?
A realistic order by effort-to-result:
| Order | Project | Data it needs | Sign it's your turn | |---|---|---|---| | 1 | Rotation and margin dashboard | 12-24 months of sales | Nobody knows which ten lines carry the margin | | 2 | Weekly expiry list by cover | Stock with batch and expiry | Product written off every quarter | | 3 | Ordering assisted by real rotation | Sales + shortage history | Overstock and stockouts at the same time | | 4 | Out-of-hours orders and alerts | Web or WhatsApp | Orders written on paper | | 5 | Seasonal forecasting | 2-3 years of sales | Campaign buying by eye | | 6 | Search assistant over datasheets and protocols | Your documentation, organised | The team looks up the same thing daily | | 7 | Patient service follow-up | Health data with a legal basis | Services that start and fade |
No item on that list begins with buying a tool. They all begin with deciding which decision changes and who makes it. If the owner isn't going to read the expiry list on Monday, the list is pointless — exactly what we explain in change management.
One note on proportion: if you're a two-person pharmacy with 3,000 lines, only items 1, 2 and 4 are worth it — and all three run on data you already have. The sizing criterion is in AI for SMEs.
Frequently asked questions
Is this any use if my pharmacy software is closed and has no API?
Yes, with more work. If it can export sales, stock and orders to CSV, a daily export covers nearly everything in this article. What you won't be able to do is write back: a person still validates the order until the vendor opens up an integration.
How much history do you need to forecast demand for a line?
For stable rotation, 12 months gives a usable forecast; for seasonal campaigns you need two or three years, because the pattern is annual and one cycle can't separate trend from coincidence. More important than volume is that wholesaler shortages are recorded: without them, the model confuses "it didn't sell" with "there wasn't any".
Can I use electronic prescription data to improve purchasing?
For purchasing you don't need to: aggregated dispensation by line and date is enough, with nobody identified. If the use case genuinely needs the patient — adherence, dosette boxes, follow-up — then you're processing health data, and that requires a legal basis, clear information, access control and a proper processor agreement.
Can an assistant give pharmaceutical advice to patients?
No, and it's a line worth not crossing. An assistant can handle opening hours, availability and order status, and it can help the team locate a datasheet while citing the source. Clinical advice comes from a pharmacist, because that's who answers for it.
---
If you run a pharmacy, have two years of sales sitting in your dispensing software and the feeling that there's money in there nobody is looking at, the first step isn't an AI pilot: it's seeing what you can answer today with what you already have, and what's missing for the next step. That's exactly what we look at in the audit, and if you'd rather talk it through in half an hour, let's talk.
Shall we apply it to your case?
The 360° AI Audit turns these ideas into a concrete plan for your company: three weeks, fixed price and the full picture of your AI before spending a euro.
See the 360° Audit→ Let's talk↗