All Things Logistics: Autonomous Gemini 3.7 & BigQuery Fleet for the Deskless Supply Chain

Track: Fortified Enterprise Fleet
Live Production URL: https://logistics.campabadal.com

GitHub Repository: https://github.com/CostaCloudSA/all-things-logistics

💡 Inspiration (What Inspired me)

Global cross-border trade is a multi-trillion-dollar artery connecting growers, manufacturers, carriers, and consumers. Yet, over 80% of the logistics workforce is deskless—forklift drivers, cross-dock loaders, long-haul truckers, customs brokers, and maritime terminal superintendents working in noisy, dirty, high-vibration environments. Almost all enterprise supply chain software is built for office workers sitting behind dual monitors. Frontline workers are forced to manually re-type data across paper bills of lading, customs declarations, and weigh-scale slips—spending up to 45 minutes per shipment on manual data entry while risking \$10,000+ fines for axle weight violations or cabotage infractions. To ground our system in reality, I conducted an operational discovery interview with my father Jorge Campabadal, an industry veteran with decades of experience managing and interacting with shipping lines, port terminals, customs brokerage, and heavy motor carrier fleets across the Americas.

What Textbook Logistics Programming with LLMs Missed:

  1. The Axle Load Trap: A 20-ton container with legal gross weight can still violate non-linear Federal Bridge Formula laws, triggering \$2,500+ fines and driver license penalties.
  2. The 90% Re-Typing Bottleneck: Mexican tractors cannot legally enter Guatemala under cabotage laws. Cargo must be cross-docked at Tecún Umán, where workers manually re-type 90% of the data into customs terminals.
  3. The 24/7 Night-Watch Drain: Companies pay overnight staff solely to watch GPS dots and send WhatsApp status pings every 2 hours to verify cold-chain atmosphere.
  4. Non-Resident Tax Surprises: Exporters are blindsided when Central American tax authorities deduct 15–20% statutory income tax withholding at source unless shielded by Double Taxation Avoidance treaties.
  5. Border Connectivity Dead Zones: Checkpoints and container aprons are frequent cellular dead zones where trust must be verified 100% offline via cryptography.

When Google released Gemini 3.7 Flash on August 13, 2026, featuring hybrid reasoning speed and structured output capabilities, I asked myself: Can I build a production-grade agentic autonomous logistics fleet across a 4-company enterprise conglomerate in less than 4 weeks?


🛠️ What It Does

All Things Logistics coordinates a 12-agent autonomous fleet powered by Gemini 3.7 Flash, hardened with Dual-Defense Model Armor (Local Gemma PII Sanitizer + Deterministic BigQuery Grounding), and supported by a Unified BigQuery Enterprise Data Mesh:

  • 🏢 4-Company Conglomerate Flywheel: 1-click dynamic switching between 4 distinct supply chain subsidiaries:
    1. Campabadal Global (3PL Brokerage): Multimodal invoice OCR, real-time HS tariff classification, CIF landed valuation, CAFTA-DR duty elimination (+\$6,975 USD saved on 44k lbs), and Golden DUCA-T synthesis.
    2. Transportes Tomas (Motor Carrier Fleet): Dynamic 23 CFR § 658 Federal Bridge Formula axle auditing, exact forward pallet shift calculations, and <90s cabotage relay tractor pairing.
    3. Agroexport Costa Rica (Produce Shipper): Automated Article 7 Double Taxation Avoidance (DTA) treaty tax shield (+\$4,250 USD net cash saved per container) and USDA/MAG phytosanitary compliance.
    4. Naviera Don Jorge (Ocean Line & Terminal): 48-hour demurrage cliff prediction (+\$150/day saved) and IMO 3D vessel transverse stability balancing.
  • 📱 Adaptive 2 x 4 Tactile Macro-Grid (Zero-Typing UX): Large squircle touch targets, voice capture, and contextual Guided Smart Chips ([🍗 20T Poultry], [🍍 Pineapples], [🥑 Hass Avocados], [⚖️ Bridge Formula]) designed for deskless workers with work gloves.
  • 🔏 100% Offline Optical Ed25519 Cryptographic QR Seals: Asymmetric digital signatures verified on-device by highway police in <0.01s with zero network pings.
  • 🔍 Devpost Judges Live Trace Inspector: An embedded auditing tool allowing judges to inspect real-time BigQuery SQL queries, Local Gemma PII sanitization logs, W3C traceparent headers, and 97.7% prompt token reduction metrics.
  • 🤝 Cross-Tenant B2B A2A Federation: Enables independent corporate instances to exchange manifests with unbroken W3C distributed trace context.

🏗️ How I Built It

I built All Things Logistics in under 4 weeks by pairing continuously with Google Antigravity:

  1. Hybrid AI Swarm Orchestration:
    • Gemini 3.7 Flash: High-speed hybrid reasoning, vision OCR parsing of degraded bills of lading, and multi-agent coordination.
    • 12 Micro-Agents: FleetOrchestratorAgent, OCRDocumentParserAgent, HSClassificationAgent, ValuationTariffAgent, SanitaryRegulatoryAgent, GoldenDocumentGenAgent, NightWatchTelematicsAgent, BridgeFormulaAuditorAgent, VendorInvoiceMatcher, TransloadRelayAgent, LegalWatchdogAgent, and SanctionsScreener.
  2. Dual-Defense Model Armor Layer:
    • Tier 1 (On-Device Local Gemma): Tokenizes sensitive tax IDs (EIN, RFC, NIT, CNPJ, SSN) before prompt dispatch.
    • Tier 2 (Deterministic BigQuery Truth Gate): Verifies tariff percentages, treaty exemptions, and statutory formulas directly against BigQuery SQL tables.
    • Tier 3 (Ed25519 Cryptographic Signer): Signs canonicalized JSON payloads with PyNaCl/cryptography.
  3. Unified BigQuery Enterprise Data Mesh:
    • 6 tenant-partitioned datasets: ds_fleet_telematics, ds_customs_compliance, ds_workforce_hr_payroll, ds_warehousing_wms, ds_deskless_crm, and ds_finance_billing.
  4. Multi-Platform Frontend (Flutter Web & Mobile):
    • 4 operational tabs, 4 corporate persona themes, tactile macro-grid, and DeviceFrame live preview.
  5. Production Google Cloud Infrastructure (IaC via Terraform):
    • Multi-region Google Cloud Run v2, Cloud Pub/Sub, Cloud Build, and least-privilege Zero-Trust IAM service accounts.

🧗 Challenges Faced

  1. Non-Linear Bridge Formula Weight Modeling: Translating statutory 23 CFR § 658 axle distribution mathematics into deterministic agent constraints: $$W = 500 \cdot \left( \frac{L \cdot N}{N - 1} + 12N + 36 \right)$$ I solved this by creating a dedicated BridgeFormulaAuditorAgent that calculates exact center-of-gravity shifts and re-stowage instructions.
  2. Zero-Hallucination Compliance in Legal Trade Filings: An LLM hallucination on a customs declaration can trigger cargo impoundment. I overcame this with our Dual-Defense Model Armor: LLMs suggest candidate classifications, but deterministic BigQuery SQL truth gates enforce the legal tariff rates and statutory math.
  3. Designing for Deskless Operators in Harsh Environments: Frontline operators cannot type on small touchscreens while wearing work gloves in dusty cross-docks. I iterated through multiple UI paradigms before converging on the Adaptive 2 x 4 Tactile Macro-Grid with large touch targets and smart chips.
  4. Offline Trust Verification in Cellular Dead Zones: Remote border bridges (such as Tecún Umán) lack continuous internet. I embedded asymmetric Ed25519 signatures into high-density QR codes verified locally in milliseconds.

🧠 What I Learned

  1. SME Grounding Trumps Textbook Theory: The most impactful supply chain optimizations (cabotage cross-docking, Bridge Formula axle limits, withholding tax shields) may be absent from textbook APIs and exist only in operator intuition.
  2. Deterministic Gates Make LLMs Enterprise-Ready: Combining probabilistic LLM reasoning (Gemini 3.7 Flash) with deterministic truth tables (BigQuery SQL) provides the ideal balance of natural language flexibility and zero-hallucination compliance.
  3. Single-Thread Antigravity Velocity: Pairing continuously with Google Antigravity enabled me to architect backend microservices, write security whitepapers, implement Flutter UIs, and deploy Terraform IaC in under 4 weeks.

🏆 Accomplishments I'm Proud Of

  • Automated $6,975 USD Duty Savings: Per 44,000 lbs shipment via automated 0% CAFTA-DR rule matching.
  • Automated $4,250 USD Protected Cash Flow: Per export container via automated DTA Article 7 tax shields.
  • \$150/Day Demurrage Risk Avoidance: Real-time 48-hour container free-time expiration alerts.
  • 97.7% Prompt Token Reduction: Efficient structured micro-agents ($420$ tokens vs $18,500$ monolithic baseline).
  • 0.00s Offline Verification: Ed25519 asymmetric optical QR scanning in cellular dead zones.
  • \$0.00 Infrastructure Waste: Currently Powered by BigQuery's Always Free tier and Cloud Run scale-to-zero.
  • Live Production Cloud Run Deployment: Serving 100% of live traffic at https://logistics.campabadal.com.

🚀 What's Next for All Things Logistics

  • Autonomous Fleet Dispatch Bridge: Direct API integration with autonomous freight networks (Waymo Via, Kodiak) for autonomous highway transfers.
  • Maritime AI Vessel Stowage Optimizer: 3D ballast balancing engine maintaining ship list across multi-port rotations.
  • Computer Vision Seal Auditor: Edge camera container OCR cross-referencing bills of lading to detect unauthorized gate-outs.

Built With

Share this project:

Updates

Submission history