What inspired us

A US soybean exporter ships $500,000 worth of goods to China. They find out after the contract is signed that China has a 25% retaliatory tariff on US agricultural goods on top of the 3% MFN duty. That's $140,000 in lost margin on a single shipment discovered too late to do anything about it.

This is not an edge case. Over $180 billion in US exports are hit by retaliatory tariffs annually, and most mid-market exporters have no tool to simulate this before committing.

What we built

TariffLens — a tariff risk simulator for US exporters.

  1. Upload an invoice or trade document → Mistral AI reads it and extracts the product, HS code, destination, and shipment value automatically
  2. We look up the current effective tariff: MFN baseline duty + any retaliatory tariff the destination country has placed on US-origin goods
  3. We simulate 3 scenarios: Today / Escalation / Reroute to alternative market — with exact dollar impact on your shipment
  4. Groq (llama-3.3-70b) generates a plain-English risk summary and one specific recommendation

The homepage shows a live scrolling tariff ticker pulling real-time data from Supabase, refreshing every 30 seconds. A background scraper hits USTR.gov every hour via Composio and pg_cron.

How we built it

Layer Technology
Frontend React + Vite + TypeScript + Tailwind + shadcn/ui
AI reasoning Groq llama-3.3-70b-versatile
Document extraction Mistral pixtral-12b-2409
Database + functions Supabase Postgres + Edge Functions
Scraping + alerts Composio (Firecrawl + Gmail)
Data pipeline Airbyte Cloud (CSV → Postgres)
Deployment Render

The entire backend runs as Supabase Edge Functions — no separate server. extract-shipment calls Mistral, simulate-tariff calls Groq, send-alert calls Composio, scrape-tariffs runs on pg_cron every hour.

Challenges

  • Supabase free tier blocks external Postgres connections — Airbyte couldn't connect directly. We solved this by seeding the data via SQL migration and using Airbyte for the pipeline architecture demonstration, with Composio handling the live scraping instead.
  • Composio's Firecrawl connector was on a deprecated API version — we fell back to direct HTTP scraping from USTR.gov while keeping Composio for the email alert integration.
  • Getting Mistral to reliably extract HS codes from real invoice images required careful prompt engineering — the model needed explicit instructions to infer HS codes from product descriptions when not explicitly printed.

What we learned

Retaliatory tariffs are shockingly underdocumented for exporters. The data exists (USTR, trade.gov, WTO) but it's scattered, unstructured, and not connected to any decision tool. The gap between "data exists" and "exporter can act on it in 30 seconds" is exactly where TariffLens sits.

Try it

Go to https://tariff-lens.onrender.com → Simulate a shipment → Soybeans + China + $500,000 → see the $140,000 tariff hit and AI recommendation in under 30 seconds.

https://github.com/1krrishg/tariff-lens

Built With

Share this project:

Updates

posted an update

TariffLens shipped today at tariff-lens.onrender.com

Upload a trade invoice → Mistral reads it → we show your tariff hit, 3 scenarios, dollar impact, and one AI recommendation. Powered by Groq, Supabase, Composio, Render & Airbyte.

What's next:

→ Tariff probability scoring = "68% chance this rate escalates in 90 days" based on negotiation timelines, election cycles, and WTO dispute filings

→ Full HS code coverage = expanding from 9 product categories to every US export category. Scraper already runs hourly.

→ Portfolio mode = upload your full export portfolio, get your total retaliatory tariff liability in one number

→ Real-time alerts = rate changes trigger instant Composio alerts to every exporter who simulated that route

The pipeline is live. The data is real. The seed round is next.

Log in or sign up for Devpost to join the conversation.