TerraFuse — The Decision Firewall for Sustainable Procurement

AI-powered pre-procurement intelligence that intercepts high-impact purchases, calculates environmental impact deterministically, and generates lower-impact circular alternatives before money is spent.


Inspiration

Enterprise sustainability is usually measured after the decision has already been made.

A company buys materials. The supplier manufactures them. The shipment travels hundreds or thousands of kilometers. The product is used once. The material eventually becomes waste.

Months later, the organization calculates its environmental footprint for an annual ESG report.

At that point, the procurement decision is already irreversible. Capital has left the bank, fossil fuels have been burned, and plastic is buried in a landfill.

We asked:

Why do enterprises have automated firewalls for cybersecurity, fraud, and compliance, but no equivalent decision firewall for environmental risk at the moment a purchase is being approved?

That question became TerraFuse.

TerraFuse moves sustainability upstream — from retrospective reporting to pre-procurement intervention.

Instead of asking:

"How much carbon did we emit?"

after the purchase has happened, TerraFuse asks:

"Should we approve this purchase in the first place, or is there a circular, lower-impact alternative before money is spent?"


The Problem

Procurement teams make thousands of purchasing decisions involving:

  • Primary and secondary packaging
  • Single-use office and facility supplies
  • Corporate event signage and display collateral
  • Bulk plastics, polymers, and raw construction materials
  • Freight logistics and expedited distribution routes
  • Disputed manufacturer environmental claims

Over 80% of an organization's carbon footprint and post-consumer landfill waste originates in these indirect supply chain purchases (GHG Protocol Scope 3).

Yet procurement software traditionally optimizes around:

  • Price
  • Delivery speed
  • Supplier credit
  • Quantity
  • Commercial terms

Environmental consequences are handled separately through retrospective sustainability reporting.

This creates a fundamental timing problem: by the time environmental reporting identifies a bad purchasing pattern, the money has already been spent and the physical environmental impact has already occurred.

TerraFuse puts environmental intelligence directly into the procurement decision.


The Idea

TerraFuse is a Decision Firewall for corporate procurement.

Think of a cybersecurity firewall:

TRAFFIC ➔ POLICY CHECK ➔ ALLOW / BLOCK / REVIEW

TerraFuse applies the same principle to procurement:

PURCHASE REQUEST ➔ DOCUMENT UNDERSTANDING ➔ ENVIRONMENTAL ANALYSIS ➔ DETERMINISTIC IMPACT CALCULATION ➔ POLICY FIREWALL ➔ ALLOW / FLAG / BLOCK ➔ CIRCULAR ALTERNATIVES ➔ HUMAN REVIEW ➔ AUDITABLE DECISION

The goal is not to replace the procurement officer. The goal is to make the procurement officer impossible to surprise or greenwash.


What it does

A procurement officer can upload vendor quotes, invoices, spec sheets, spreadsheets, or photographs of receipts. TerraFuse then performs a complete 10-step intelligence workflow:

  • 1. INGEST
    Ingests documents across PDF, DOCX, XLSX, CSV, TXT, and camera photos or scans of receipts (.png, .jpg, .jpeg, .webp).

  • 2. UNDERSTAND
    Google Gemini 3.5 Flash Multimodal AI identifies procurement facts: supplier, item, virgin vs. recycled material grades, quantity, price, mass (kg), logistics distance (km), reuse cycles, and environmental disclosures.

  • 3. STRUCTURE
    Converts data into a validated decision model, strictly distinguishing between Known Facts, Inferred Information, Standard Assumptions, and Missing Data Gaps.

  • 4. CALCULATE
    Environmental impact is NOT generated or hallucinated by the LLM. A deterministic calculation engine applies documented mathematical formulas and published emission databases (UK DEFRA 2024, US EPA WARM v16, and PlasticsEurope).

  • 5. FIREWALL
    The procurement request is evaluated against explicit environmental policy gates:

    • Circularity Gate: Flags items with < 10% regional recyclability in single-use scenarios.
    • Single-Use Ban Gate: Flags unrecyclable virgin polymer films and short-lived event vinyls.
    • Uncertainty & Greenwashing Gate: Flags quotes claiming "eco-friendly" status without citing verified ISO 14025 Type III Environmental Product Declarations (EPDs).
  • 6. COMPARE
    TerraFuse generates lower-impact circular alternatives (e.g., swapping virgin poly mailers for 100% recycled padded kraft mailers) and evaluates them using the exact same calculation engine.

  • 7. REVIEW & PERSONAS
    Procurement specialists, CSOs, and compliance auditors can adjust assumptions, simulate reuse cycles, and immediately see the financial and carbon consequences.

  • 8. SIDE-BY-SIDE MATRIX
    Evaluates competing quotes side-by-side: Carbon Delta (net CO₂e avoided), Landfill Diversion (waste kept out of landfills), Cost Delta, and Net Environmental ROI ($ invested per metric ton of carbon permanently avoided).

  • 9. AUDIT
    Every status change, reviewer note, and policy override is permanently persisted in an immutable audit trail.

  • 10. VERIFY
    TerraFuse generates a print-ready, tamper-evident verification certificate containing the complete decision information, factor references, audit logs, and an official SHA-256 cryptographic verification seal.


The TerraFuse Difference

Most AI sustainability applications follow a pattern like:

DOCUMENT ➔ AI ➔ "Estimated carbon footprint: X"

TerraFuse deliberately does NOT trust the LLM to invent environmental numbers. In enterprise compliance, unverified LLM hallucinations create massive legal and greenwashing liability.

Instead, TerraFuse enforces an uncompromising architectural separation:

UNSTRUCTURED PROCUREMENT DATA ➔ GEMINI VISION ➔ STRUCTURED FACTS / ASSUMPTIONS ➔ PUBLISHED ENVIRONMENTAL FACTORS ➔ DETERMINISTIC MATHEMATICS ➔ AUDITABLE RESULT

  • AI is used where probabilistic reasoning is useful (extracting messy data from scanned invoices and receipts).
  • Deterministic software is used where mathematical reproducibility matters (lifecycle carbon math and legal auditability).

System Architecture

🔄 The End-to-End Decision Pipeline

[1. Intake Layer] ➔ [2. Gemini Vision OCR] ➔ [3. Deterministic LCA Engine] ➔ [4. Policy Firewall] ➔ [5. Circular Alternatives] ➔ [6. Multi-Quote Matrix & SHA-256 Audit]


📋 Layer-by-Layer Architectural Breakdown

Architectural Layer Core Technologies Primary Function
1. Multi-Format Ingestion pdf-parse, mammoth, xlsx, multer Extracts text and binary streams from PDFs, spreadsheets, Word docs, and photos up to 15 MB.
2. Multimodal Vision OCR Google Gemini 3.5 Flash (Base64 Stream) Extracts vendor, material grades, unit counts, mass (kg), logistics distance, and environmental claims.
3. Epistemic Data Model TypeScript + Zod Schemas Validates data into Known Facts, Inferred Data, Standard Assumptions, and Information Gaps.
4. Deterministic LCA Core UK DEFRA 2024 + US EPA WARM v16 100% reproducible mathematics for CO₂e, landfill waste, and water usage (Zero AI hallucination).
5. Pre-Procurement Firewall Automated Rule Evaluator Real-time policy gates: Circularity Gate (< 10% recyclability), Single-Use Ban, and EPD verification.
6. Circular Alternatives Physics-Matched Alternative Matrix Proposes verified low-carbon substitutes (e.g. 100% PCR Kraft, modular aluminum) with identical math.
7. Multi-Quote Comparison Dynamic Comparison Matrix Side-by-side bid analysis: ΔCO₂e, ΔCost, landfill diversion, and Net Environmental ROI ($/tCO₂e avoided).
8. Audit & Cryptography Native crypto (SHA-256) + .data/ Generates tamper-evident, print-ready ESG audit certificates with immutable cryptographic verification.

How we built it

TerraFuse is built on an enterprise-grade full-stack TypeScript architecture designed for microsecond latency, zero runtime bloat, and ironclad stability:

  • Frontend UI (Vercel): React 18, Vite, TypeScript, Tailwind CSS v4, Radix UI accessible headless primitives, Lucide React icons, and Framer Motion. Uses TanStack React Query for declarative server-state management and Recharts for dynamic carbon trajectory visualizations.

  • Backend API Engine (Render): Node.js v22 LTS with Express 5, running an ultra-lean persistent storage engine (.data/) with capped V8 memory (--max-old-space-size=350) that runs at just 96 MB RAM (<19% of Render's free tier).

  • Multimodal AI: Google Gemini 3.5 Flash with structured JSON schema enforcement (validated via Zod) to eliminate prompt drift, backed by an intelligent deterministic fallback rule engine.

  • LCA Math Engine: 100% deterministic formulas evaluating production impact, freight emissions, reuse amortizations, and end-of-life landfill mass:

Total CO₂e (kg) = [(Mass × Production Factor) / Reuse Cycles] + (Mass in Tonnes × Distance in km × Freight Factor) + (Mass × End-of-Life Factor)

Landfill Waste (kg) = Mass × (1 - Regional Recyclability Rate) × (1 / Reuse Cycles)

  • Universal ERP Webhooks: Real-time webhook intake endpoint (POST /api/integrations/webhook/po-intake) compatible with standard procurement ERP formats (SAP Ariba, Coupa, Oracle NetSuite, Workday).

Challenges we ran into

  • The 512 MB Free-Tier Memory Ceiling & The 333 MB WASM Dilemma: On Render's 512 MB memory tier, our server initially crashed with Out-Of-Memory (OOM) errors. Heap profiling revealed that @electric-sql/pglite allocated 333.4 MB of unshrinkable WebAssembly memory upon cold boot. We engineered an ultra-lean, zero-WASM persistent storage engine (.data/) with lazy-loaded document parsers. Server boot RSS plummeted from 365 MB to 96 MB, guaranteeing 100% uptime with zero crashes.
  • Eliminating Generative Hallucination in Climate Math: Early experiments prompting LLMs to estimate emissions produced wildly fluctuating numbers on the same quote. In enterprise procurement, irreproducible metrics invite regulatory penalties. We strictly bifurcated the pipeline: Gemini only extracts physical facts, while emissions calculations are executed in pure, deterministic TypeScript using audited DEFRA 2024 and EPA WARM tables.
  • Handling Messy Invoices & Low-Quality Scanned Receipts: Corporate procurement documentation ranges from clean digital PDFs to crumpled warehouse receipts photographed in poor lighting. We implemented a dual-tier intake layer: clean documents are parsed via fast text stream extractors, while image files and non-extractable PDFs are piped directly into Gemini 3.5 Flash Multimodal Vision.

Accomplishments that we're proud of

  • 🌿 The First Pre-Procurement Decision Firewall: Shifting corporate sustainability from post-facto retrospective accounting to real-time, preventative intervention before purchase orders are signed.
  • ⚡ The 96 MB Memory Footprint: Running a complete multimodal ingestion, OCR, and deterministic LCA engine under 100 MB of RAM, achieving enterprise-grade responsiveness on cloud infrastructure.
  • 🧮 100% Deterministic & Auditable Environmental Physics: Zero generative hallucinations in all carbon, water, and landfill figures, fully aligned with UK DEFRA 2024 and US EPA WARM v16 standards.
  • 📜 Tamper-Evident Cryptographic ESG Certificates: Downloadable, print-ready verification certificates sealed with SHA-256 hashes for immutable compliance records.
  • 📊 Multi-Quote Environmental ROI Matrix: Empowering buyers to see exactly how much carbon they abate per dollar spent across competing supplier bids.
  • 🧪 12/12 Passing Automated Test Suite: Full end-to-end test coverage across document extraction, deterministic mathematics, decision firewall rules, and API endpoints.

What we learned

  • AI is an Interface, Not a Calculator: Generative AI is unmatched at transforming messy human paperwork into structured data models, but scientific calculations and compliance enforcement must always belong to deterministic code.
  • Timing is Everything in Climate Impact: Preventing 10 metric tons of single-use plastic procurement at the purchasing cart is exponentially more cost-effective than attempting to remediate or offset it 12 months later.
  • Enterprise Usability Requires Empathy for Buyers: If a sustainability tool slows down procurement officers with complex jargon, it will be bypassed. By offering instant circular alternatives, price deltas, and automated policy approvals, sustainability becomes a frictionless business enabler.

What's next for TerraFuse

  • 🔌 Native SAP Ariba & Coupa App Marketplace Plugins: Deploying TerraFuse as a native "one-click approval interceptor" directly inside Fortune 500 procurement suites.
  • 🏢 Supplier EPD Self-Service Portal: Allowing vendors to upload their own third-party ISO 14025 Environmental Product Declarations to automatically clear firewall gates.
  • 📈 Automated CSRD & SEC Scope 3 Compliance Export: One-click generation of auditable Scope 3 GHG Protocol filings directly from certified pre-procurement decisions.
  • 🏅 Supplier Circularity Scorecards: Automated vendor leaderboards that reward circular suppliers with preferred-vendor status across enterprise buying consortiums.

Built With

Share this project:

Updates

Submission history