Legal RAG Needs a Time Axis: Serving the Statute That Was in Force
Why a legal assistant has to retrieve the version of a statute that was in force on the date of the case.
One article, three answers
Croatia's act on legalising illegally built buildings has an Article 10 that governs how an application is filed. Its text has existed in three versions:
| In force | What it said about the deadline |
|---|---|
| 4 Aug 2012 – 14 Jul 2017 | applications no later than 30 June 2013 |
| 15 Jul 2017 – 15 May 2026 | applications no later than 30 June 2018; later ones are rejected |
| from 16 May 2026 | no deadline; applications are filed through the national e-permit system |
"Can I still apply?" has a different correct answer in each period. The 2026 amendment also says that procedures started before it came into force are finished under the old text. So an officer handling a 2017 file in 2026 needs the second version, while a citizen asking today needs the third. A retriever that only knows "the law" will be confidently wrong for one of them.
What we store
For the statutes the product depends on, each article is kept as a series of versions with valid_from, valid_to, the official gazette issue that introduced the text, and a status saying whether the text is the gazette original or a consolidated reading. Today that is 1,225 article versions, 732 of them closed. A separate canon table names, for each of 282 statute families, the one record that is the consolidated text in force, so duplicates and historical snapshots cannot win retrieval by accident.
Retrieval takes a date. The default is today; when a case has a filing date, the question is answered from the version in force on that date, and the answer says which gazette issue it is quoting.
Article numbers are not stable identifiers
Amendments renumber paragraphs and insert articles such as 430.a. A link from a court decision to "Article 28(5)" may point to what is now paragraph 6. We resolve references against the version in force on the decision's date, and treat a reference as verified only when it lands on exactly one row.
Opinions and case law carry weight only when they match the version
Ministry opinions and court decisions are the strongest source after the statute itself. They are also dated. Of the opinions we hold on the legalisation act, the newest predates the 2026 amendment, so none is treated as authority for the amended articles. They stay in the corpus, flagged as pending, and the assistant does not cite them as current. Across all institutional opinions in the corpus, 17 of 1,300 have passed the full check so far: the document is live and carries its reference number, the statute it cites is the same gazette version as the canon, and the issuing body is competent for the topic.
When an opinion and the statute disagree, the answer shows both and leaves the decision to a person.
Numbers come from SQL
Fees are computed, not retrieved. The 2026 fee regulation prices a building by parts of its volume at four rates. The assistant calls a function over a table and shows the arithmetic. Vector search over numeric text returned the nearest-looking number often enough that we banned it as a primary source for any figure.
What changed in practice
The first check on a legal answer is no longer "is it fluent" but "which version did it read". The rule we are building towards is that a change in a statute sends every stored answer that cites it back for review.
The product is in Croatian: Legalizacija.