How to Add AI to the AVEVA PI System On-Prem, Without Moving Data to a Cloud
how to add AI to AVEVA PI System on-prem
Also searched as
- PI System AI integration without cloud
- chat with PI historian data using a local LLM
- PI Web API read-only service account for AI assistant
- air-gapped AI for OSIsoft PI
Short answer
Put a read-only tool server in front of PI Web API, index the PI AF asset model plus your SOPs and shift logs, and serve an open-weight model on local GPUs. The model asks tools for bounded summaries instead of raw tag data, and every call runs with the asking user's PI identity and is logged.
Applies to: PI Data Archive 2018 and later, PI AF 2018 and later, PI Web API 2018 and later. AVEVA PI Server and PI Vision on Windows, on-prem or private cloud.
Reference build, in order
- 1Stand up a read-only service identity in PI (a PI Identity mapped to a Windows group) with read access to the points and AF branches in scope, and nothing else.
- 2Put PI Web API behind a reverse proxy on the same network zone as the AI servers. Use Kerberos or the auth mode your site already allows; do not open it to the internet.
- 3Export the PI AF hierarchy (elements, templates, attributes, units, descriptions, categories) on a schedule and index it so the assistant can map a plain-language question to the right WebIds.
- 4Index documents that explain the process: SOPs, alarm rationalization sheets, MOC records, shift logs, lab results exports. Keep the source ACL with each chunk.
- 5Write a small tool server (MCP or plain HTTP) with approved read tools: current value, recorded values with a point cap, summary by interval, event frames in a window, element search.
- 6Serve an open-weight model with vLLM or Ollama on local GPUs and give it only those tools. Do the arithmetic in the tools, not in the model.
- 7Log every question, tool call, WebId, time range and row count to an append-only store the security team can read.
- 8Roll out in three phases: read-only questions, drafted shift summaries and event frame annotations, then approved write-backs to the systems that support them.
Where the data actually lives and how you reach it
The PI Data Archive stores time-series values per PI point (tag). PI Asset Framework (PI AF) adds the model on top: elements built from templates, attributes whose data references point to PI points, event frames for batches, downtime and excursions, and analyses. The AF database itself sits in SQL Server, but supported access goes through the AF SDK (.NET) or PI Web API rather than direct SQL.
PI Web API is the natural integration layer for an AI service because it is plain REST over HTTPS and returns WebIds that you can cache. For BI-style access you also have PI SQL Client or PI OLEDB Enterprise over AF, and PI Integrator for Business Analytics to publish PI data to a relational target. Pick one read path per use case and stick to it.
The first design decision is granularity. A language model should never receive a million raw samples. Ask the tool for a summary (average, min, max, count, time in range) over an interval, or for the last N recorded values, and let the model reason over that.
# 1. Resolve a tag to a WebId (read-only)
GET https://pi-web.plant.local/piwebapi/points?path=\\PIARCH01\FIC-101.PV
# 2. Hourly averages for the last 24 hours
GET https://pi-web.plant.local/piwebapi/streams/{webId}/summary?startTime=*-24h&endTime=*&summaryType=Average&summaryDuration=1h
# 3. Last 200 recorded values, capped by the tool server
GET https://pi-web.plant.local/piwebapi/streams/{webId}/recorded?startTime=*-8h&endTime=*&maxCount=200
# 4. Event frames in a window for an AF database
GET https://pi-web.plant.local/piwebapi/assetdatabases/{dbWebId}/eventframes?startTime=*-7d&endTime=*&searchMode=OverlappedReference architecture, including the air-gapped option
Keep the AI stack on the business side of your network and do not point it at the control-level archive. A common pattern is a business-level PI Data Archive fed by PI to PI from the plant-level collective, so a runaway query lands on a replica and not on the server your operators depend on. PI Web API, the tool server, the vector index and the model server then live in one zone with a firewall rule set that allows only the tool server to reach PI Web API.
The retrieval index has two halves. One is the AF model and tag metadata (names, descriptions, engineering units, categories), which is how the assistant finds the right signal. The other is unstructured text: SOPs, MOC packages, shift handover notes. Rebuild the first nightly and the second on change.
For a fully air-gapped site, ship model weights and container images in on approved media, run the embedding model locally too, and keep the audit log on the same isolated network. Nothing in this design needs an outbound connection.
Permissions: mirror PI security, do not replace it
PI security is layered: PI Identities and PI Mappings tie Windows principals to access, points carry their own data access permissions, and AF objects have security descriptors per element and database. The assistant must not become a side door around that model.
The cleanest route is to call PI Web API as the end user (Kerberos with constrained delegation, where your IT team supports it) so PI itself denies what the user cannot read. If that is not practical, use a service account but filter the tool results and the retrieval index against a copy of the user's group membership and a per-role allow list of AF branches.
Test this explicitly. Ask the same question as a process engineer and as a contractor account, and confirm the contractor gets an honest 'I cannot see that' rather than a partial answer.
Write-back, sizing and a realistic rollout
PI is mostly a system of record for history, so most value comes from read access. Where writes make sense (adding an annotation to an event frame, recording a manual lab value), do it through PI Web API with a human approving the exact payload. Never let an AI service write setpoints or commands toward the control system, directly or through PI.
Sizing is driven by concurrent questions, not by data volume. As a rough range, a single 24 to 48 GB GPU running a 7B to 32B class model can serve a department of tens of users who ask a few questions each per day; a few hundred active users usually means two to four GPUs plus headroom for long contexts. The retrieval index for tens of thousands of documents is a few GB to low tens of GB.
Phase 1 is read-only questions and trend summaries for one unit. Phase 2 adds drafted shift reports and excursion write-ups that a person edits. Phase 3 adds approved annotations and ticket creation in your maintenance system.
Honest limits and when you do not need this
A language model is poor at reading dense, high-frequency signals and at noticing slow drift, so do not use it as a replacement for PI Vision displays, PI Analysis Service rules or PI Notifications. It is good at finding the right signal from a vague question, explaining context from documents, and drafting write-ups from summaries you computed.
Poor tag hygiene limits quality. If points are named with legacy cryptic codes and have empty descriptions, expect a metadata cleanup phase before answers get good. If you only need trends and alerts and your staff already use PI Vision and AF analyses well, adding an assistant may not pay back. AVEVA also offers its own cloud analytics options; they are a reasonable choice if cloud is acceptable for the data in question.
Try it here, free
AVEVA PI System AI Assistant Sizing and Value Calculator
Estimate peak concurrency, GPU count, index size, hours saved and payback for a private on-prem AI assistant on AVEVA PI System.
Common pitfalls
- !Letting the assistant query PI directly with a broad admin account, which silently bypasses point and AF security.
- !Returning raw samples to the model instead of summaries, which wastes context and produces confident but wrong arithmetic.
- !Pointing heavy queries at the plant-level archive during production instead of a business-level replica.
- !Indexing tag names without descriptions and units, then wondering why the assistant picks the wrong signal.
- !Treating PI as a control path. PI is not the place to write setpoints, and an AI service must not be given that ability.
- !Skipping the audit log because 'it is read-only'. Security teams will still ask who looked at what.
How an ERP-grounded AI assistant handles this
ERPray and Netray's custom builds connect this PI layer to your ERP, so a question like 'why was line 3 scrap high on Tuesday night' can combine PI excursions with work orders, lots and quality records, with the tool calls shown to the user. DataRay covers the document half on-prem.
Frequently asked questions
Does the AI need access to every PI point?
No. Give the service identity read access only to the points and AF branches in scope for the first use case, and expand deliberately. A smaller catalog also gives better answers because there are fewer look-alike tag names to confuse retrieval.
Can it work with PI Web API only, without the AF SDK?
Yes. PI Web API covers points, streams, summaries, AF elements and attributes, and event frames, which is enough for a read-only assistant. The AF SDK is useful for heavy bulk jobs but is Windows and .NET only.
Is a local model accurate enough for plant questions?
For retrieval, summarising and drafting, current open-weight models in the 7B to 70B range are usable when they are given good tools and sources. Quality depends more on metadata and tool design than on model size. Measure it on your own question set before rollout.
What about AVEVA Data Hub or other cloud options?
They are valid if your data policy allows cloud. This page is for sites that cannot or will not send process data off site, such as defense, aerospace and regulated plants.
Related
How to integrate Ignition with your ERP
Do not let Ignition write straight into ERP tables. Put a staging layer between them: Ignition writes production events to a staging table or calls an ERP API through a gateway script, and a controlled poster validates and posts them to the ERP. Pull work orders the other way with a scheduled gateway script or Named Query against a read-only view or API.
AdvancedHow to Connect OPC UA Machine Data to Your ERP
Do not connect OPC UA servers straight to the ERP. Read machine tags through an edge gateway or MES, convert signals into business events (cycle complete, stop, state change, count), attach the work order context, and post summarised confirmations to the ERP through its supported API. The ERP wants quantities, times and reasons per order, not millions of raw tag values.
How-toHow to Calculate OEE from MES Data and ERP Standards
OEE equals Availability times Performance times Quality. Availability comes from MES run and stop events against planned production time, Performance compares actual output to the ideal cycle time (usually the routing standard from the ERP), and Quality is good units divided by total units. The numbers are only trustworthy if planned time, ideal cycle time and the good/scrap split are defined once and used consistently.
AdvancedHow to add a private AI layer to Infor LX / BPCS on-prem
BPCS and Infor LX run on IBM i with their data in Db2 for i, in files that carry short coded names by module. A private AI layer reads those files through read-only SQL views over a replica, indexes documents and attachments separately, exposes approved queries through a tool server, and serves an open-weight model on local GPUs. Writes, if any, go through the supported transaction programs with human approval.
AdvancedHow to add a private AI layer to Infor System21 on-prem
System21 runs on IBM i with its business data in Db2 for i. The practical private AI pattern is a read-only replica or extract, SQL views that give files readable names, a retrieval index over documents, a tool server of approved queries, and a locally served open-weight model. User visibility is carried over from System21 security and company set-up, and writes only go through its supported entry points after approval.
AdvancedHow to add a private AI layer to Infor EAM on-prem
On-prem Infor EAM stores its data in an Oracle or SQL Server schema whose tables use the R5 prefix, and it exposes web services for supported access. A private AI layer reads equipment, work order and parts data through read-only views on a reporting copy, indexes failure notes and manuals for retrieval, mirrors EAM organisation security, and serves an open-weight model locally. Work orders created or changed by the assistant go through EAM's web services after a person approves.
AI for ERPAI for SAP Plant Maintenance: Notifications, Work Orders, and Predictive Signals
AI grounded on SAP PM data that triages notifications, drafts work orders, standardizes failure codes, and flags predictive maintenance signals, on-prem.
AI for ERPAI for Plex Manufacturing Cloud, Grounded in Your Production Data
Put AI on Plex production, quality, and genealogy data without a public model. On-prem or private-cloud LLMs, RAG, and agents built for Plex shops.
Stuck on AVEVA PI System (OSIsoft PI)?
Talk to engineers who work inside AVEVA PI System (OSIsoft PI) every week, and who build private AI that answers these questions from your own ERP data.
Keep exploring
Free tools
- AVEVA PI System AI Assistant Sizing and Value CalculatorEstimate peak concurrency, GPU count, index size, hours saved and payback for a private on-prem AI assistant on AVEVA PI System.
- AVEVA PI System Private AI Layer Blueprint GeneratorFill in your environment and get an architecture plan for a private AI assistant on AVEVA PI System: components, security controls, rollout phases and open questions for IT.
- AVEVA System Platform and Historian AI Assistant Sizing and Value CalculatorEstimate peak concurrency, GPU count, index size, hours saved and payback for a private on-prem AI assistant on AVEVA System Platform and Historian.
ERP fixes and how-tos
- AI on AVEVA System Platform and Wonderware Historian, Fully On-PremArchitecture for a private AI assistant on AVEVA System Platform and Wonderware Historian: SQL views, Galaxy areas, read-only access, local GPUs, audit log.
- SAP PP-PI and the PI Sheet ExplainedWhat SAP PP-PI is, how a PI sheet carries process instructions to the shop floor via control recipes, and how process orders differ from discrete PP orders.
- How to Add AI to LabWare LIMS On-Prem Without Moving DataReference architecture for a private AI assistant over LabWare LIMS: read-only replica, SOP and COA retrieval, local model, role mirroring and audit. No cloud.