Emilio Rodríguez

Project · Gaceta AI

Project 05 / 07: Gaceta AI

2026 · Personal · Architecture, development and research

Personal · 2026

Ask Costa Rica's official gazette in plain language: code-verified citations and alerts on what affects you.

The problem

Costa Rica's official gazette prints about 400 notices every business day and almost nobody reads it. Some services summarize it for lawyers or track topics, but none answer anyone with checked citations, the current version of each regulation and WhatsApp alerts.

What I did

  1. 01 / 06

    Every day it downloads the edition and its supplements.

    Verifies the PDF's digital signature, splits each notice and strips private individuals' data before storing anything. The archive goes back to 2015.

  2. 02 / 06

    Hybrid search, with pgvector embeddings and Spanish full-text.

    A reranker and a graph of regulations that follows amendments and repeals to answer with the version in force.

  3. 03 / 06

    Every citation is checked character by character.

    Against the official page before it is shown; without evidence, it answers “I don't know”. Retrieved text reaches the model marked as untrusted, against prompt injection.

  4. 04 / 06

    Claude Sonnet generates and Claude Haiku classifies by topic.

    In a fixed plan, retrieve, generate and verify flow, with no agent. Every call logs tokens, cost and latency, under a daily spending cap.

  5. 05 / 06

    Topic alerts by WhatsApp, Telegram or email.

    Sent at most once. A Next.js web app and a read-only MCP server so Claude or another agent can query the gazette.

  6. 06 / 06

    In-house evals from day one.

    Recall@k, MRR, verbatim citations, personal-data leakage and faithfulness with a hand-validated judge. A technique ships only if it moves a metric, and the ablation table backs the paper.

Results

  1. Privacy by design: no private individuals' data in the index and no search by name.
  2. It backs the paper “Reliability by engineering”, on how much of a legal RAG's reliability comes from engineering decisions.

Stack

  • NestJS
  • PostgreSQL
  • pgvector
  • pg-boss
  • Claude
  • MCP
  • Next.js
  • Zod

End of the project

Next project

T-Ledger

Back to the series