Inspiration

When K-Beauty and K-Food brands enter the US market, a single review like "this cream burned my skin" can trigger a multi-million dollar product liability lawsuit. Most SMBs discover this risk only after receiving a legal notice — by then, it's too late.

We asked: What if AI could read every customer review and flag legal risks before they become lawsuits?

OntoReview was born from this question — an AI-powered litigation prevention system that converts customer reviews into actionable legal intelligence, powered by Amazon Nova 2 Lite on AWS Bedrock.

What it does

OntoReview monitors product reviews and automatically:

  1. Ingests Amazon product reviews via ASIN input or web crawling
  2. Classifies legal risk across 5 categories: Product Liability, Regulatory Risk, False Advertising, Consumer Safety, and Class Action Risk
  3. Matches US legal precedents using a Micro-RAG engine backed by OWL ontology reasoning
  4. Estimates financial exposure based on historical settlement data (e.g., "$5.4M estimated legal exposure")
  5. Generates risk mitigation playbooks with actionable response strategies
  6. Records an immutable audit trail to demonstrate Duty of Care compliance

The platform delivers 6 enterprise modules:

  • Risk Intelligence — real-time dashboard with severity scoring and financial exposure KPIs
  • Risk Response Playbook — AI-generated mitigation strategies per risk category
  • Trust & Safety Audit — append-only audit log with PDF export for legal compliance
  • Domain Ontology Studio — custom OWL ontology rules for industry-specific risk classification
  • Global Compliance Tracker — multi-jurisdiction regulation checking (US, EU, KR)
  • Agent Communication Setup — configurable AI agent autonomy levels for automated risk response

How we built it

Core AI Pipeline (Powered by Amazon Nova):

Amazon Nova 2 Lite serves as the primary reasoning engine through Amazon Bedrock's invoke_model API. Nova powers every intelligent component:

  • Risk Classification — Nova analyzes review text and classifies it into legal risk categories with severity scores (1–10) and confidence levels
  • Legal Exposure Estimation — Nova cross-references detected risks with matched legal precedents to estimate potential financial damages
  • Playbook Generation — Nova generates context-aware mitigation strategies tailored to each risk category and severity level
  • Compliance Analysis — Nova evaluates risks against multi-jurisdiction regulations (US FDA, EU Consumer Protection, KR Fair Trade)
  • Agent Response Simulation — Nova powers configurable AI agents that simulate automated responses at different autonomy levels

Risk Scoring Model:

Each review is scored using the following formulas implemented in our risk engine:

$$RiskScore = \sum_{i=1}^{n} (severity_i \times confidence_i)$$

$$TotalLegalExposure = \sum_{i=1}^{n} estimated_loss_usd_i$$

Where \( severity_i \) is the Nova-generated risk severity (1–10), \( confidence_i \) is the classification confidence (0–1), and \( estimated_loss_usd_i \) is derived from matched US legal precedent settlement data.

OWL Ontology Engine:

Unlike simple keyword matching, OntoReview uses formal OWL 2 ontology reasoning (via owlready2) to semantically classify risks. The ontology defines class hierarchies like RiskEvent → ProductLiability → ChemicalBurn, ensuring that a review mentioning "skin irritation" is correctly mapped to the Product Liability risk class — even without exact keyword matches.

Micro-RAG (Legal Precedent Matching):

A curated US legal precedent database is loaded into an in-memory embedding cache at startup. When a risk is detected, the system performs cosine similarity matching to find the most relevant legal cases, with TF-IDF fallback for robustness.

Architecture:

  • Frontend: React + Tailwind CSS (deployed on Vercel)
  • Backend: Python FastAPI (deployed on Render)
  • LLM: Amazon Nova 2 Lite via AWS Bedrock (amazon.nova-2-lite-v1:0)
  • Ontology: OWL 2 (owlready2)
  • Database: SQLite + SQLAlchemy (audit trail persistence)
  • Data: Amazon review ingestion (ASIN-based), Web Discovery Engine, YouTube review analysis

Challenges we ran into

  • Ontology + LLM integration: Bridging formal OWL reasoning with probabilistic LLM outputs required careful prompt engineering to produce structured JSON that aligns with ontology class hierarchies
  • Legal precedent accuracy: Avoiding hallucinated legal citations by constraining the RAG to a curated, verified case database rather than open-ended generation
  • Signal vs. noise: Distinguishing genuine legal risk signals from general complaints (e.g., "terrible product" vs. "caused an allergic reaction") required multi-layer classification with confidence thresholds
  • Nova JSON output consistency: Amazon Nova doesn't natively support response_format: json_object like OpenAI, so we implemented a markdown fence stripper and system prompt reinforcement to ensure reliable JSON responses

Accomplishments that we're proud of

  • End-to-end legal risk intelligence pipeline: raw reviews → risk classification → precedent matching → financial exposure → mitigation playbook
  • Novel integration of OWL ontology formal reasoning with LLM-based analysis, providing both semantic precision and natural language flexibility
  • Duty of Care audit system generating legally-defensible compliance reports
  • Full 6-module enterprise platform built as a solo developer in 6 weeks
  • Clean provider abstraction layer: switching between Nova, OpenAI, and Gemini requires only changing one environment variable (LLM_PROVIDER=bedrock)

What we learned

  • Amazon Nova 2 Lite delivers strong reasoning at a fraction of comparable model costs (\( \$0.06 / 1M \) input tokens), making real-time legal risk monitoring economically viable for SMBs
  • OWL ontology constrains and guides LLM outputs, significantly reducing hallucination in high-stakes domains like legal assessment
  • Combining formal knowledge representation (ontology) + probabilistic reasoning (LLM) + verified facts (RAG) creates a more reliable system than any single approach alone
  • Building a multi-provider LLM abstraction early pays off — it took less than 30 minutes to integrate Amazon Nova into an existing OpenAI/Gemini pipeline

What's next for OntoReview

  • Industry expansion beyond K-Beauty/K-Food to supplements, electronics, and automotive parts
  • Real-time monitoring with continuous Amazon review scanning and automated alert escalation
  • Legal team integration via Slack/Teams notifications and case management systems
  • Expanded legal database through partnerships with legal data providers
  • Multi-language analysis for Korean, Chinese, and Japanese reviews supporting cross-border brands

Built With

Share this project:

Updates