PHARMA FACTORY - FULL
Full Track: Author It All
You chose to build every part. Start from first principles.
This track assumes nothing: no legacy systems, no inherited constraints. You design the connection architecture, build the surface hierarchy, and author every warm query.
What you will build
| Component | Scope |
|---|---|
| Connections | A multi-zone sensor network |
| Surfaces | Cleanroom, QA, mixing, batch |
| Warm queries | A compliance query library |
| Team | Access for operations, QA and engineering |
| MCP | Any AI client reading the library |
Phase 1: Design the connection architecture
Step 1.1: Map your data sources
| Zone | Data sources | How it reaches OpenX |
|---|---|---|
| Cleanroom | Temperature, humidity, pressure | A connection |
| Mixing | Batch sensors, valve states | A connection |
| QA | Test results, approvals | An API Source polling your LIMS, or a CosmosDB container a warm query reads |
| Utilities | HVAC, water | A Simulator until the meters are wired |
Step 1.2: Create connections
On the canvas
- Drag a Connection node from the Node Bank onto the canvas for each zone.
- In each inspector's Settings tab, set the Connection ID. There is no connection string to enter.
- Save, then Deploy. Each connection's Connection Info tab then shows the credentials its devices send with.
Or ask Azi
AZI
"Create connections for the cleanroom sensors and the mixing batch data, and an API source for our LIMS." I propose them; accept each one, then Deploy builds them.
Step 1.3: Start with a simulator
If hardware is not connected yet:
- Drag a Simulator node from the Node Bank onto the canvas.
- In its inspector, add Variables for temperature, pressure and batch data.
- In Template, write a JSON message that mirrors your sensors;
$.Namepulls in a variable. - Save, then Deploy starts it.
TIP
Shape the simulator like your real sensors, and you can switch to real connections later with the same queries. See the Simulator guide.
Phase 2: Create the surface hierarchy
Surfaces organize your data by function. For pharma, a typical hierarchy:
Pharma-Factory (workspace)
├── Cleanroom-Monitoring
│ └── Environmental sensors
├── Batch-Tracking
│ └── Process data
├── QA-Gating
│ └── Test results
└── Utilities
└── HVAC, water
Step 2.1: Cleanroom surface
"Create a surface for cleanroom monitoring, fed by the cleanroom sensors connection."
Azi proposes a Cleanroom-Monitoring surface wired to it. Accept it; it is live at once.
Step 2.2: The other surfaces
| Surface | Fed by | Purpose |
|---|---|---|
Batch-Tracking | Mixing batch connection | Process monitoring |
QA-Gating | A connection that reads the LIMS API source | Quality control |
Utilities | The utilities simulator | Support systems |
Phase 3: Build the warm query library
Where your data is
Device data lands in one table, Data (Devices in workspaces whose IoT fabric was set up earlier), with each
payload as JSON in RawData. The queries unpack it with todynamic(RawData). The field names (zone,
temperature, pressure, batchId) are examples; use your sensors' own. Ask Azi to sample with
Data | take 5 first. The queries below are examples to adapt, not tested against your data.
| Query | Purpose | Surface |
|---|---|---|
temp-compliance | Hourly temperature compliance | Cleanroom |
batch-history | Every event for one batch | Batch-Tracking |
pressure-alerts | Pressure outside its range | Cleanroom |
qa-pending | Batches awaiting QA | QA-Gating |
trend-analysis | 7-day trends by parameter | All |
Step 3.1: Temperature compliance by hour
"Create a warm query for hourly cleanroom temperature compliance over the last day, flagging any hour outside 18-22°C."
Data
| where EnqueuedTime > ago(24h)
| extend Payload = todynamic(RawData)
| where tostring(Payload.zone) == "Cleanroom"
| summarize MinTemp = min(todouble(Payload.temperature)),
MaxTemp = max(todouble(Payload.temperature)),
AvgTemp = avg(todouble(Payload.temperature)),
Readings = count()
by Hour = bin(EnqueuedTime, 1h)
| extend Compliant = MinTemp >= 18 and MaxTemp <= 22
| order by Hour asc
Step 3.2: Batch history
"Create a query that shows the complete history of a batch, across every zone."
Step 3.3: Pressure alerts
"Create a query for pressure readings outside 0.5-1.5 bar in the last hour."
AZI
Each query I propose is a starting point. Edit the KQL if you need different thresholds or time ranges, then save.
Phase 4: Give your team access
The owner adds teammates in Workspace -> Team Members: enter their email and click Invite. They are members at once. No AI can invite members, and the role picker in that window is not saved - what a member can change is set by access rights.
| Team | What they need |
|---|---|
| Engineering, IT | Workspace.Deploy to build connections; Workspace.Access.Manage to manage access |
| Process engineers, QA | Membership: any member can save and accept queries; some changes need a management right (see Permissions) |
| Operators | Membership, to read the surfaces and run the queries |
Access rights apply to the whole workspace; there is no per-surface permission. See Permissions.
Phase 5: Connect any AI over MCP
The OpenX MCP Server is at https://openx.fathym.com/ox-api/mcp. Sign in through the browser: in Claude.ai or
ChatGPT, add a custom connector and paste the URL; for coding agents, run
fai mcp install https://openx.fathym.com/ox-api/mcp --name openx and sign in when the browser opens. Setup for
each client is in Bring Any AI.
Then ask:
"What's the compliance status of the cleanroom over the last 24 hours?"
The AI calls your temp-compliance query with call_api and answers from it. If it wants to build something
new, it proposes it with manage_proposals, and a person accepts.
What you built
| Component | Count |
|---|---|
| Data sources | 2 connections, an API source and a simulator |
| Surfaces | 4 |
| Warm queries | 5 |
| Team access | Set |
| MCP clients | 1 or more |
What you can show
| Before | After |
|---|---|
| AI experiments in silos | Every AI client reads the same saved queries |
| Answers nobody can explain | The query behind each answer, there to read |
| Scattered compliance evidence | One workspace, organized by surface |
What OpenX records about changes, and how it maps to data-integrity requirements, is on the Compliance matrix.
Next steps
| If you want to... | Go to... |
|---|---|
| Try the hybrid track | Hybrid track |
| Learn KQL | KQL Basics |
| Connect more AI clients | Bring Any AI |
| See query patterns | Query Patterns |