167,463 legal documents. 701,449 knowledge graph edges. GraphRAG. Full SaaS with local payments. Production on Google Cloud. Built by a litigation attorney — starting from a CustomGPT prototype.
The Dominican Republic has one of the most fragmented legal knowledge systems in the Caribbean. Supreme Court rulings, constitutional decisions, labor tribunal precedents, appeals court records — all scattered across PDFs, portals and physical archives, with no semantic search and no structure.
Before writing a single line of infrastructure code, we validated the entire product using CustomGPT. We ingested the first 50,000 documents, deployed the agent to real lawyers, and let their query patterns tell us exactly what to build.
Every retrieval failure, every "almost right" answer, every power-user workflow — that became the product specification for gptlegal.com.do.
What CustomGPT validated became a full-stack, production-grade platform. Here's the complete architecture.
┌──────────────────────────────────────────────────────────────────┐
│ USER · Astro 5 SSR · React components · Tailwind CSS │
└─────────────────────────┬────────────────────────────────────────┘
│ HTTPS / SSE streaming
┌─────────────────────────▼────────────────────────────────────────┐
│ GOOGLE CLOUD RUN — gptlegal-00055-9sx │
│ Node.js 20 · Astro SSR adapter · Auto-scaling 0 → N │
│ CI/CD: GitHub Actions → Workload Identity Federation → GCR │
└────────┬────────────────────────────┬────────────────────────────┘
│ │
┌────────▼────────────┐ ┌──────────▼──────────────────────────┐
│ CLOUD SQL │ │ BIGQUERY (167,463 documents) │
│ PostgreSQL 15 │ │ gptlegal.gptlegal_cerebro │
│ Unix socket / │ │ ├── VECTOR_SEARCH (Gemini embeds) │
│ cloudsql/… │ │ ├── BM25 SEARCH() (fulltext) │
│ ┌──────────────┐ │ │ ├── LIKE exact refs (Art./Ley) │
│ │ users │ │ │ └── HYBRID RRF reranking │
│ │ conversations│ │ │ Sources: SCJ · TC · TSA · CA │
│ │ wallet_txns │ │ └──────────────────────────────────────┘
│ │ error_events │ │
│ │ azul_payments│ │ ┌──────────────────────────────────────┐
│ │ documents │ │ │ NEO4J (VM 849 · GCP) │
│ └──────────────┘ │ │ v2025.04.0 · GraphRAG in prod │
└─────────────────────┘ │ 167,776 nodes · 701,449 edges │
│ 34 subject areas · 340 judges │
┌─────────────────────┐ │ Cypher queries · 800ms timeout │
│ GEMINI 2.0 FLASH │ └──────────────────────────────────────┘
│ Streaming SSE │
│ Web grounding │ ┌──────────────────────────────────────┐
│ 5 legal personas │ │ GCS BACKUP gs://gptlegal-cerebro/ │
└─────────────────────┘ │ Daily 3AM · 3.4 GB · 5-day retain │
└──────────────────────────────────────┘
┌─────────────────────┐
│ AZUL PAYMENTS │ Auth: Google OAuth + Magic Link
│ Dominican card │ Sessions: JWT in secure cookies
│ processor · Link │ Monitoring: error_events table (new)
│ de Pagos + Virtual │ Embeddings: text-embedding-004
└─────────────────────┘
Four strategies run in parallel on every query, merged via Reciprocal Rank Fusion:
Every law, ruling, judge and doctrine in the DR legal system — interconnected:
Four judicial sources. Fully scraped, cleaned, embedded and indexed. This is the foundation that CustomGPT helped us decide was worth building.
Supreme Court — civil, criminal and cassation rulings from 2013 to 2024. Full API ingestion.
All TC decisions on fundamental rights and constitutional review. Complete corpus.
Administrative and special jurisdiction courts — key source for administrative law and regulatory disputes.
33,784 appellate decisions from JurisTecA — civil, criminal, family and specialized courts.
CustomGPT didn't just let us test an idea. It taught us exactly what a Dominican lawyer needs from AI — and that curriculum became the architecture of everything we built.
The Dominican Republic is proof of concept. The Caribbean is the market.
Every feature on this page is live at gptlegal.com.do. No sandbox. No demo environment. This is production.