Skip to main content
OIL-02 · Oil, Gas & Mining

Safety Incident Learning Assistant

Outcome​

Turn safety incidents, near misses, and observations into transferable learning by clustering causal patterns across sites and linking them to the standards and permits that should have prevented them, with HSE approval before actions are issued.

Portfolio attributeValue
Primary personaHSE specialist
Primary aggregateSafetyLearningCase
Cosmos DB containers2
Grounding dataincidents, observations, permits, standards
Development estimateUSD 60-220 monthly dev estimate
Runtime optionsPython FastAPI and C# ASP.NET Core

Productivity hypothesis​

These measures reflect the workflow, evidence, decision boundary, and industry risk for this use case.

Impact typeMeasureConservative internal assumptionCustomer measurement
ProductivityFirst-pass acceptance5-12 percentage-point improvementassisted percentage accepted without material rework - baseline percentage accepted without material rework
Quality or riskRework rate5-10% reduction(baseline reopened, corrected, or repeated task rate - assisted rate) / baseline rate * 100

Important: Conservative internal pilot assumptions only; not public benchmarks, commitments, or expected customer results. Validate against a comparable baseline or matched control cohort with mandatory human review.

Rationale: HSE teams can produce more complete learning summaries with fewer correction loops while retaining safety authority.

Pilot guardrail: Do not make safety determinations; cite incidents, observations, permits, and standards and expose conflicts.

Customer validation plan​

  1. Baseline the current workflow with representative users and tasks.
  2. Run the accelerator on the same task mix with human review retained.
  3. Measure first-pass acceptance and rework rate with the documented formulas.
  4. Replace internal assumptions with customer-observed results before a business case.

Why Azure Cosmos DB​

This AI solution needs an operational data plane, not only a vector index:

  • Hybrid vector and full-text retrieval combines semantic recall with exact identifiers, codes, names, and domain language.
  • Hierarchical partition keys and metadata predicates keep tenant and domain boundaries in the normal query path.
  • Operational JSON, source chunks, workflow and agent state, feedback, and audit records remain together for low-latency reads and governed writes.
  • Change feed reacts to source and operational updates without polling.
  • Autoscale throughput, configurable consistency, and multi-region distribution support variable demand and enterprise availability.

Domain workflow​

Domain workflow

StageActorInput → outputApproval
1. Capture the incident or observationField worker or supervisorIncident report, near miss, or hazard observation → Structured record with activity and energy sourcePolicy controlled
2. Classify severity and control failureClassification agentEvent narrative and permit record → Actual and potential severity with failed control categoryPolicy controlled
3. Cluster causal patterns across sitesPattern analysis agentHistoric incidents and observations → Causal themes and recurrence evidencePolicy controlled
4. Map themes to standards and controlsStandards mapping agentCausal themes and safety standard clauses → Gap analysis between expected and actual controlsPolicy controlled
5. Approve and issue learning actionsHSE managerProposed actions with target sites → Issued actions with verification plansHuman required

Technical architecture​

Technical architecture

Cosmos DB data model​

ContainerHierarchical partition keyDocumentsSearch paths
safetyLearningCases/tenantId, /operatingSiteIdSafetyLearningCase, IncidentReport, SafetyObservation, PermitRecord, LearningAction/eventNarrativeVectorEmbedding, /observationVectorEmbedding, /actionVectorEmbedding, /eventNarrativeVector, /observationVector, /actionVector
safetyStandardsLibrary/tenantId, /standardIdSafetyStandardClause/clauseVectorEmbedding, /clauseVector

Query contract​

QueryContainerScopePurpose
Site learning case assemblysafetyLearningCasessingle-partitionRead the case with its incidents, observations, and permits in one site partition query.
High-potential near miss scansafetyLearningCasescross-partition-boundedBounded cross-partition control-plane query: surface low-consequence events whose potential severity was severe. It cannot carry the second partition key because learning value comes precisely from comparing near misses across sites, so it runs as a tenant-scoped scheduled sweep off the interactive path, bounded by near-miss classifications inside a 90-day occurredUtc window, executed with MaxItemCount paging and continuation tokens.
Recurring hazard by activitysafetyLearningCasessingle-partitionCount observations by hazard category for a specific high-risk activity type.
Open action verificationsafetyLearningCasescross-partition-boundedBounded cross-partition control-plane query: list issued learning actions whose verification is still outstanding. It cannot carry the second partition key because the HSE assurance report is a multi-site compliance view, so it runs as a tenant-scoped scheduled sweep off the interactive path, bounded by issued actions with no verifiedUtc inside the 60-day closure target, executed with MaxItemCount paging and continuation tokens.

Python and C# services route each document type to its declared container and hierarchical partition key. ETag-based writes protect mutable aggregates, while append-only records and bounded cross-partition queries preserve scale.

Azure deployment​

Azure deployment

Clone the source repository, authenticate with Azure, and run:

Set-Location accelerators/oil-gas-mining/safety-incident-learning-assistant
az login
./Deploy.ps1 -Runtime python -Location eastus2

Change python to csharp to deploy the .NET implementation.

Explore the implementation​

Return to all accelerators