Skip to content

Overview & OSIsoft PI System Parity

GxPHistorian GxP Industrial Historian is a production-ready, 21 CFR Part 11, EU GMP Annex 11, and ISPE GAMP 5 (Second Edition) qualified open-source replacement for the proprietary OSIsoft / AVEVA PI System, engineered specifically for pharmaceutical, biotechnology, and regulated industrial manufacturing environments.

It combines:

  • ClickHouse 24.8 LTS — Lossless DoubleDelta + Gorilla time-series telemetry archive, real-time 1-minute AggregatingMergeTree rollups, and native largestTriangleThreeBuckets (LTTB) visual downsampling.
  • PostgreSQL 16 — ltree ISA-95 Asset Framework, Tag Catalog, ISA-88 Event Frames, and a cryptographic SHA-256 Write-Once-Read-Many (WORM) 21 CFR Part 11 audit trail.
  • InfluxData Telegraf 1.32 + Python Multi-Protocol Edge Workers — Stage 1 Exception/Deadband filtering (ExcDev & ExcMax) and disk-backed store-and-forward Write-Ahead Log (WAL).
  • FastAPI Control Plane (historian-api) — Unified GxP REST API, Event Frame state machine, §11.200 dual-challenge electronic signatures, Excel DataLink server, and PyArrow Parquet exporter.
  • Grafana OSS 11.2 (grafana-vision) & Excel DataLink Client — Asset-relative Operator HMI with Event Frame annotations plus drop-in Excel xlwings UDFs and zero-macro Power Query CSV streams.

1. OSIsoft / AVEVA PI System Parity Matrix

Legacy OSIsoft / AVEVA PI ComponentGxPHistorian GxP Historian EquivalentKey Technical Capabilities
PI Data Archive (Swinging Door / Archive Subsystem)ClickHouse 24.8 LTS (pi_historian.sensor_data) + Stage 2 Swinging Door (CompDev/CompMax)MergeTree partitioned by month (toYYYYMM(ts)) with lossless Delta, DoubleDelta, Gorilla, and T64 codecs layered with ZSTD(1), optional Stage 2 Swinging Door compression (CompDev, CompMax, CompMin), and real-time 1-minute AggregatingMergeTree rollups (sensor_rollup_1m).
PI Asset Framework (PI AF)PostgreSQL 16 ltree + ClickHouse FLAT Dictionary + Template Auto-InstantiationISA-95 hierarchical asset paths (Enterprise.Site.Area.Unit) indexed via PostgreSQL GiST, one-call AF Template auto-instantiation (POST /api/v1/assets/instantiate-template), canonical UOM conversion, Digital State Sets (digital_state_sets), and ClickHouse RAM dictionary sync (pi_historian.pg_asset_tags).
PI Event Frames (EF) & PI NotificationsPostgreSQL event_frames + TrueFor Backfill + Multi-Stage Signatures + Multi-Channel Alert EngineAutomated ISA-88 batch & excursion detection, historical backfill with TrueFor debounce (POST /api/v1/event-frames/backfill), hierarchical parent/child batch phases (parent_event_id), multi-stage 21 CFR Part 11 electronic signatures (Operator →\rightarrow Supervisor →\rightarrow QA), and multi-channel Email (SMTP/HTML), SMS (Twilio / Carrier Gateway / OT Cellular SMPP), Mobile Push (APNs Critical / FCM / PagerDuty v2), Webhook alerting with Escalation Teams, Non-Repetition/Resend intervals, Two-Way SMS "ACK <id>", and Send-on-Close (POST /api/v1/notifications/evaluate).
PI Interface Node & PI Buffer SubsystemTelegraf 1.32 Disk WAL + Python Edge WorkersStage 1 Exception/Deadband filtering (ExcDev & ExcMax) + optional Stage 2 Swinging Door (CompDev & CompMax) in memory + disk-backed Write-Ahead Log (/var/lib/telegraf/buffer, 1M metric capacity) for zero-data-loss store-and-forward across OPC UA, BACnet/IP, Siemens S7, Modbus, and Windows OPC DA.
PI Vision & PI BatchView (PlotValues Trends, EF Overlays & Golden Batch)Grafana OSS 11.2 + ClickHouse largestTriangleThreeBuckets + /api/v1/batches/compareAsset-relative dashboard (${asset_path}) with native ClickHouse LTTB visual peak preservation, 1-minute rollup bands, Event Frame shaded region annotations, relative batch elapsed-hour (T+0.0h) Golden Batch alignment (mean ± 2 SD reference envelope), and live Part 11 audit trail inspection.
PI DataLink & PI Web API StreamSets (PICurrVal, PIArcVal, PICompDat, PISampDat, PIAdvCalcDat, PITimeFilter)FastAPI /api/v1/datalink/* + /api/v1/streamsets/* + 8 xlwings Excel UDFs / Power QueryComplete 8-function Excel DataLink suite (=GXPHISTORIAN_SAMPLED(), =GXPHISTORIAN_PLOT_VALUES(), =GXPHISTORIAN_EVENT_SUMMARY(), =GXPHISTORIAN_CURRENT_VALUE(), =GXPHISTORIAN_ARCHIVE_VALUE(), =GXPHISTORIAN_COMPRESSED_DATA(), =GXPHISTORIAN_CALCULATED_DATA(), =GXPHISTORIAN_TIME_FILTER()) plus bulk multi-tag StreamSets (/api/v1/streamsets/end, /api/v1/streamsets/interpolated).
PI Analysis Service & SQC (Asset Analytics & Statistical Process Control)GxP Calculation Engine (/api/v1/analytics/{mkt,f0-lethality,sqc})Built-in ICH Q1A Mean Kinetic Temperature (MKT\text{MKT}, ΔH=83.144 kJ/mol\Delta H = 83.144\text{ kJ/mol}), USP <1229> Steam Sterilization Lethality (F0F_0 trapezoidal integration), and Western Electric SQC SPC rules (3σ, 2-of-3 2σ, 4-of-5 1σ, 8-consecutive same side, CpC_p, CpkC_{pk}).
PI Manual Logger21 CFR Part 11 Manual Data Entry (/api/v1/manual-logger/entries)Validated offline/at-line lab and cleanroom logbook entry with optional dual-person verification (verified_by), WORM audit trail attribution, and automatic dual-write into ClickHouse pi_historian.sensor_data (quality = 192).
PI Integrator for Business AnalyticsFastAPI + PyArrow Zero-ETL Lakehouse ExporterOne-call (POST /api/v1/lakehouse/export-parquet) Snappy-compressed Apache Parquet export enriched with ISA-95 asset hierarchy and engineering units.
AVEVA Industrial AI Assistant / PI Web APIPydantic AI Co-Pilot (app/gxp_ai_agent.py) & gxphistorian-mcp (app/mcp_server.py)Typed ISA-88 Batch Excursion Investigator (output_type=DeviationInvestigationBrief, WHERE quality >= 192), Part 11 human-in-the-loop ApprovalRequired tag provisioning, Capabilities on Demand (defer_loading=True), and 6-tool FastMCP server.

2. Container & Port Matrix

Container NameRoleInternal PortDefault Host Port (.env)Technology Stack
postgres-controlPillar 3: Relational Control Plane & Part 11 WORM Audit Log54325435 (PG_PORT)PostgreSQL 16 (ltree, btree_gist, pgcrypto)
clickhouse-archivePillar 2: Immutable Time-Series Archive & Rollup Engine8123 / 90008125 / 9005ClickHouse Server 24.8 LTS (Apache-2.0)
instrument-mock-serverPillar 1: Multi-Protocol Biopharma Instrument Mock Server8095, 4840, 5020, 47808/udp, 1102, 40018095, 4840, 5020, 47808/udp, 1102, 4001Python 3.12 Asyncio (OPC UA, Modbus TCP, BACnet/IP, S7comm, RS-232 MT-SICS, OPC DA & UFL)
edge-collectorPillar 1: Multi-Protocol Collector & Store-and-Forward WAL80808080 (EDGE_INGEST_PORT)Telegraf 1.32 Alpine + Python 3.12
historian-apiPillar 3: GxP REST API, Event Frame Engine & DataLink Server80008020 (API_PORT)FastAPI, Psycopg 3, ClickHouse Connect, PyArrow
gxphistorian-mcpPillar 3: Pydantic AI Co-Pilot & FastMCP Streamable HTTP Server80308030 (MCP_PORT)Pydantic AI 2.0, FastMCP, Pydantic Logfire
grafana-visionPillar 4: Pre-Provisioned Operator HMI30003020 (GRAFANA_PORT)Grafana OSS 11.2 + ClickHouse Datasource Plugin

3. Repository Structure

clickhouse-historian/
├── .antigravity/
│ └── rules.md # Architectural & 21 CFR Part 11 guardrails
├── .env / .env.example # Non-default GxP credentials & host port mappings
├── docker-compose.yml # 7-service orchestrated stack with healthchecks
├── pytest.ini # Pytest configuration for IQ/OQ qualification
├── init-postgres/
│ └── 01_control_plane_part11.sql # PostgreSQL 16 ltree, pgcrypto, WORM audit & seed data
├── init-clickhouse/
│ └── 01_telemetry_core.sql # MergeTree codecs, 1m rollups, PG dictionary & bridges
├── instrument-mock-server/
│ ├── Dockerfile # Multi-protocol biopharma instrument mock server image
│ └── mock_instruments.py # Live OPC UA (:4840), Modbus (:5020), BACnet (:47808), S7 (:1102), RS-232 (:4001) & HTTP (:8095)
├── edge-collector/
│ ├── Dockerfile # Telegraf 1.32 Alpine + Python 3.12 edge collector image
│ ├── telegraf-clickhouse.conf # Disk WAL buffer, HTTP ingest (:8080), execd & CH output
│ └── scripts/
│ ├── multi_protocol_simulator.py # Deterministic plant simulator + Stage 1 Deadband & Stage 2 Swinging Door
│ ├── opcda_windows_forwarder.py # Windows localhost COM OPC DA -> HTTP JSON bridge
│ └── bacnet_cov_worker.py # Async BACnet/IP COV / ReadPropertyMultiple worker
├── app/
│ ├── Dockerfile # FastAPI control plane container definition
│ ├── requirements.txt # FastAPI, Psycopg 3, ClickHouse Connect, PyArrow, Pydantic AI, FastMCP
│ ├── main.py # Unified REST API, Event Frame Engine, DataLink & Part 11
│ ├── pi_parity_engine.py # AVEVA PI System Parity Engine (DataLink, StreamSets, MKT/F0/SQC, BatchView, AF, Manual Logger, Notifications)
│ ├── gxp_ai_agent.py # Pydantic AI Excursion Investigator & Part 11 Co-Pilot Agents
│ └── mcp_server.py # FastMCP (gxphistorian-mcp) read-only GxP historian server
├── provisioning/grafana/
│ ├── datasources/datasources.yml # Auto-provisioned ClickHouse & PostgreSQL datasources
│ └── dashboards/
│ ├── dashboards.yml # Dashboard provider configuration
│ └── gxphistorian_bioreactor_hmi.json # Asset-relative Bioreactor & Cleanroom HMI dashboard
├── deploy/hybrid-cloud/
│ ├── docker-compose.edge-only.yml # Pattern B: Thin Purdue L2.5 Edge Collector streaming over HTTPS/mTLS
│ ├── telegraf-hybrid-dualwrite.conf # Pattern C: Multi-Site Hub & Spoke dual-write (Local L3 + Cloud Hub)
│ └── clickhouse-tiered-storage/ # 15-Year WORM XML policies (aws_s3_worm.xml, azure_blob_worm.xml, gcp_gcs_worm.xml)
├── docs/ # Biopharma Equipment, Connector, Hybrid Cloud & Pydantic AI Guides
├── docs-site/ # Astro Starlight Documentation Portal
├── excel-datalink-client/
│ ├── gxphistorian_datalink_udf.py # 8 xlwings UDFs (=GXPHISTORIAN_SAMPLED, =GXPHISTORIAN_CALCULATED_DATA, etc.)
│ └── README_EXCEL_SETUP.md # Power Query (zero-macro) & xlwings setup guide
└── gxp-validation-package/
├── generate_gmp_binder.py # Automated 8-Document GMP Validation Binder generator
├── specs/urs_risk_catalog.yaml # 21 URS items mapped to FRS, GAMP Cat, CSA Risk & pytest
├── tests/ # Executable IQ/OQ pytest qualification suite (21 tests)
├── evidence/oq_execution_results.json # Timestamped pytest execution evidence log
└── dist_binder/ # Generated 8 Markdown deliverables + HTML/PDF binder

4. Hybrid Cloud Deployment Options (AWS, Microsoft Azure & Google Cloud)

GxPHistorian’s 4-Pillar separation allows regulated plants to keep deterministic fieldbus polling and 100 GB (>14-day) Telegraf Disk WAL store-and-forward buffering on-premises at Purdue Level 2.5, while deploying cold storage, lakehouses, or core historian services in AWS, Microsoft Azure, or Google Cloud (GCP) across three selectable patterns:

  • Pattern A (Thick Plant Core + Cloud 15-Year WORM & Lakehouse): All 4 Pillars run on-premises for 100% WAN-independent cleanroom HMIs and §11.200 e-signatures, tiering aged telemetry and pgBackRest WAL archives into Amazon S3 Object Lock (COMPLIANCE), Azure Immutable Blob Storage, or Google Cloud Storage Bucket Lock and Zero-ETL Parquet Lakehouses (Athena, Microsoft Fabric, BigQuery BigLake).
  • Pattern B (Thin Plant Edge + Cloud Historian Core): Only Pillar 1 (edge-collector) runs on-premises (deploy/hybrid-cloud/docker-compose.edge-only.yml), streaming over outbound HTTPS/mTLS (:8443) to ClickHouse, Managed PostgreSQL 16 (Amazon RDS, Azure Flexible Server, Cloud SQL), historian-api, gxphistorian-mcp, and Private AI (Bedrock, Azure OpenAI, Vertex AI) inside your cloud VPC/VNet.
  • Pattern C (Multi-Site Hub & Spoke Federation): Full local Pillars 1–4 per manufacturing site plus Telegraf dual-write (deploy/hybrid-cloud/telegraf-hybrid-dualwrite.conf) to a global cloud aggregator for cross-site Golden Batch comparisons (/api/v1/batches/compare).

See the complete Hybrid Cloud Deployment Guide (AWS, Azure & GCP) for architecture diagrams, XML policies, and GAMP 5 Cloud Shared Responsibility controls.

Need Turnkey GxPHistorian Implementation, Legacy OSIsoft PI Migration, or Site IQ/OQ/PQ Validation?

Saram Consulting (saram.io) delivers end-to-end OT/IT skid connectivity (Xcellerex, Biostat, ÄKTA, Raman PAT, BACnet EMS), lossless PI Data Archive backfill, and QA-signed 21 CFR Part 11 & GAMP 5 qualification packages.

Diagram Viewer