Back to Projects
๐ŸขAICase Study

K-Trust โ€” Korean Market Compliance Portal

AI-powered B2B compliance verification system for South Korean merchants, auditing sellers using a live AI pipeline.

Next.js 15TypeScriptFastAPIPythonGemini 2.5 FlashPydanticFirebaseVercelRailway

Case Study

The Problem

Deciding whether a South Korean merchant is trustworthy means piecing together court records, tax filings and Naver/Kakao sentiment โ€” scattered, unstructured and in Korean. And when an LLM summarizes that, "mostly valid JSON" is not good enough: one missing field and the dashboard breaks.

My Approach

Enforced the output schema at generation time instead of parsing it afterwards: Pydantic models are passed to Gemini as response_schema, so every report comes back as typed JSON with trust score, legal status and public sentiment. Built prompt rubrics that simulate scraped court records, tax filings and Naver/Kakao sentiment as messy, unstructured LLM input. Split the architecture so Next.js on Vercel and FastAPI on Railway deploy independently.

The Result

A live compliance portal where every AI report matches the schema exactly โ€” no defensive JSON parsing or markdown stripping on the frontend. Merchant lookups are O(1) from a mock intelligence database.

Request Flow

  1. 01

    Next.js UI

    Merchant search on Vercel

  2. 02

    FastAPI

    O(1) lookup in the mock intelligence DB on Railway

  3. 03

    Gemini 2.5 Flash

    Reads unstructured court, tax and sentiment signals

  4. 04

    Pydantic Schema

    response_schema forces typed JSON at generation time

  5. 05

    Trust Report

    Trust score, legal status and sentiment, rendered as-is

Engineered for Reliability

Schema at generation

response_schema guarantees exact field types โ€” nothing to clean up afterwards.

Messy input by design

Prompt rubrics simulate real-world, unstructured Korean data sources.

Split deploys

Frontend on Vercel and backend on Railway ship and scale independently.

Async backend

Async FastAPI tasks keep latency low while Gemini does the heavy lifting.

What It Does

  • Audits South Korean merchants using a live AI pipeline
  • Uses Gemini 2.5 Flash to analyze raw market data and return structured risk reports
  • Features real-time trust scoring and legal status verification
  • Generates AI compliance summaries for B2B stakeholders

Challenges & Solutions

Challenge 1

Ensuring consistent structure in AI-generated risk reports from unstructured market data.

Solution

Implemented strict Pydantic schemas in FastAPI and prompt engineering to force Gemini into returning validated JSON objects.

Challenge 2

Processing high-volume merchant data without hitting LLM rate limits or latency bottlenecks.

Solution

Optimized the backend with asynchronous FastAPI tasks and utilized Gemini 2.5 Flash for its high-speed inference capabilities.

Challenge 3

Preventing LLM output from breaking the frontend when Gemini returns inconsistent JSON structures.

Solution

Used Pydantic response_schema enforcement in the new Gemini SDK to guarantee exact field types, eliminating the need for defensive JSON parsing or markdown stripping.

Project Gallery

K-Trust โ€” Korean Market Compliance Portal screenshot 1K-Trust โ€” Korean Market Compliance Portal screenshot 2K-Trust โ€” Korean Market Compliance Portal screenshot 3K-Trust โ€” Korean Market Compliance Portal screenshot 4

What I Learned

High-speed AI inference, FastAPI backend architecture, B2B compliance standards