Skip to content
Caio Gonçalves
← All projects

S.A.P.O.

Legal AI that runs entirely in the browser

S.A.P.O. (Offline Legal Document Analysis System) reads Brazilian court filings in PDF, classifies the document, builds a case summary sheet, computes deadlines in business days, anonymizes personal data under Brazil's LGPD and checks the case status in the CNJ's Datajud API, without sending the file to any server. The landing page sits at the root, in Portuguese, English and Spanish; the analyzer lives at /analisar.

Highlights

  • Model trained on 149,000 real pages from Brazilian Supreme Court cases (VICTOR dataset).
  • Macro F1 of 78.2 on the test set, above the 76.3 of the best model in the original paper.
  • Inference rewritten in TypeScript, with a parity test against scikit-learn.
  • Landing page in three languages with full SEO: hreflang, structured data (SoftwareApplication and FAQPage), a share image per language and a sitemap; one link opens the analyzer with a sample document already loaded.
  • Case number (CNJ) field with an as-you-type mask, recovery of lost leading zeros confirmed by the check digit, and plain-language error messages.
  • Datajud lookup that waits up to about 2 minutes, retries on its own, shows the elapsed seconds and keeps the answer for 1 hour.
  • Civil procedure deadlines in business days, with national holidays and court recess.
  • Works offline after the first visit, thanks to a service worker.
  • 86 automated tests running on GitHub Actions.
Year
2026
Role
Personal project: from model training to deployment
Technologies
Next.js, TypeScript, Python, scikit-learn, Tailwind CSS, Vercel
S.A.P.O. landing page with the headline, buttons to analyze a filing or try a sample, and the case summary sheet beside them
S.A.P.O. analyzer screen with the PDF upload area and the Datajud lookup
Case summary sheet generated by S.A.P.O.: parties, ruling, requests and deadlines
S.A.P.O. case summary sheet in dark theme

Want a project like this for your business?

Tell me what you need. I'll reply on WhatsApp with a deadline and a quote.