GMP + private ERP AI
AI for ERP in Pharmaceutical Manufacturing Under GMP
Short answer
AI for a pharmaceutical ERP means grounded, read-only answers over batch records, quality inspection lots, deviations and stock status, served from infrastructure inside your validated environment. It speeds up batch genealogy, release-readiness checks and deviation triage while the qualified person, QA head and ERP roles keep every decision and every write-back.
- ERP
- SAP S/4HANA, Oracle Process Manufacturing, Infor, Microsoft Dynamics 365
- Industries
- Pharmaceutical, Life Sciences, Biotech
- Written for
- Head of Quality / ERP Manager
A GMP plant does not run on the ERP alone. The ERP holds the batch master, material and lot status, inspection lots, quality notifications, purchasing and inventory, while the LIMS, the electronic batch record system, the QMS and the document system each hold part of the story. A release decision usually means a QA reviewer jumping between four screens and a binder of exceptions to confirm that every in-process check, every deviation and every material status lines up.
That is where generic chat tools fail in this industry. They have no access to your data, they cannot show the query behind an answer, and sending batch or formulation data to a public model is a data integrity and confidentiality problem before it is anything else. Pharmaceutical teams need answers that are traceable to a record, produced inside the boundary of a validated environment, and attributable to a user with the right role.
Netray builds private AI on top of the ERP and the systems around it. Open-weight models run on your GPUs or in your private cloud, retrieval is scoped to the ERP roles of the person asking, and the system is read-only by default. The AI does not release a batch, change a status or close a deviation. It finds, summarizes and cross-checks so that people with the authority to decide do it faster and with fewer misses.
This page covers where AI helps in an ERP-centred pharma operation, how it fits GMP expectations such as 21 CFR Part 211, Part 11 and EU Annex 11, and what to ask any vendor, including us, before it gets near a validated system.
What usually gets in the way
The problems we hear most from head of quality / erp manager teams running SAP S/4HANA.
Batch genealogy takes hours during an investigation
Tracing a suspect API lot forward to every finished batch and customer shipment, or a finished batch backward to every component lot, means chained where-used and where-from reports. During a deviation or complaint the clock matters, and people stitch results together in spreadsheets.
Release readiness is a manual cross-check
Before QA release, someone confirms the inspection lot has a usage decision, the in-process results are in range, open deviations are closed or assessed, and component lots are released. Each fact lives in a different screen, and a miss is caught late or not at all.
Deviation and CAPA text is unstructured
Years of deviations, root causes and CAPAs sit as free text. Finding repeat events by equipment, material or supplier relies on whoever remembers the earlier case, so recurring problems are re-investigated as new ones.
Audit and inspection preparation is a scramble
Inspectors ask for evidence across systems: supplier qualification, change control history, training status, batch records. Assembling it is slow, and the ERP data is often the part that is hardest to extract on demand.
Validation burden discourages any new tooling
Every system touching GMP data raises questions about computer system validation, data integrity and access control. Teams avoid pilots because a heavy, write-capable tool is a large validation effort for unclear benefit.
Where AI earns its place in SAP S/4HANA
Each use case names the ERP objects it reads or writes, so your ERP team can judge the integration effort before anyone commits budget.
Forward and backward batch genealogy
Ask for every finished batch that consumed a given API or excipient lot, with quantities, customers and current stock status, and see the query behind the answer.
Touches: Batch master, batch where-used list, goods movements, delivery documents, inventory by batch
Outcome: Trace answers that took hours of chained reports return in minutes, with the underlying records listed for the investigator.
Release-readiness summary
For a given batch, assemble inspection lot status, usage decision, open quality notifications, linked deviations and component lot status into one checklist for the reviewer.
Touches: Inspection lots, results recording, usage decisions, quality notifications, batch status
Outcome: Reviewers start from a consolidated view and focus on exceptions, which reduces missed items without changing who approves.
Deviation and CAPA pattern search
Search historical deviations and CAPAs by meaning, not keyword, to find earlier events with the same equipment, material or root cause.
Touches: Quality notifications, CAPA records, work orders, equipment and material masters
Outcome: Repeat events are flagged earlier, so investigators begin with prior findings rather than a blank page.
Supplier and material qualification questions
Answer which approved sources exist for a material, when the last audit was, which lots from a supplier failed incoming inspection, and what the quality agreement says.
Touches: Vendor master, source lists, incoming inspection results, purchasing info records, quality agreements
Outcome: Procurement and QA get consistent answers without searching separate trackers.
Expiry, retest and shelf-life exposure
List lots approaching expiry or retest date by site and storage location, with committed demand, so planners can act on first-expired-first-out before write-offs.
Touches: Batch shelf-life dates, storage locations, sales orders, planned orders
Outcome: Write-offs from expired stock are surfaced earlier, within the limits of data quality in the batch master.
Serialization and shipment exception review
Review shipments where serial or lot data is incomplete before dispatch, and explain which fields are missing against the market requirement such as DSCSA in the US.
Touches: Outbound deliveries, handling units, serial number records, ship-to master
Outcome: Exceptions are caught before release to the carrier, and the exception list is traceable to document numbers.
Inspection-ready evidence packs
Given an inspector request, compile the list of ERP records relevant to a batch, change or supplier, ready for a human to review and attach.
Touches: Change records, batch documents, audit trail views, user and role reports
Outcome: Preparation time drops because the retrieval step is automated, while the content stays a controlled human submission.
Reference architecture
Read-only retrieval over ERP tables and documents, with an open-weight model hosted inside your validated network and a full log of every question, query and answer.
- 1
ERP and quality data connectors
Read-only service accounts against ERP views or APIs for batch, inspection, quality notification and inventory data, plus a document connector for SOP and deviation text.
- 2
Role-aware retrieval
Questions run under the identity of the asking user, so plant, material group and authorization objects limit what can be retrieved.
- 3
Open-weight model serving
Models such as Llama, Qwen or Mistral class served with vLLM on your GPUs, with no calls to public model APIs and no training on your records.
- 4
Answer with evidence
Each answer cites the records and shows the query used, so a reviewer can verify it against the system of record before relying on it.
- 5
Audit logging and change control
Prompts, retrieved records, model version and answers are logged, and model or prompt changes go through your change control process.
Integration notes for your ERP team
- In SAP, batch data sits in tables such as MCH1 and MCHA and inspection lots in QALS, but go through released CDS views or OData where possible rather than raw table access.
- In Oracle process manufacturing and Infor installations, prefer reporting views or a replicated schema over direct production queries.
- LIMS results are often the real source for specifications, so plan a read-only connector or an export feed rather than assuming results live in the ERP.
- Deviation and CAPA text may live in a QMS. Index it as a document source with the same role mapping, and keep the link to the ERP quality notification number.
- Use a service account with select-only rights, and log each query so DBAs can review load and access.
- Keep write-back disabled by default. If you later want drafted quality notifications, require a human approval step and your normal signature controls.
Deployment options
On-premise in the validated network zone
Sites with strict data integrity policy or air-gapped quality zones
GPU servers in your data centre, reached only from the ERP and QA network segments.
Private cloud or sovereign region
Companies already running ERP in a private tenancy
Dedicated GPU instances in your own cloud account, with network isolation matching the ERP.
Hybrid with a read-only replica
Plants that must not query the production ERP
Retrieval runs against a replicated reporting copy so AI load never touches the transactional system.
Compliance and data control
How the architecture supports your obligations. Certification and accountability stay with your organisation; the design keeps the evidence straightforward.
21 CFR Part 211 (cGMP)
The AI does not alter batch records or release decisions. It retrieves and summarizes records that already exist, which keeps responsibility with the quality unit.
21 CFR Part 11 and EU Annex 11
No electronic signature or record creation happens in the AI layer. Access control, audit logging and traceable answers help support your own Part 11 and Annex 11 controls, and the customer validates the use.
ALCOA+ data integrity
Answers are attributable (user and time), legible, and tied to original records through citations, so the source system remains the original record.
GAMP 5 and computer software assurance
A read-only, non-decision-making tool can be risk-assessed at a lower category of impact, but classification and validation scope are the customer's decision.
Confidentiality of formulations and processes
Models run inside your boundary, so formulation, process parameters and supplier terms are not sent to a third-party model provider.
Where Netray fits
ERPray
Natural-language questions, dashboards and read-only agents over batch, inspection and inventory data, with the query shown.
DataRay
Chat over the mixed estate of LIMS exports, SOP files and deviation documents that sit next to the ERP.
Custom build
Private retrieval over your QMS and document system, with approval workflows built to your validation approach.
How an engagement runs
Phase 1 . 2 to 3 weeks
Discovery and risk assessment
- -System and data map across ERP, LIMS and QMS
- -Intended-use statement and risk classification input
- -Role and access matrix
- -Shortlist of read-only use cases
Phase 2 . 4 to 6 weeks
Pilot in a non-production copy
- -Connectors to a non-production ERP copy
- -Genealogy and release-readiness question set
- -Evaluation against known historical investigations
Phase 3 . 3 to 6 weeks
Validation support
- -Test scripts and traceability to requirements
- -Model and prompt version control procedure
- -Audit logging evidence
Phase 4 . Ongoing
Controlled rollout
- -Role-based user onboarding
- -Monitoring of query load and answer quality
- -Periodic review under change control
Questions to ask any vendor, including us
A short list that separates real SAP S/4HANA AI work from a chatbot demo.
- Is the tool strictly read-only, and can you show the permissions of the service account?
- Where do the model and the prompts run, and does any record leave our network?
- Can every answer be traced to specific records and the query that produced it?
- How are model and prompt changes put under our change control?
- What is the validation approach and what evidence do you provide?
- How are ERP authorization objects reflected in retrieval?
- What happens when the model is uncertain or the data is missing?
- Who owns the logs, and how long are they retained?
Frequently asked questions
Can AI release a batch in our ERP?
It should not. Batch release is a quality unit decision with formal signatures. The useful role of AI is to assemble the evidence, such as inspection status, open deviations and component lot status, so the authorized person decides faster. Any write-back would need a separate, validated approval design.
Is a read-only AI tool in scope for Part 11?
Part 11 applies to electronic records and signatures. A tool that only reads and summarizes may not create GMP records, but that is a determination for your quality and regulatory team based on intended use. We provide logging and access controls to support your assessment.
Do we need a public cloud model for this?
No. Open-weight models served on your own GPUs or private cloud handle retrieval, summarization and cross-checking well. That keeps formulations and batch data inside your boundary, which most pharma data policies prefer.
Which ERPs can this work with?
Any ERP with a readable data path: SAP S/4HANA and ECC, Oracle, Infor, Dynamics 365 and others. The connector depends on APIs, views or a replica. Depth of value depends on how well batch and quality data is maintained in that system.
Will it replace our MES or electronic batch record system?
No. Execution and the batch record belong to those systems. AI sits alongside, helping people query across the ERP, MES and quality data, and does not take over execution or compliance records.
How do we avoid wrong answers?
By grounding each answer in retrieved records, showing the query, and refusing to answer when data is missing. Reviewers should still verify against the system of record for any decision with regulatory impact.
What is a sensible first project?
Batch genealogy and release-readiness summaries are good starting points because the data is structured, the questions are repetitive, and the results are easy to verify against historical investigations.
Related guides
AI for NCR, CAPA, and 8D Drafting in AS9100 and ISO 9001 Quality Systems
AI drafts NCR, CAPA, and 8D reports from ERP quality data for engineer review, cutting drafting time under AS9100 and ISO 9001 without changing sign-off.
SAP QM + on-prem AIAI for SAP Quality Management: Notifications, 8D, and CAPA Without the Manual Drafting
AI grounded on SAP QM data that triages notifications, drafts 8D and CAPA reports, and summarizes inspection trends, deployed on-prem for full traceability.
RAG + SQL + permissionsA Private LLM Grounded on Your ERP Data
How a private LLM answers questions on your ERP data: RAG plus text-to-SQL, role-based permissions inherited from the ERP, and where each fits.
Agents + approval gatesAI Agents for ERP, Running On-Prem
A practical guide to on-prem AI agents for ERP: what they can safely automate, where human approval belongs, and how to design the guardrails.
SAP S/4HANA + private AIAI for SAP S/4HANA, Running On-Prem or in Your Private Cloud
Run AI on SAP S/4HANA without sending ERP data to a public API. On-prem and private-cloud architecture, CDS views, OData, and honest deployment trade-offs.
Digital thread + AIAI Across PLM and ERP: Teamcenter, Windchill, and Your ERP
AI that reads Teamcenter or Windchill alongside your ERP to trace engineering change impact, BOM sync gaps, and where-used questions, on-prem.
Plan it with numbers
On-Prem LLM Total Cost of Ownership Calculator
Model the full multi-year cost of running LLMs on your own hardware, including GPU capex, power, cooling, support contracts, and operations staffing.
Free ToolAir-Gapped AI Readiness Assessment
A 10-question assessment that scores how prepared your organization is to deploy and operate LLMs inside an air-gapped or classified enclave.
Free ToolOpen-Weight Model Selector
A 10-question assessment that matches your hardware budget, workload complexity, and operational maturity to the right open-weight model size class.
GuideSyteLine SDK and API Reference Guide for Developers
Complete SyteLine SDK and API reference. Mongoose namespaces, IDO runtime APIs, web service endpoints, and developer toolkit for CloudSuite Industrial.
GuideSyteLine IDO Security and Permissions Setup
Configure SyteLine IDO-level security and role-based permissions. Control read, insert, update, and delete access per IDO, property, and user group in CloudSuite Industrial.
GuideSyteLine Mongoose Framework Architecture Deep Dive
Deep dive into SyteLine Mongoose framework architecture. IDO runtime, request pipeline, session management, and extensibility patterns for developers.
Talk it through with an engineer who knows SAP S/4HANA
Bring one real question your team cannot answer from the ERP today. We will map the data path, the model, and where it runs, and tell you honestly if AI is the wrong tool for it.