From question to verified answer — how Lawmadi OS works
Every legal query passes through a 4-stage pipeline to produce verified answers. Each stage has independent failure detection and recovery. If verification fails, the system blocks the answer (Fail-Closed policy).
NLU intent analysis assigns the optimal leader from 60 specialists while simultaneously searching Vertex AI Search and the statute cache for relevant laws and precedents. 3-tier routing classifies queries: greeting, non-legal, or legal.
Injects the assigned leader's core statutes (LAW_BOOST), links delegation clauses and enforcement decree forms via 3-tier comparison, and pre-fetches full article text from the DRF API to maximize accuracy.
Gemini 2.5 Flash generates answers via real-time SSE streaming, using the leader's persona and RAG context. Responses follow a 5-step framework: Empathize, Diagnose, Action Roadmap, Safety Net, and Closing.
Every statute, precedent, and constitutional court decision cited in the answer is cross-verified in real-time against Korea's National Law Information Center (law.go.kr) DRF API. If unverified citations exceed 0.1%, the answer is blocked. Verified corrections replace text in real-time.
Lawmadi OS is designed like an operating system with 8 independent layers, each performing a specialized role.
All answers are grounded in Korea's official legal databases (Single Source of Truth). Self-generated inference or fabrication is strictly prohibited.
Laws, enforcement decrees, and enforcement rules
Supreme Court and High Court case law
Constitutional Court rulings and opinions
Directives, regulations, notices, and local ordinances
Official statutory interpretation cases
International treaties and legal glossary
Gemini 2.5 Flash — real-time SSE streaming, 429 exponential backoff
Vertex AI Search — 14,601 legal documents indexed, extractive answers
FastAPI + Uvicorn — async Python on Cloud Run (Seoul region)
Cloud SQL PostgreSQL 17 — statute cache, audit logs, session management
Firebase Hosting — Korean/English static pages, PWA support
GitHub Actions 5-stage — Test, Staging, Production, Frontend, Notify
Every answer in Lawmadi OS is governed by 6 constitutional principles. These are enforced at code level with zero exceptions.
All answers based on official statutory data in real-time
No self-generated legal citations or reasoning
Verification failure blocks the answer entirely
No encouragement of illegal acts or evidence tampering
Law at time of act takes precedence; transitional provisions checked
Every citation includes law ID and enforcement date