What If You Could Ask Pharma Documents Anything And Trace Every Answer?
How Graphwise helped a global Pharma company turn unstructured CMC documentation into a knowledge graph that teams can question in plain language, with answers traced back to their sources.
Main Takeaways
- CMC knowledge exists, but it’s locked in documents. Pharma records hold how every medicine is made and tested. With the right semantic layer, that knowledge can be unlocked, and this post shows how.
- The vocabulary has to come from the company’s documents. General life science vocabularies proved too broad, so Graphwise built a taxonomy from the documents’ own wording.
- Answers point back to their sources. Sectioned, tagged documents in a knowledge graph stored in GraphDB let teams ask plain-language questions and check answers against the exact sections behind them.
- You don’t need a complete model to start. We started from a focused set of questions and documents that were already in place which delivered results without building a full CMC model first.
Imagine a development team preparing a Pharmaceutical product for its next Stage Gate review. The decision-makers will ask a simple question:
“Which CMC processes are there for that particular drug product, and what is the status of those processes through their lifecycle?”
The answer exists in the company’s documents, but getting to it means searching a library built up over years. The process involves searching and finding the right sections, piecing the picture together, and keeping track of where each piece came from. In Pharma, that last part matters most, because an answer without a source is as good as a guess.
This post shows how Graphwise helped a global Pharma company make that easier so staff could ask questions in plain English and get traceable answers straight from its documents.
Some background information
Note: If you work in Pharma and know this problem well, skip to the next section.
Pharma companies are required to record, in detail, how every medicine is developed, made, and tested. Most records are unstructured, long documents organized into sections, written by different teams over years, and stored in systems built for filing and approval rather than for answering questions.
Many teams depend on them. CMC specialists write much of them and are usually the ones asked to find answers in them. Development teams use them to prepare Stage Gate reviews. Data governance and quality teams need every answer traced to a source. Knowledge management teams try to connect them to the formal models they maintain of products, processes, and development stages.
For all of them, knowledge exists, and the problem is getting it out.
Why CMC documentation is important
The most important of these records is CMC documentation, short for Chemistry, Manufacturing, and Controls. It describes what a medicine is, how it’s made, and how the company makes sure every batch comes out the same. Regulators such as the FDA and the EMA require it.
CMC records document and justify each part of the process for review. They grow with the product, from early lab work through clinical trials to full-scale production, with many scientists and teams contributing along the way.
CMC is paramount for the Stage Gate process, which splits development into sequential stages separated by decision gates. At each gate, reviewers need a cross-document view, which means every process for a product, its current stage, and the evidence behind it. The documents hold all of that, but none of them is organized to deliver it.
What goes wrong and why
Take the initial question from the project:
“Which CMC processes are there for that particular drug product, and what is the status of those processes through their lifecycle?”
Answering it requires linking a product to its processes, each process to its development stage, and every part of the conclusion to the documentation behind it. That’s a multi-hop question about relationships, and the problem with unstructured text is that it doesn’t store those relationships. We see three things going wrong.
- Search returns documents, not answers. Because keyword search matches words, a product name returns every document that mentions that word. What scientists need to know is which processes belong to the product and which Stage Gate phase each one has reached.
- Text loses its meaning out of context. A sentence like “mix for ten minutes” only makes sense in its original document. Standard passage retrieval loses this context, leaving the system unable to tell what the sentence refers to or where it originated.
- Documents describe the same operation in different terms. For example, compression and compaction belong to the same process concept for question answering, but a search for one misses the other. The company’s own Stage Gate ontology is broader still, so it doesn’t match the documents’ wording on its own.
The result is slow, manual review preparation, answers that are hard to verify, and formal models that drift away from the documents people actually write. In a regulated environment, an answer that can’t be traced to its source can’t support a decision, however quickly it was found.
What Graphwise did: a focused proof of concept
To speed up answers like these, we built a proof of concept (PoC) for the global Pharma company. The aim was to answer questions like the one above directly from CMC documents, with answers traced back to their sources.
The objective was to connect unstructured CMC documentation with domain taxonomies and ontologies in a knowledge graph, so the system could answer natural-language questions about Stage Gate processes. We kept the scope tight: two investigational medicinal products (177 files in total), a selection of their Stage Gate phases, and a non-production environment with documents processed as a single batch.
The company’s competency questions (the questions the system had to answer to be useful) guided every modelling decision. Rather than modelling every scientific fact up front, we split the existing documents into sections and linked each section to the CMC concepts it describes.
The PoC had to bridge the documents to the Stage Gate ontology the company had already built, supporting their knowledge modeling work rather than replacing it.
How we did it
We built a semantic layer over the documents in four parts:
- A unified platform
- Semantic models
- An ingestion pipeline
- A natural-language interface
A unified, on-premise platform
We supported the company’s on-prem deployment of Graphwise Graph Modeling to build and maintain the taxonomy and ontologies and GraphDB to store the knowledge graph and answer questions against it. Together they formed one environment where documents, vocabulary, and models live side by side.
A taxonomy built from the documents’ own language
Our first plan was to build on established Life Sciences vocabularies, converted to SKOS and imported into Graph Modeling. Tested against the actual documents, they proved too general for the tagging the competency questions needed. Instance data from the company’s CMC Stage Gate ontology wasn’t a fit either, because that ontology is designed around classes and relationships rather than the specific instances the documents mention.
So we pivoted to a document-driven taxonomy, built from the terms the documents actually use. The competency questions identified the classes of concepts an answer needs, and these became the taxonomy’s top concepts, grouped into concept schemes. We kept the hierarchy deliberately flat. Instead of adding narrower concepts, we turned narrower terms and short phrases from the documents into alternative labels on a more general concept.
This is what solved the compression-versus-compaction problem. Phrases like “make a dry granulate”, “single punch compression” and “compact” now all point to one process operation – “Compress / Compact”. So whichever wording a document uses, a question about that step finds every section that describes it, and the model then pulls out the specifics.
We built the taxonomy from the documents of the first of the two investigational products, then tested it on the second product’s documents. Wherever those used a term the taxonomy didn’t cover yet, we added a new concept or an extra label, so the taxonomy was checked against documents it wasn’t built from. Corpus analysis and secure, local AI techniques, such as semantic similarity for grouping labels under concepts, sped up this otherwise manual work.
A lightweight document ontology, aligned with the Stage Gate model
Alongside the taxonomy, we built a lightweight document ontology. Its classes come from analyzing the competency questions against the company’s existing CMC Stage Gate ontology, and they classify the concepts used for tagging. That helps the question-answering agent understand what a user is asking. Lightweight SKOS mappings (exact and close matches) link selected classes to the Stage Gate ontology, asserting an informal correspondence without inheriting that model’s formal constraints.
To keep every passage tied to its context, we described the documents themselves in RDF using a standard web vocabulary (schema.org). Each file is a digital document, each section is a part of it, nesting follows the document’s headings, and concept tags are attached to each section as keywords.

Document ontology classes (right) mapped to the company’s CMC Stage Gate ontology (left), shown in GraphDB’s visual graph.
An automated ingestion pipeline
The pipeline turns unstructured documents (PDF, DOCX, PPTX, XLSX) into structured RDF. It retrieves the in-scope documents from the company’s repository, converts each one into structured text, and splits it into sections by heading level, keeping the parent and child relationships between headings. Each section goes to Graphwise Graph Modeling for concept extraction against the taxonomy and also receives run-specific tags for its product and Stage Gate phase, with a minimum score and a maximum number of terms keeping the tags focused. The result is loaded into GraphDB, alongside a copy of the tagging taxonomy and the document ontology.
Plain-language questions with Talk to Your Graph
On top of the knowledge graph, we enabled a Talk to Your Graph agent, a GraphDB feature that works as a GraphRAG-style system. It retrieves context from the graph, and an LLM generates an answer grounded in it. The agent runs on a deliberately concise prompt, giving the model enough retrieval and summarization guidance without crowding its context window. Because the taxonomy and the documents follow standard models, the agent doesn’t need detailed instructions on how to read them.
We deliberately left vector search off in the PoC, so every answer came from the taxonomy-based enrichment alone. That matters because it shows the semantic layer itself, not vector similarity, is what finds the right sections, and it’s why vector search appears later as an addition for production. The company’s team connected the agent to its internal question-answering application, with our support, so answers point to the documents and sections behind them.
What went well
When asked about a drug product’s CMC processes and their lifecycle status, the system described the process steps and their lifecycle, with references to the supporting documents and sections. The demonstration also tackled a harder, multi-hop question: “Which quality attributes and analytical measurements are linked to particular process stages and operations?” Behind those answers, three results stood out.
Grounded answers across complex Stage Gate material. Semantically enriched CMC documentation supported grounded natural-language retrieval, with each response tied to the knowledge graph and its sources.
Validation against a benchmark. QA testing refined the semantic tagging, the agent prompt, and the taxonomy itself. Each answer was checked for being too generic or light on context, its claims were verified against the referenced documents, and its cited sources had to reasonably support it. The team produced a benchmark document answering the company’s 15 competency questions, plus six more to show the range of the Q&A. The final validation confirmed that answers were grounded in the source CMC documentation, giving a reliable and auditable retrieval process.
Value before a full model. Linking documents to domain concepts didn’t require a complete CMC model first. The approach supports the company’s existing ontology initiatives and gives them instance-level data now, which can accelerate the development of formal CMC models.
What the PoC taught us about production
A proof of concept exists to show what production will need. This one did that clearly, with five insights that now shape the path forward.
The semantic layer carries the retrieval
With vector search switched off, the taxonomy-based enrichment alone delivered grounded, traceable answers. Production can build on that foundation, adding vector search on top rather than replacing it.
Vocabulary has to come from the documents
We first tried general Life Science vocabularies, but they proved too broad to use. They’re built to cover the whole field, which makes them too general for answering specific product questions. That’s why we used the terms from these documents to tag them and build a vocabulary unique to the company. In production, the two work together.
Experts manage a taxonomy of the concepts the documents describe. Its alternative labels link everyday wording to the standard concepts in public vocabularies and ontologies. This taxonomy becomes the assertion layer (A-box). The formal Stage Gate ontology stays the conceptual layer (T-box) above it. Each model gets a clear owner, clear governance and a single source of truth.
Learn more about A-boxes and T-boxes in our AI summit session.
Consistent answers need explicit retrieval
Answers were grounded, but the same question could return answers of different quality, because the agent had room to decide for itself how to interpret a question, retrieve context, and use it. Graphwise GraphRAG makes those steps explicit and repeatable, adding controlled retrieval orchestration, vectorization, MCP-based retrieval, query understanding and expansion, input and output guardrails, and a fresh choice of model.
Updates need rules before automation
In the PoC, documents were loaded once, as a batch. In daily use, documents get revised, replaced and added all the time, so the knowledge graph has to keep up. Automating that is fairly easy.
The question to ponder upon is about policy: when should a changed document be reprocessed, and what happens to the old version? Once those rules are set, the production pipeline can run on the Graphwise Platform as one integrated deployment, picking up new documents automatically and syncing taxonomy and ontology changes into GraphDB.
Define the expected answers, not just the questions
Competency questions are usually well written, but the link to what a good answer looks like is often missing. That’s not specific to this company. We see the same pattern in many projects. We could verify that answers came from the sources, but confirming they’re scientifically right relies on the company’s experts. Agreeing on expected answers up front makes that sign-off quicker.
The answers were always in the documents
The PoC showed that CMC knowledge doesn’t need to be rewritten to become usable. The documents were sectioned and tagged against a taxonomy built from their own language. They were then connected to the company’s Stage Gate model. As a result, different teams could ask plain-language questions and get answers that point back to their sources.
For Pharma teams exploring AI for CMC knowledge, it also shows a practical way to start. Pick a focused set of competency questions, build the semantic layer from the documents you already have, and make the evidence behind every answer easy to check.
For the development team preparing its next Stage Gate review, that changes where the work starts: with an answer and its evidence, not a search through the document library.
Ready to turn your CMC documentation into insights your teams can trust?
Details
What is GraphRAG?
Retrieval Augmented Generation or RAG enhances LLMs with external knowledge for more accurate, contextual question answering. See how RAG can evolve into GraphRAG, which uses knowledge graphs as a source of context or factual information.
Learn moreFAQ
Any Questions? Look Here
If you know exactly which document or phrase you're looking for, keyword search works just fine. The difference becomes clear when your question involves connecting information across several documents, especially when different teams use different terms for the same thing. Instead of making you guess the right keywords and piece everything together yourself, the semantic approach helps you find those connections. It's not about replacing search, but making it much more useful for complex questions.
You can follow the references in the answer to the original document sections and check whether the evidence actually supports what's being said. For more complex questions, the knowledge graph also makes it possible to examine how different concepts and pieces of information are connected, rather than relying on the AI's interpretation alone. In a production system, this can go further by showing document versions, approval status, and the specific passages behind each claim. That way, you're not just checking where the information came from, but whether it's the right evidence to rely on.
It reduces the risk, but no, it doesn't eliminate hallucinations entirely. Even when AI works with company documents, things can go wrong if information is missing, outdated, or incorrectly tagged. That's why reliable AI also needs guardrails, including the ability to say when there isn't enough evidence to answer a question. The goal isn't to make AI sound confident all the time, but to make sure that confidence is justified.
No, and that's not the intention. The system can take care of much of the time-consuming work of finding and connecting information, but understanding what that information means still requires human expertise. CMC specialists are the ones who can evaluate scientific implications, spot inconsistencies, and make decisions in a regulated environment. The idea is to give them more time for that work instead of having them spend hours searching through documents.
Not at all. You need a model that covers the questions you're trying to answer, not every possible concept in your CMC environment. Start with a focused set of concepts and relationships, establish clear definitions and ownership, and expand the model as new questions reveal what's missing. This way, you can deliver value early while continuing to build on your existing ontology initiatives.
A successful PoC shows that the approach works, but production means making sure it continues to work reliably as documents, models, and user needs change. That requires testing answers against real CMC questions, managing document revisions, enforcing access permissions, and monitoring answer quality over time. You also need clear ownership of the taxonomy, retrieval processes, and expert review workflows. It's these operational details that turn a promising demonstration into a dependable tool for everyday CMC work.