Lex is a point-in-time retrieval system for legal texts, focused on Luxembourg law (Legilux) and reviewed EU law (EUR-Lex/Cellar). Regulators usually publish only the current rules, but audits, investigations, and disputes often concern a past date. Lex retains every version it has seen, answers "what was this provision on March 15, 2022," and provides precise validity intervals, timelines, the acts that amended the provision, and hash-bearing source records; when it cannot determine something, it gives an honest, machine-readable refusal.
Main capabilities
- Retrieval by date (as_of): supports full, outline, or selection by provision.
- Timeline and in-force determination: timeline, in_force_on.
- Provision history: article_history lists all distinct textual states of each provision and their dates.
- Difference comparison: diff shows changes between versions.
- Search: deterministic keyword retrieval (FTS5/BM25); optional local hybrid retrieval when a verified vector mount is available, not involving a generative model.
- Sources and citations: provenance, cited_by, changes_in_period, coverage.
- Read-only MCP tools: the same set of tools covers Luxembourg and EU materials, and can be connected to AI clients that support MCP.
How to use
- Connect directly through the hosted MCP endpoint: modern clients (such as VS Code and Cursor) can connect directly to the hosted endpoint, with no key and no installation.
- For clients that only accept a local stdio server, a pinned version of the third-party mcp-remote adapter can be used to bridge to the same hosted endpoint (requires Node.js 18+). The hosted endpoint is the authoritative source: clients do not download legal corpora, vector files, or Azure credentials. Lex intentionally does not publish an npm package; the above command is only a compatibility bridge for older clients, not a second implementation.
- The public assistant is temporarily unavailable while Lex installs the deterministic V3 answer path; search, direct legal pages, and MCP remain available.
Use cases
- Compliance staff verify which text of an obligation was in force on the date of the facts, and obtain a permalink and file hash.
- Legal tech developers build legal RAG that must not hallucinate versions: chunk by provision, with valid_from / valid_to, and filter before similarity.
- External AI agents directly use the public MCP tools.
- Researchers track the evolution of a provision's text across multiple amendments.
Limitations and boundaries
- Lex only answers "what the rule once was"; it does not judge "whether we are compliant," "whether it applies to me," or "what this means," as these are professional opinions. The evidence, indexing, and MCP layers never generate or interpret legal texts.
- Coverage: Luxembourg (Legilux, Tier A) is all works and dated versions currently mounted from the publisher's Consolidation catalog; EU (EUR-Lex/Cellar, Tier A) is the reviewed Luxembourg-facing scope, covering financial services, anti-money laundering, corporate, competition, tax, employment, consumer, procurement, environmental, judicial cooperation, intellectual property, data, digital, cyber, and energy law, as well as limited legal-historical relationships. Municipal regulations are intentionally out of scope.
- Honest refusals: no_version_for_date, anchor_not_in_version, outside_observed_window, text_not_available, text_withheld.
- Keyword retrieval is the production default because the signed hybrid holdout validation gate has not yet passed.
- The code is licensed under Apache-2.0, which does not extend to corpus data or index artifacts; derived datasets are CC-BY-4.0 (Luxembourg) and the EU attribution reuse license.
- The project is free and open, but operating costs are borne by the author (Azure infrastructure).