Dutch case law and legislation search via rechtspraak.nl and wetten.overheid.nl
Jeroen1991z adds native search across the Dutch legal corpus: four new tools give the LLM access to rechtspraak.nl judgments, BWB legislation, and individual article text. The diff includes a significant amount of API-wrangling to get the external endpoints to actually return useful data.
A new backend/src/lib/rechtspraak.ts is the core of this change. It exposes four functions that become LLM tools: search_case_law (rechtspraak.nl Atom/XML, ECLI results), fetch_case_law (full judgment text by ECLI), search_legislation (wetten.overheid.nl SRU, finds laws by title), and fetch_legislation_article (fetches individual articles by BWB ID and article number via the BWB XML repository).
Getting the external APIs to work correctly took most of the commits. The case law search initially used subject as the keyword parameter; the actual parameter is zoekterm. The legislation SRU endpoint required version=1.2, a switch from title any to overheidbwb.titel any, and dropping the dcx record schema. The XML parser was then wrong because the real response used <record> not <srw:record>, and rechtsgebied instead of description. The tool description for search_legislation was also corrected to make explicit that it searches law titles not article content - so the right query is Burgerlijk Wetboek Boek 6, not onrechtmatige daad.
The citation schema gains ecli, court, judgment_date, article, and r.o. (rechtsoverweging) fields. formatCitationPage is rewritten so case law renders r.o. X, legislation renders the article reference, and documents render pagina N - fixing a "Page undefined" bug that existed in the upstream.
A sources dropdown appears in ChatInput.tsx with toggles for Rechtspraak.nl and Wetten.overheid.nl. A Memorie van Toelichting (MvT) source and an "AI kennis" override were added and then removed; what's left is searchSources: { rechtspraak?: boolean; wetten?: boolean } threaded through the API and routes.
One bundled change worth noting: the first commit in this topic (7711127a) also flips the default chat model from gemini-2.0-flash-preview to claude-sonnet-4-6. If you take that commit, you're taking the model default change too.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?