Inspiration
In Chile a labour claim is lost by being badly formed, not by being wrong. The Direccion del Trabajo inspector can only act on what is correctly invoked — the right legal ground, the right article, the amount calculated. Get it wrong and the complaint is returned, while the legal window keeps running.
The people who most need to file are exactly the people who cannot pay someone who knows how to invoke it. A labour lawyer in Santiago starts around CLP 200,000 and works on a percentage of the result, so a small case is never worth their time. That is not a gap in the market — it is the market working as designed.
The structural claim: the barrier is regulatory, not technical. An inspector can only act on a properly-invoked claim, and the cost of proper invocation is what excludes the people the labour code exists to protect. Tu Derecho produces the filing itself, for CLP 3,990 (about USD 4.20).
What it does
Upload your contract, finiquito, payslip or dismissal letter — photo or PDF. Gemini reads it, identifies the legal ground actually invoked, checks it against the Codigo del Trabajo, and returns a diagnosis with evidence, a 14-day procedural plan ordered by legal deadline, and a written filing ready to present, with the article cited and the amount calculated.
The output is not addressed to the worker. It is addressed to the inspector who has to process it. That is the design decision the whole project rests on.
How we built it
Next.js 14 on Vercel. Gemini API for every LLM call. GitHub's API as an append-only operations log. Ten separable pipelines: multimodal document reader, legal-ground diagnosis, procedural planner, artifact generator, QA rubric agent, model fallback chain, completeness guard, time-budget governor, server-side entitlement gate, and the evidence log.
The QA agent is a separate Gemini call with a rubric written for legal guidance specifically: the artifact must be actionable, grounded (it may not assert facts the user did not provide), safe (it may not promise legal outcomes or exact amounts, and must state it is guidance rather than legal advice), and clear.
Challenges we ran into
Refusing is harder than answering, and here it matters more. A badly-formed filing consumes the worker's legal window, and that window does not come back.
Measured in production across 14 runs and 56 reviewed criteria, the QA agent rejected 3 artifacts. All three were the generator asserting money the user never supplied. Verbatim from the public log:
"Inventa un monto de sueldo ($580.000) que no fue proporcionado por el usuario."
"Afirma un monto de sueldo de $520.000 que no fue entregado por el usuario."
"Garantiza un resultado y monto exacto al afirmar que le deben $580.000 por aviso previo."
A fabricated salary figure inside a document meant for a labour authority is not a cosmetic defect — it damages the very claim it was written to support. One artifact was rated riesgo alto and flagged.
The paid content had to be genuinely withheld. It began as a CSS blur over data the browser had already received — anyone who opened the network tab had the filing for free. Gating moved server-side: a visitor receives 8 of 14 procedural steps and one of two artifacts, the second stripped of its recommendation. What was not paid for never leaves the server.
Model output truncates. The artifacts are what the price buys, so they are now serialised before the long procedural plan. What truncation costs is the tail of the plan, never the document you came for.
Accomplishments that we're proud of
The system refuses, visibly and in production, and the refusals are recorded in a public branch anyone can read: github.com/phazon2/tu-derecho/tree/logs/logs
14 verdict runs, 100% success, 56 QA criteria reviewed, 3 rejected, risk ratings of 12 low / 1 medium / 1 high. An AI overruled another AI for inventing money in a legal document.
A judge can verify the entire pipeline without any access to our accounts:
curl -s "https://tu-derecho.vercel.app/api/health?full=1"
What we learned
Legal accuracy is a refusal problem, not a generation problem. Anyone can produce a plausible legal letter; the value is entirely in knowing when you cannot. And a tolerant parser is a silent-failure machine unless it reports what it repaired.
What's next for Tu Derecho
Users. Revenue is zero and there are no customers — the product was deployed on 12 August, five days before the deadline, and no outreach was carried out. That is the honest position and the next step is not a feature.
Prove the outcome. Today we can measure that filings are produced and that unsafe ones are rejected. We cannot yet measure whether the Direccion del Trabajo accepts and acts on them. That requires users who actually file.
A supervising lawyer. Scaling a product that generates documents used in legal proceedings requires human legal review. That is a real cost the model has not yet absorbed, and pretending otherwise would be dishonest.
Automated delivery, and a real domain — fulfilment is manual today and works for the first customers, not for thirty.
Built With
- gemini
- github-api
- google-ai-studio
- javascript
- mercado-pago
- nextjs
- react
- vercel
Log in or sign up for Devpost to join the conversation.