"A food contamination alert shouldn't take hours to trace. FoodGuard turns a contamination signal into a verified supply-chain impact map, quarantine actions, and an auditable DataHub incident in seconds."
Core Concept: "A food batch becomes an asset. Its distribution becomes lineage. A contamination alert becomes an incident. The agent turns lineage into action."
When a foodborne contamination event is discovered, the hardest question is finding out exactly where the food went.
A single contaminated harvest batch can move through processors, cold-storage facilities, distributors, retailers, and institutional buyers before an alert is issued.
Traditional incident response often depends on manually joining information across inventory systems, spreadsheets, logistics records, and databases.
That creates a dangerous gap between detecting contamination and knowing exactly what needs to be isolated.
FoodGuard closes that gap.
FoodGuard is an AI-driven food safety agent that uses DataHub's metadata graph and lineage as the context layer for supply-chain incident response.
When a contamination alert identifies a high-risk pathogen or affected batch, FoodGuard:
Ingests a contamination alert and identifies the affected pathogen, product, and source batch.
Starting from the affected batch, FoodGuard follows DataHub lineage across four downstream tiers:
Farm / Harvest Batch
│
▼
Processing Facility
│
▼
Cold Storage Hub
│
▼
Retailers / School Districts
The agent determines:
- Affected downstream locations (32 Stores, 14 School Districts)
- Affected inventory units (14,500 Units)
- Exposed consumers (~184,000 Consumers)
- Estimated financial exposure ($384,400 USD)
- Affected supply-chain nodes
FoodGuard synthesizes store-level quarantine actions, including barcode freezes (SKU-9921) and inventory lockouts.
The resulting safety incident is emitted back into DataHub's metadata layer with quarantine and recall metadata, creating an auditable record of what happened and what actions were taken.
FoodGuard isn't a chatbot sitting beside a data catalog. DataHub is the agent's source of truth.
The critical reasoning step is the lineage traversal:
FDA / USDA Alert
│
▼
Affected Batch
│
▼
DataHub Lineage Graph
│
├── Processing Facility
│ │
│ └── Cold Storage
│ │
│ ├── Retailer A
│ ├── Retailer B
│ └── School District
│
▼
Affected Downstream Assets
│
▼
Quarantine Actions
│
▼
SAFETY_RECALL Incident
│
▼
DataHub Metadata
This makes DataHub more than a lookup layer. The graph becomes the operational context that allows the agent to reason about the incident.
FoodGuard models the physical food supply chain as DataHub metadata.
Supply-chain objects are represented as DataHub datasets:
| Entity | DataHub Representation |
|---|---|
| Harvest Batch | Dataset (urn:li:dataset:(...,valley_farms.batch_894,PROD)) |
| Processing Lot | Dataset (urn:li:dataset:(...,pacific_fresh.line_2,PROD)) |
| Cold Storage Inventory | Dataset (urn:li:dataset:(...,seattle_cold.bay_4,PROD)) |
| Retail Inventory | Dataset (urn:li:dataset:(...,safeway_wa.stores_18,PROD)) |
| School District Inventory | Dataset (urn:li:dataset:(...,seattle_schools.kitchens_14,PROD)) |
FoodGuard uses explicit lineage relationships to represent movement and transformation:
TRANSFORMED_INTOLOGISTICS_DISPATCHFINAL_FULFILLMENT
This allows the agent to traverse the downstream impact of an affected batch instead of relying on static relationships.
Implemented an autonomous safety agent that parses USDA FSIS and FDA outbreak text alerts, extracts relevant product SKUs and batch URNs, and programmatically queries DataHub's metadata graph to map downstream blast radiuses and issue register lock directives without human intervention.
FoodGuard applies operational metadata tags such as:
RAW_INGREDIENTHIGH_RISK_PERISHABLEFDA_RECALL_TARGETQUARANTINE_LOCKEDFDA_CLASS_I
After the agent determines the affected downstream assets, it writes the incident back into DataHub's metadata layer via GraphQL:
SAFETY_RECALL
│
├── affected batch
├── affected lineage
├── quarantine status
├── recall classification
└── mitigation metadata
This creates an auditable connection between:
the original contamination signal
FoodGuard's central demo scenario starts with a Listeria monocytogenes contamination alert.
Contamination Alert ──> Find batch ──> Search inventory ──> Contact processor ──> Trace distribution ──> Identify stores ──> Create orders ──> Record incident
Multiple systems. Multiple manual lookups. High risk of missing a downstream dependency.
CONTAMINATION ALERT ──> DATAHUB LINEAGE TRAVERSAL ──> DOWNSTREAM IMPACT MAP ──> QUARANTINE ACTIONS ──> DATAHUB INCIDENT
┌─────────────────────────────┐
│ FDA / USDA Alert │
│ Pathogen + Batch Signal │
└──────────────┬──────────────┘
│
▼
┌─────────────────────────────┐
│ FoodGuard Agent │
│ │
│ Alert Interpretation │
│ Lineage Reasoning │
│ Impact Quantification │
│ Mitigation Generation │
└──────────────┬──────────────┘
│
▼
┌─────────────────────────────┐
│ DataHub Context │
│ │
│ Metadata Graph │
│ Lineage │
│ Tags │
│ Assertions │
│ Incidents │
└──────────────┬──────────────┘
│
▼
┌─────────────────────────────┐
│ 4-Tier Supply Chain │
│ │
│ Harvest → Processing │
│ → Cold Storage → Retail │
│ / School Districts │
└──────────────┬──────────────┘
│
▼
┌─────────────────────────────┐
│ Risk Engine │
│ │
│ Affected Nodes │
│ Inventory │
│ Consumers │
│ Financial Exposure │
└──────────────┬──────────────┘
│
▼
┌─────────────────────────────┐
│ Quarantine PR Generator │
│ │
│ Barcode Freezes │
│ Inventory Lockouts │
│ Store Actions │
└──────────────┬──────────────┘
│
▼
┌─────────────────────────────┐
│ DataHub Write-Back │
│ │
│ SAFETY_RECALL │
│ QUARANTINE_LOCKED │
│ FDA_CLASS_I │
└─────────────────────────────┘
DATAHUB FOOD/
├── LICENSE # Apache License 2.0
├── README.md # Production design doc & rubric score mapping
├── package.json # Next.js 15, React 19, Lucide, Tailwind
├── tsconfig.json # TypeScript config with @/* path aliases
│
├── app/
│ ├── globals.css # Glassmorphic & utility styles
│ ├── layout.tsx # Metadata & Root Layout
│ └── page.tsx # FoodGuard Emergency Control Room UI
│
├── lib/
│ ├── food-data.ts # USDA FSIS Outbreak Datasets (Boar's Head EST. 12612)
│ └── datahub-engine.ts # Sub-second Lineage Traversal & GraphQL Mutation Builder
│
├── ingestion/
│ └── foodguard_lineage.dhub.yaml # DataHub CLI Ingestion Recipe for GMS
│
└── examples/
├── foodguard_supply_chain_entities.json # DataHub GMS Entity Aspect Payload
├── FDA_CLASS_I_RECALL_NOTICE_REC-2026-894.md
├── POS_BARCODE_FREEZE_MANIFEST_SKU9921.json
└── DATAHUB_INCIDENT_WRITEBACK_PAYLOAD.json
- Node.js 18+
- npm
- DataHub GMS instance (optional for live GMS REST/GraphQL connection; pre-seeded demo mode included)
# 1. Clone & enter repository
git clone https://github.com/HillaryIkhais/FoodGuard.git
cd FoodGuard
# 2. Install dependencies
npm install
# 3. Run locally
npm run devThen open http://localhost:3000 in your browser.
FoodGuard is open-source software licensed under the Apache License, Version 2.0. See LICENSE for details.