Extracting structured event graphs & outcomes from 4M court decisions using local LLMs

Wait 5 sec.

I’m building a legal search and analytics engine over ~4 million Slovak court decisions. Dense embeddings + BM25 are already running in production for basic retrieval, but I’m hitting a fundamental representation wall when trying to achieve near-100% precision on complex queries and run quantitative jurimetric statistics (e.g., "In what % of custody cases involving alcohol did the father get custody, grouped by year or judge?"). The Problem: Why Flat JSON / Enums and Pure Embeddings Both Fail I already tried LLM-based structured JSON extraction in production, and it failed for two reasons: Category / Enum Explosion on Open-World Facts: If you leave fact categories open, the LLM invents thousands of incompatible strings ("alkohol", "nadmerné pitie", "etylizmus", "1.8 promile"). If you lock it to a strict Enum, either the enum becomes 2,000 items long (breaking prompt adherence), or everything gets dumped into "OTHER". Recursive Legal Logic ("Russian Nesting Doll" Rulings) & Evidentiality: Look at a single operative sentence (Výrok) from a Supreme Court ruling (5CdoR/9/2025): "The Supreme Court *cancels** the judgment of Regional Court Trnava from Feb 5, 2025 (13CoP/14/2024) in the appealed part I, by which it rejected the mother's motion to award the minor child into her sole custody, and returns the matter for further proceedings."* And in the reasoning (Odôvodnenie): "The mother pointed to the father's violent behavior and excessive alcohol use... The father called the claims misleading... The lower court did not find the allegations proven as an obstacle to shared custody." If you encode this as flat Subject-Verb-Object triples or a flat JSON object: * (Father, uses, alcohol) loses evidentiality/modality (it was alleged by the mother, denied by the father, and unproven according to the first-instance court). * CANCELS(REJECTS(REQUESTS(Mother, Sole_Custody))) is a 3-layer nested state chain. Naive extraction sees "rejected the mother's motion for sole custody" and records that the mother lost—when in reality, the Supreme Court canceled that rejection (so the mother won the appeal, and the custody state is unresolved). The 3 Architectures I’m Debating Has anyone in NLP, IR, or LegalTech already solved this cleanly at scale? Right now I’m looking at three possible paths: Option A: ID-Linked Event Graph (Reified Triples / Neo-Davidsonian / RDF-star style) Instead of deep nested JSON, represent each decision as 8–15 flat, ID-linked event rows where obj can reference a previous row @id, plus epistemic qualifiers: ```json [ {"id": 1, "subj": "mother", "verb": "request_custody", "obj": "child", "mode": "sole"}, {"id": 2, "subj": "father", "verb": "uses", "obj": "alcohol", "claimed_by": "mother", "proven": false}, {"id": 3, "subj": "regional_court", "verb": "reject", "obj": "@1", "based_on": "@2", "doc": "13CoP/14/2024"}, {"id": 4, "subj": "supreme_court", "verb": "cancel_and_remand", "obj": "@3", "scope": "partial"} ]   submitted by   /u/SignificantZebra5883 [link]   [comments]