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
| Process | What the AI agent does | What stays with a person |
|---|---|---|
| Stock check | Matches the product even with typos or from a photo of the pack, shows stock by branch | Nothing, as long as inventory data is current |
| Nearest branch | Asks for area or location, gives address, hours and where the item is in stock | — |
| Hold | Creates a hold in the inventory system, states how long it is kept, sends a reminder | Branch staff set the order aside |
| Same-ingredient substitute | Searches the catalogue for the same generic name, strength and dosage form, checks stock | The pharmacist confirms and communicates the substitution |
| Prescription-only medicine | States that a prescription is required and where the item is available | Checking the prescription and dispensing — in the branch only |
| Dosage, contraindications, children, pregnancy | Does not answer on substance; forwards the question to a pharmacist | The pharmacist advises or refers to a doctor |
| Warning symptoms | Immediately advises seeking emergency care, alerts the on-duty pharmacist | The on-duty pharmacist follows up |
| Complaint or return | Records receipt number, branch, issue and photos | A 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:
- 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?”
- Form and strength are mandatory. “Yes, we have paracetamol” without the dosage form is a useless answer.
- Low-stock threshold. If a branch has one pack left, offer a hold rather than sending someone across town on a “yes”.
- 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
- Every catalogue item has a generic name, dosage form, strength and a prescription-only flag.
- The agent reads stock via the inventory API, not a file.
- The handoff trigger list is signed off by the chain's responsible pharmacist.
- Daytime and night-time handoff owners are defined; if nobody is on at night, the agent says so.
- Emergency wording is pre-written, not generated.
- 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.