AI for Pharmacies: Stock and Customer Questions Without Medicine Advice

AI for Pharmacies: Stock and Customer Questions Without Medicine Advice

An AI agent for pharmacies can answer stock, price and opening hours questions, then hand every health question to the pharmacist with a clear summary.

•

Want to apply this in your company?

Book a call with Juan →

An AI agent in a pharmacy can answer with confidence the questions that verifiable data settles: whether a product is in stock, the current price, which branch has it available, and when the store is open. Questions that call for a health assessment, such as which medicine to take, dosage, drug interactions, or whether a symptom needs medical care, should go to the responsible pharmacist. The line between these two types has to be drawn before the first conversation, not after the first mistake.

A note on the term: what a pharmacy runs today is not superintelligence in the literal sense. It is an AI agent with defined rules, defined data sources and a clear handoff to people. That is the scope of this article.

Key takeaways

  • Stock, price and opening hours are lookup questions. The agent answers from up-to-date data and, when the data is stale, it should not guess.
  • Indication, dosage, interaction and symptom triage are health decisions. The agent does not make them, even when the answer seems obvious.
  • The handoff to the pharmacist must be fast and come with a summary of the conversation, so the customer does not have to repeat the story.
  • Health data is sensitive under Brazil's data protection law (LGPD), so the agent should collect only what it needs and keep records with discipline.
  • The first version should cover a few question types, log every handoff, and agree on a success measure before it grows.

What the agent answers on its own: stock, price and hours

These are questions with a source of truth. The agent checks the branch stock system or a daily export, reports availability per branch, the current list price and the opening hours. If the counter has a reservation process, the agent can also offer to hold the product.

The detail most often overlooked is the age of the information. It is not enough for the agent to have access to stock. It needs to know when that stock was last updated. If the sync is older than the window the team agreed on, the correct answer is that the agent cannot confirm availability at this moment, and it should offer a check by a person. It also helps to use the same price source the cash register uses. If the website shows one price and the shelf shows another, the problem is not the agent, but the conversation will look like the agent's mistake.

Where health guidance begins

Customers rarely ask only about a product. A question like "do you have anything for a cough?" already carries a health intent, and the answer should follow one simple principle: the agent does not choose a product based on the condition of the person asking.

Reading out what is printed on the package or in the leaflet is different from recommending. Even so, public product descriptions should not be used to suggest a product in response to a reported symptom. In those cases, the agent tells the customer that a product of that kind is available, explains that the choice depends on an assessment, and transfers the conversation. Prescription medicines follow the same logic. The agent can state that a product requires a prescription and ask the customer to bring it, but it does not decide whether a prescription is needed for a particular case.

The responsibility rule also has to be clear to the team. The pharmacy is accountable for the channel it operates, and technical responsibility for pharmaceutical guidance stays with the licensed professional. For that reason, the agent's scope is a management decision, validated by the responsible pharmacist, and not a configuration detail.

Decision guide: answer, hand off or decline

Before any flow goes live, the team should complete a guide like this one, using real questions from the past few weeks of customer contact:

  • Availability, price, branch or hours backed by current data: answer, and offer a reservation if one exists.
  • Products unrelated to symptoms, such as diapers, brushes or hygiene items: state what the catalogue record says.
  • Medicine that requires a prescription or special control: state the requirement, do not recommend, and hand off to the pharmacist.
  • Reported symptoms, pregnancy, a young child, an older person, use of several medicines, or a suspected interaction: hand off to the pharmacist immediately.
  • Signs of urgency, such as severe pain, shortness of breath or bleeding: advise the customer to seek emergency care right away and stop the sales conversation.
  • A request to swap for a cheaper equivalent, or to confirm whether two medicines can be taken together: do not decide, hand off.
  • Any message the agent cannot classify with confidence: treat it as a handoff.

This guide is not final. It is the starting point for testing and for the weekly review of the pilot.

Illustrative scenario: the same conversation, two different paths

Illustrative scenario: a customer writes on WhatsApp asking whether the pharmacy has a cough syrup and whether she can give it to her young son. The agent checks stock, confirms the product is available in two branches, and does not answer questions about use in children. It explains that guidance on age and dose will come from the pharmacist, asks whether she wants the conversation transferred now, and sends the counter a summary: the product she is looking for, the fact that it is for a young child, and that she did not describe symptoms in detail. The summary includes no diagnosis, and the pharmacist answers from there.

Another path, also illustrative: a customer asks whether the store has stock of an anti-inflammatory he bought last week. The agent checks stock, reports availability, and notes that the product requires a prescription for sale. There is no clinical handoff, only an objective answer. The difference between the two scenarios is the type of question, not how complicated the conversation is.

Health data, LGPD and what not to store

Health-related data is sensitive data under the LGPD, and that changes how the agent should be designed. The practical rule is to collect the minimum needed to answer the question, avoid letting free-text symptom descriptions become permanent fields in the CRM, and define who can see conversation history and how long it is kept. The Brazilian data protection authority, ANPD, publishes guidance on these points and is the reference to follow.

If the language model or any supporting tool is processed outside Brazil, the international transfer analysis must be part of the scope. This point is covered in more detail in international data transfer under LGPD when using AI.

Conversational agents also carry a security risk of their own. A customer, or a text pasted into the chat, may try to make the agent ignore its rules. For that reason, the handoff rules should not depend only on the prompt text. They need to be enforced by the flow itself, with a list of blocked topics and an automatic transfer when a conversation falls into them. The OWASP guidance on prompt injection prevention describes this kind of control.

How to run it without improvising

The method we apply in AI agent projects has four steps: map the current process, limit data and actions, pilot a real flow with logs and an agreed success measure, and then hand the operation over and decide whether to expand, adjust or stop. In a pharmacy, the sequence looks like this:

  • Map the questions that arrive today, by channel and by time of day, and which of them turn into a phone call or a visit to the counter.
  • Define the source of truth for stock and price, and the maximum acceptable data delay before the agent says it cannot confirm availability.
  • Write the list of blocked topics and the standard handoff message, approved by the responsible pharmacist.
  • Test with simulated conversations before opening to the public, including ambiguous questions, messages with typing errors, and attempts to get around the rules. The approach to testing agents with mocks and a sandbox helps build these cases without risk to real customers.
  • Pilot a single flow, for example stock and hours at one branch, with a record of every answer and every handoff.
  • Review the operation with the team: refused questions, handoffs that never got a reply, and differences between the stock the agent reported and the real stock. Only then decide whether the scope grows.

The split between what to automate and what to keep with people follows the same logic as customer service in general, as we describe in AI customer support: what to automate and what to keep human.

Frequently asked questions

Can an AI agent tell a customer which medicine to take for a symptom?

No. Recommending a medicine based on a reported symptom is a health decision. The agent can say that a product of that type exists in the store, explain that the choice depends on a pharmacist's assessment, and transfer the conversation with a summary.

What should the agent say when the stock data is out of date?

It should say that it cannot confirm availability at that moment and offer a check by a person or a callback. Giving a confident answer from stale data is the error most likely to damage trust.

Is chat data from pharmacy customers covered by the LGPD?

Yes, when it relates to health. Symptom descriptions and health details are sensitive data, so the team should collect only what is needed, limit who can access the history, and set a retention period that is documented and followed.

Do we need the pharmacist to approve the agent's rules?

Yes. The scope of what the agent answers and what it hands off is a clinical and management decision. The responsible pharmacist should approve the blocked topics and the handoff wording before launch, and review them during the pilot.

Where should a pharmacy start with an AI agent?

Start with one narrow flow, such as stock and opening hours at a single branch. Log every answer and every handoff, review the results with the team each week, and expand only after the process is stable.

Sources