All articles
Service
AI by industry7 min

Pharmacy chains: answering stock and substitute questions with AI — and where it must hand over to a pharmacist

A pharmacy chain's chat receives the same messages all day: “do you have this medicine?”, “which branch?”, “if not, what can I take instead?”. The pharmacist answers between customers at the till, often an hour late, and by then the customer has gone next door. An AI agent can genuinely take over half of these conversations. The other half are questions where a mistake costs someone's health rather than a sale, and there the agent's job is not to answer but to hand the conversation to a person. This article shows how to draw that line: what data the agent needs, how it looks up substitutes and why it never recommends them itself, the phrases that must route a chat straight to a pharmacist, and a staged rollout plan.

What pharmacy chat traffic actually looks like

Export a month of messages from your messaging channels and sort them by type. You will usually see five groups (check the proportions on your own data — they vary a lot):

  • Stock and location. “Do you have X?”, “which branch?”, “what time do you close?”. The answer sits entirely in your inventory system.
  • Holds and delivery. “Can you keep it until tonight?”, “do you deliver?”. A process, not a consultation.
  • Substitutes. “Y is out of stock — what has the same ingredient?”. This is where the boundary starts.
  • Treatment questions. “Is it safe for a child?”, “what should I take for blood pressure?”. Pharmacist or doctor territory.
  • Complaints. Wrong item, expired product, returns. A manager's job.

Table: what AI does, what stays with people

ProcessWhat the AI agent doesWhat stays with a person
Stock checkMatches the product even with typos or from a photo of the pack, shows stock by branchNothing, as long as inventory data is current
Nearest branchAsks for area or location, gives address, hours and where the item is in stock—
HoldCreates a hold in the inventory system, states how long it is kept, sends a reminderBranch staff set the order aside
Same-ingredient substituteSearches the catalogue for the same generic name, strength and dosage form, checks stockThe pharmacist confirms and communicates the substitution
Prescription-only medicineStates that a prescription is required and where the item is availableChecking the prescription and dispensing — in the branch only
Dosage, contraindications, children, pregnancyDoes not answer on substance; forwards the question to a pharmacistThe pharmacist advises or refers to a doctor
Warning symptomsImmediately advises seeking emergency care, alerts the on-duty pharmacistThe on-duty pharmacist follows up
Complaint or returnRecords receipt number, branch, issue and photosA manager decides under chain policy

Stock: the agent only says what it sees in the system

The classic mistake is handing the model a price-list file and asking it to “answer about availability”. A day later the stock has changed and the agent confidently promises something that is not on the shelf. The right design: the agent never memorises stock — it queries the inventory system on every question. We covered the integration pattern in detail in our article on an AI agent connected to 1C for stock, orders and statuses; the same principle applies to pharmacies.

Pharmacy-specific details that matter:

  1. Fuzzy name matching. People type brand names by ear, in Latin or Cyrillic script, sometimes in several languages. The agent must map spelling variants to one product and, if several match, ask: “Tablets 200 mg or the children's suspension?”
  2. Form and strength are mandatory. “Yes, we have paracetamol” without the dosage form is a useless answer.
  3. Low-stock threshold. If a branch has one pack left, offer a hold rather than sending someone across town on a “yes”.
  4. Data freshness. If a branch's figures are older than your threshold, the agent says so: “As of 2 pm there were two packs — shall I hold one?”

Substitutes: the agent finds, the pharmacist recommends

“What can I take instead?” looks like a catalogue lookup, and technically it is one: same international non-proprietary name, same strength, same dosage form. But “take this one” is a treatment recommendation. Even with an identical active ingredient, excipients and administration can differ, and the individual may have an allergy or be on other medication. So the split is:

  • the agent finds candidates strictly by generic name, strength and form — never “similar-acting” products;
  • it checks where they are in stock;
  • it sends the pharmacist a ready-made card: what was requested, what was found, where it is;
  • the pharmacist confirms or corrects with one message.

Sample conversation

Customer: Hi, I need X 500 mg, the branch near me is out.

Agent: Hello! X 500 mg tablets are in stock at two other branches right now. Would you like me to hold a pack at one of them?

Customer: Too far. Is there anything equivalent at my branch?

Agent: Your branch has a product with the same active ingredient and strength. A pharmacist needs to confirm the substitution — I've passed your question on and they will reply here. Are you currently taking any other medicines? That will help them answer faster.

Notice what the agent does not do: it does not name the substitute as advice or say “it's the same thing”.

Handoff rules: phrases that bring in a human

Handoff must not be left to the model's discretion. It is a separate trigger list checked before the agent drafts any reply. If one trigger fires, the agent does not answer on substance:

  • dosage and regimen — “how many”, “can I take two”, “for how long”;
  • special groups — children, infants, pregnancy, breastfeeding, elderly people;
  • interactions — with other medicines, alcohol, chronic conditions;
  • symptoms instead of a product name — “what should I take for…”;
  • red flags — chest pain, difficulty breathing, fainting, severe allergic reaction, poisoning. The first message advises calling emergency services; only then is the chat routed to the on-duty pharmacist;
  • prescription-only items — “can I get it without a prescription?” has one answer: prescription only, in the branch. Rules differ by country and change (Uzbekistan, for instance, is moving to electronic prescriptions), so the agent never interprets them;
  • complaints and returns.

The pharmacist receives a card with the original question, what has been clarified and the nearest branch. Who should own that queue is covered in our piece on the AI agent operator role.

Pre-launch checklist and rollout

  1. Every catalogue item has a generic name, dosage form, strength and a prescription-only flag.
  2. The agent reads stock via the inventory API, not a file.
  3. The handoff trigger list is signed off by the chain's responsible pharmacist.
  4. Daytime and night-time handoff owners are defined; if nobody is on at night, the agent says so.
  5. Emergency wording is pre-written, not generated.
  6. Conversation logs are kept, and health data does not flow into systems that do not need it.

Roll out in three stages: first stock and locations only, then holds, then substitute lookup for pharmacists — measuring how many cards the pharmacist accepts without edits. Move to the next stage only after the previous one has run without incidents. See how such agents are built on our AI agents page, and more sector breakdowns in Industries.

FAQ

If we train the agent on package leaflets, can it give advice?

Knowing the leaflet is not the same as advising a specific person: the agent cannot see their history and carries no professional responsibility. Leaflets help it recognise the question and route it with the right label.

What if no pharmacist is available at night?

The agent says honestly that advice will come in the morning and lists any 24-hour branches. For red-flag symptoms it advises emergency care without trying to help on its own.

How much does it cost?

It depends on the number of branches and the state of your catalogue and inventory system. The first conversation is for looking at your data and scoping the work — get in touch.

Subscribe to AI Insights

Case studies, tips and AI automation trends — weekly

Want similar results?

Get a free consultation and ROI calculation for your company

Free Consultation

Related Articles

Automation

Driving Schools: How AI Handles Lesson Booking, Exam Reminders and Instructor Handovers Without Losing a Student's History

A student file that survives an instructor change, exam-date reminders and lesson booking without double-booked cars — what an AI agent can own and what it can't.

Automation

Courier Services: Delivery Status and Rescheduling Without a Call to the Dispatcher

A look at how an AI agent closes the two most common courier-service requests — status and rescheduling — and why answer accuracy depends on how couriers mark steps in the app, not on the AI.

Automation

Apartment Renovation: How AI Handles Site-Visit Requests and Drafts a Preliminary Estimate Range From Chat

From "how much would a renovation cost" in DMs to a booked site visit: what AI should gather about the apartment, how it drafts a preliminary estimate range, and where it must stop short of quoting a final price.

Service

Call Centers: AI on the First Line of the Phone — Which Calls It Can Close and Which Must Go Straight to an Agent

A voice AI can take repetitive calls off your agents, but only if you decide in advance when it steps aside. Call types, handoff triggers and a rollout plan.

Sales

IT Outsourcing: How AI Qualifies Inbound Requests from Foreign Clients Before a Manager Sees Them

Inbound requests from foreign clients hit a dev studio at all hours and vary wildly in quality. Here is what AI can clarify on its own, and what it must hand to a manager untouched.

Sales

Textile and Garment Manufacturing: How AI Handles a Foreign Buyer's Chat — From Sample Request to a B2B Order

We break down the inbound "send me a sample" message from a foreign buyer: separating a real B2B order from one-off curiosity, the fabric and sizing questions to ask, and why sample lead time isn't bulk lead time.

Pharmacy chain AI: stock, substitutes, pharmacist handoff | UNIKA