Inspiration 500 million small and medium businesses want to trade across borders. Large corporations have compliance teams, trade lawyers, and intelligence desks. SMEs have nothing. A single missed certificate, wrong HS code, or unscreened sanctioned supplier can result in seized shipments, fines, or criminal liability. A tailor in Lagos, a ceramics manufacturer in Hanoi, an electronics supplier in Kuala Lumpur — they all face the same wall: global trade compliance is expensive, opaque, and inaccessible. We asked: what if an AI agent could do in 90 seconds what takes a trade compliance officer half a day? What it does DutyBreak is a 5-agent agentic trade compliance co-pilot. Input a product, an origin country, and a destination country — five AI agents run in sequence and return a full compliance brief. The brief includes:

HS tariff code classification (6-digit Harmonized System) MFN and preferential duty rates, applicable trade agreements Required certificates, import licenses, and labeling laws Real-time sanctions screening against OFAC, EU, and UN lists Prioritised action items with estimated clearance timeline and cost impact Overall risk rating: LOW / MEDIUM / HIGH / BLOCKED

Three scenarios that demonstrate the range:

Lithium-ion batteries (CN → DE): 2.7% MFN duty, CE/RoHS/UN38.3 requirements, MEDIUM risk due to missing supplier Ceramic kitchenware (VN → US): FDA lead/cadmium leaching regulations, anti-dumping circumvention risk Industrial steel pipes (IR → US): BLOCKED — OFAC Iranian Transactions Regulations, full sanctions halt

How we built it Agent Architecture (LangGraph) Five agents run sequentially on a shared state object: Input: product + origin + destination ↓ [1] ClassifierAgent → HS code (6-digit Harmonized System) ↓ [2] TariffAgent → MFN/preferential rates, trade agreements ↓ [3] ComplianceAgent → certificates, licenses, labeling laws ↓ [4] SanctionsAgent → OFAC / EU / UN sanctions screening ↓ [5] DocumentAgent → full compliance brief + action items ↓ Output: structured JSON compliance package Each agent is independently testable and modular. The LangGraph workflow manages state passing between agents, enabling clean separation of concerns and easy extensibility. Stack

Orchestration: LangGraph (agent pipeline) LLM: Gemini 3.5 Flash via Google AI Studio API Backend: FastAPI (Python) Deployment: Google Cloud Run Frontend: React + Vite (dark intelligence terminal UI) Data Sources: WTO Tariff Database, OFAC SDN, EU Consolidated Sanctions List, UN Security Council Sanctions

Challenges we ran into

  1. Model deprecation mid-build. Google deprecated gemini-2.0-flash and gemini-2.0-flash-lite during development, requiring rapid pivoting to gemini-3.5-flash and switching from the Vertex AI SDK to direct REST API calls via httpx.
  2. API key security incident. A server.log file containing API keys was accidentally committed to the GitHub repository. Bots harvested the keys within hours and initiated $168 in fraudulent cloud resource usage. We rotated all credentials, removed the file from git history, secured the repository, and filed a Google Cloud billing appeal. This reinforced the importance of .gitignore discipline and secret scanning.
  3. LangGraph state threading. Getting clean state passing between 5 agents with proper error isolation required careful design — each agent catches its own exceptions and appends to an errors list rather than failing the whole pipeline. Accomplishments that we're proud of

A fully working 5-agent pipeline deployed on Google Cloud Run producing real, accurate compliance briefs The BLOCKED output for Iran → US correctly cites 31 CFR Part 560 (OFAC Iranian Transactions and Sanctions Regulations) The pipeline correctly identifies the EVFTA preferential rate reduction for Vietnam → EU trades Clean modular architecture where each agent can be upgraded or replaced independently The UI animates the agent pipeline in real time as agents complete

What we learned

Agentic pipelines require careful state management — shared mutable state across 5 agents needs explicit error boundaries LLM responses for structured data (JSON) need robust regex fallbacks, not just JSON.parse Google Cloud model availability changes fast — hardcoding model names is a liability Never commit log files to git

What's next Integration roadmap:

WEPort (our freight booking platform): DutyBreak becomes the compliance intelligence layer before freight is booked. Every shipment gets auto-screened before payment is processed. StockUp (financial analytics): tariff shock signals feed into market intelligence. When a major tariff changes, affected sector stocks get flagged. Regulatory monitoring agent: a 6th agent that watches for tariff changes, sanctions updates, and regulatory amendments in real time and re-screens active shipments

Product expansion:

Document generation (auto-fill customs entry forms) Supplier risk scoring over time Multi-leg route optimization considering tariff arbitrage

Built With

Share this project:

Updates