AI-powered B2B compliance verification system for South Korean merchants, auditing sellers using a live AI pipeline.
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.
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.
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.
Next.js UI
Merchant search on Vercel
FastAPI
O(1) lookup in the mock intelligence DB on Railway
Gemini 2.5 Flash
Reads unstructured court, tax and sentiment signals
Pydantic Schema
response_schema forces typed JSON at generation time
Trust Report
Trust score, legal status and sentiment, rendered as-is
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.
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.




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