Building Agentic RAG for a Regulated Industry

Notes from building the agentic RAG system behind ZaynichOne, a drug information assistant for a pharmaceutical company.

Jul 14, 20266 min read

The Constraint That Shapes Everything

Most RAG systems are judged on how helpful they feel. ZaynichOne, the agentic RAG system I built for Wockhardt, is judged on whether it is ever wrong about a drug. That single constraint changes almost every design decision, from how documents get ingested to how confident the system is allowed to sound.

A chatbot that occasionally hallucinates a product recommendation is a bad user experience. A chatbot that occasionally hallucinates a dosage is a different kind of problem entirely.

Grounding Over Generating

The ingestion pipeline does most of the real work. Every answer has to trace back to an approved source document, not to the model's general knowledge. That meant treating retrieval quality, not prompt engineering, as the main lever for accuracy.

The agentic layer sits on top of retrieval: it decides when it has enough grounded information to answer, when to narrow the question, and when to say it does not know rather than guess.

Privacy Is Part of the Architecture

In a regulated pharma setting, data handling is not a compliance checkbox added at the end, it has to be part of the system design from the first pipeline. That shaped how documents are stored, how queries are logged, and what the model is allowed to see at all.

The lesson I keep relearning: in regulated domains, the interesting engineering problem is not making the model smarter, it is making the system trustworthy enough that being smart matters.