Retrieval, Not Recall: An AI Assistant for Pharmaceutical Formulation
Ask a generic AI chatbot a formulation question, and it will answer immediately.
Ask it where that answer came from, and it usually can't tell you.
Ask it to tell a verified regulatory requirement from a plausible-sounding guess, and it often won't even try.
That gap isn't a prompting problem. Language models are built to produce a fluent next word, not to check whether a claim is true. Most of the time, that's fine. In formulation science, where a wrong assumption about an excipient's role or a mismatched dosage table can turn into a real decision, it isn't.
Retrieval-augmented generation was built to close exactly this gap. Instead of asking a model to recall facts from memory, the system retrieves the evidence first and lets the model answer only from what it was just shown. At Alche, we built a RAG-based assistant for pharmaceutical formulation to see how far that idea holds up in a domain that doesn't forgive a vague answer.
One Search Box Can't Cover an Entire Discipline
Most RAG demos search one document collection. Formulation science doesn't fit in one.
A question about excipient compatibility needs formulation references. A question about approval requirements needs regional regulatory guidelines. A question about a reference product needs approved-drug records. Treat all of that as one undifferentiated pile, and the distinctions that matter to the person asking get lost in it.
Before: every query hit the same index and hoped for the best. After: our system keeps separate, domain-scoped sources and routes each query to the right ones first — an agent reads short descriptions of each source and decides what's worth searching before a single result comes back, not after.
A Close Match Isn't the Same as the Right Answer
Dense vector search finds passages that sound like the question. Sounding similar isn't the same as being relevant, and being relevant isn't the same as being sufficient.
After the first retrieval pass, a cross-encoder reranker re-scores every candidate directly against the query, catching what embedding similarity alone gets wrong.
Some sources are long — a full textbook chapter, an entire regulatory guideline. We don't hand the whole thing to the model. The system estimates which portion actually answers the question and trims the context down to that, so the model's attention lands where the answer actually is.
“Which of these five documents did that number actually come from?”
“Is this a real requirement, or does it just sound like one?”
“This dosage table is for a different drug entirely.”
When the Internal Library Isn't Enough
Internal sources are curated, but they're finite, and regulatory positions shift. For questions that need the latest guidance, our system adds a live web search on top of internal retrieval — restricted to a fixed set of trusted regulatory and scientific domains. Results from that search are labeled separately, so it's always clear whether an answer came from our library or from the open web.
Chemistry Doesn't Bend to a Confident-Sounding Sentence
Some formulation questions aren't really about finding a fact — they're about applying a rule correctly. Choosing an excipient depends on physicochemical properties like solubility, partition coefficient, and molecular weight, which determine whether a substance can plausibly act as a filler, binder, disintegrant, surfactant, or glidant. Our system uses those properties to narrow the candidates before generation even starts, instead of letting the model guess at chemistry from text alone.
It also enforces one rule that matters more than it looks: a formulation precedent for one active ingredient cannot be scaled or reused for another, even when the two seem similar. That's not left to the model's judgment — it's a hard constraint. The failure it prevents is a dosage recommendation that sounds reasonable and is chemically wrong.
How We Build This at Alche
We Make Every Claim Provable
Every generated answer has to cite its source down to the page, in a consistent format a machine can check. A citation nobody can verify isn't really a citation. In a regulated domain, an answer nobody can verify isn't really usable.
We'd Rather Say "I Don't Know"
The model only answers when the question is in-domain and the retrieved evidence actually backs up a claim. Outside of that, it says so — it doesn't fill the gap with a fluent guess. A clean refusal counts as the system working, not failing.
We Design for the Whole Conversation
Answers stream token by token instead of arriving all at once. If one model provider goes down mid-conversation, the system fails over to another without losing context, so a temporary outage never interrupts the person asking. Every exchange is saved to a persistent thread, so a conversation can be reviewed later, not just read once and forgotten.
None of these pieces are exotic on their own. Multi-source retrieval, reranking, hybrid search, citation grounding, refusal-first prompting — all established techniques in current RAG research. What's worth sharing is what happens when they're combined deliberately, for a domain where a fluent but ungrounded answer isn't a minor inconvenience. Alche is building this as one example of applying the current state of retrieval-augmented generation to a domain that won't forgive an answer that just sounds right.
