§lectorium

Release notes

Lectorium's whole history - from a question that would not go away to the twenty-three acts it reads today. Newest entries first.

New act Family benefits Vocabulary Transitional provisions

The Family Benefits Act - and three things adding the act alone did not fix

  • What changed Added the Family Benefits Act (PHS) - child allowance, large-family allowance, birth grant, parental benefit and maintenance allowance. Twenty-three acts, 3606 provisions and 4802 search chunks in total.
  • Why this act This area was half-covered - and half-covered is more dangerous than not covered at all. The Employment Contracts Act says how long maternity leave is and then hands every euro over to the Family Benefits Act, which we did not have. The result: of six ordinary questions a parent would ask, five were answered above the confidence threshold, from the wrong act. "How large is the parental benefit ceiling?" returned the sick-pay ceiling. "Who gets the large-family allowance?" returned a provision on relocation grants for doctors. "The father does not pay maintenance, will the state help?" returned round-the-clock special care - a service for adults. Only one of the six stayed honestly quiet. An act we do not hold does not make Lectorium silent; it makes it confidently wrong.
  • Nothing that already worked broke As always: before adding it we simulated the whole thing against the existing 296 check questions - zero changes, neither better nor worse. The real ingest reproduced that exactly.
  • Adding the act was not enough on its own One of those five wrong answers did not go away. "The father does not pay maintenance, will the state help?" still returned the special-care provision - the new act simply did not outrank it. The statute says "maintenance allowance during enforcement proceedings"; a person says "the father does not pay". Only when we taught the vocabulary layer that provision's own heading did the right one come first - and the answer is now what the asker actually wanted: 200 euros a month. Four new vocabulary entries, five fixes, zero regressions.
  • One word we deliberately left unfixed In Estonian people say "emapalk" - mother's pay. The statute does not contain that word, so "Kui suur on emapalk?" currently finds nothing and Lectorium stays quiet. We tried six different fixes; every one of them put a provision about recalculating the parental benefit when the minimum wage changes in first place. That is not an answer to "how much". We would have traded an honest silence for a confidently quoted wrong provision, and we do not do that. Left undone - deliberately, and measured.
  • Transitional provisions were pushing ahead of the rules Every act ends with a chapter of transitional provisions. They qualify the main rule while repeating almost its exact words - which is why they were being returned instead of it. "How large is the parental benefit ceiling?" returned the provision on calculating the 2026 ceiling rather than the ceiling itself. Such provisions now take a small penalty. One important detail: we judge by chapter, not by heading - by heading the same rule would have demoted real provisions of the Employment Contracts Act on the transfer of an undertaking. It fixed two other acts as well, not only the new one.
  • And one honest note about the numbers The question set grew to 342. The right provision is among the top three for 93 per cent, first for 78 per cent, among the top five for 96 per cent. The top-three number looks lower than before (94) - it is not: the 296 earlier questions score exactly as they did. We simply added 41 new ones and deliberately wrote a third of them the way a person actually asks, rather than the way the statute is drafted. Those are harder to hit - which is precisely why they are there.
New acts Health Vocabulary

Four acts about health - and one quiet bug we found ourselves

  • What changed Added the Health Services Organisation Act (TTKS), the Health Insurance Act (RaKS), the Health Care Provider Compulsory Liability Insurance Act (TOKVS) and the Work Ability Allowance Act (TVTS). Twenty-two acts and 3531 provisions in total.
  • Why health, and why four at once Lectorium held nothing about health before this - and that did not mean it stayed quiet. We measured what it did with 22 real health questions first: "Kas mul on õigus valida perearsti?" returned a family law provision, "Kuidas perearsti vahetada?" returned succession law, and "Kes saab ravikindlustuse?" returned the general insurance-contract section of the Law of Obligations. Nineteen of the 22 cleared the confidence threshold - confidently wrong. One act alone would have half-fixed it: TTKS says how the system works, not what you are entitled to. That is the Health Insurance Act.
  • And then we found something unpleasant While checking a new act we noticed a long-repealed section sitting in the index and being returned as an answer. The cause: our filter recognised the marker "Kehtetu -" but not the plural "Kehtetud -", nor one with an amendment note appended. We swept the whole corpus - there were twenty such empty sections across six acts. The filter is fixed and all of them are gone. Nobody reported it; we found it ourselves, which is precisely why we run these checks.
  • Plain words again The law never says "raviviga" (medical error) - it says "kindlustusjuhtum". It never says "haigushüvitis" - it says "ajutise töövõimetuse hüvitis". Before we extended the vocabulary layer, "Mida teha, kui arst tegi ravivea?" answered with a provision about who may assist in providing a health service, and "Kui kaua tohib oodata eriarsti vastuvõtule?" answered with the recruitment grant for doctors. Both now reach the right provision.
  • Sebastian gained a seventh case In health, "hüvitis" means two unrelated things: the Health Insurance Fund paying for your treatment and sick leave, versus patient insurance compensating harm the treatment itself caused. "Kas mul on õigus hüvitisele?" splits those five thousandths apart - so Sebastian now asks which one you mean. Two other pairs that looked like they needed him were deliberately left alone: there the question was not ambiguous, the ranking was simply wrong, and that is not something to ask a user about.
  • And most importantly - nothing old broke We simulated the whole addition first: 251 existing check questions, zero changes. The real ingest matched exactly. The question set itself grew to 301 and accuracy rose: the correct provision is in the top three for 94% of questions (was 93) and first for 79%.
Sebastian Clarification Title bonus

Lectorium now has someone who asks - and never answers

  • What changed When retrieval is genuinely undecided between two acts, Sebastian appears below the answer and offers one choice. He is Lectorium's first named character - and he is a middleman, not a lawyer.
  • Why he was needed Some questions have two correct answers depending on who is asking. "How long must the daily rest period be?" means one thing under the Employment Contracts Act and another under the Civil Service Act; the scores differ by four thousandths. Until now Lectorium simply picked in that situation - quietly, without asking, and not always correctly. Now Sebastian asks: "Kas küsid töötajana või ametnikuna?" Tap an option and retrieval runs again knowing what you meant.
  • He never answers That was the hard constraint we built him under. Sebastian does not interpret, summarise or advise. He does not write his own sentences either: every question and every option is authored by hand in advance - no language model generates his text. He appears only after the act has been quoted and cited, and skipping him leaves the first answer standing.
  • A rare visitor He shows up on nine questions out of 251, four per cent - only when two acts clear the threshold, are within 0.015 of each other, have an authored case for that pair, and the question carries a topic cue. One question per answer, at most two in a conversation. If you already said you are a public servant, he does not ask whether you are one.
  • And one quiet retrieval fix Provisions whose heading contains one of the question's content words now earn a little extra weight. It repairs an old pattern where a short generic section displaced the precise one: MTÜS § 18 "Üldkoosolek" no longer pushes aside § 19 "Üldkoosoleku pädevus", and an inheritance question about a spouse no longer stalls behind the general section on intestate heirs. The correct provision is now in the top three for 93% of questions (was 91) and first for 79% (was 74).
New acts Annex tables Vocabulary

Eighteen acts - and finally an answer to "do I need a permit for a shed?"

  • What changed Added the General Part of the Civil Code Act (TsÜS) and the Building Code (EhS). Eighteen acts and 3255 provisions in total. Accuracy rose: the correct provision is in the top three for 91% of questions, up from 89.
  • Limitation periods, transactions, authorisations The General Part is what the Law of Obligations, the Law of Property and the Non-profit Associations Act all rest on. It supplies the limitation periods — how long a claim can still be brought — which the Law of Obligations itself never states, along with legal capacity, void and voidable transactions, and how authorisations are granted and withdrawn.
  • Annex tables are now readable Building Code § 35 says a building notice is required "for the buildings named in annex 1". So the most-asked question of all — does a shed, a terrace or a garage need a permit — is decided in a table, not in any section. Riigi Teataja hides those annexes inside the act's XML as PDFs; we had been downloading and discarding them from the very beginning. They are now extracted and indexed. Ask whether an 18 m² shed needs a permit and the answer is the table row itself.
  • And a vocabulary bridge for everyday words The law does not say "kuur" (shed) — it says "abihoone". It does not say "müra" (noise) — it says "kahjulikud mõjutused". Until now that meant the right provision never entered the search at all, and the answer came back confidently wrong: the shed question returned a section about offshore wind farms. The act's own terms are now appended to the question before searching — to the search only; the question shown back to you and the citation are untouched. Three such questions were fixed and nothing that already worked broke.
New acts The defenceless

Sixteen acts: property, associations, and those who cannot ask

  • What changed Added the Non-profit Associations Act (MTÜS), the Law of Property Act (AÕS), the Social Welfare Act (SHS) and the Animal Protection Act (LoKS). Sixteen acts and 2901 provisions in total.
  • Two of them were added because other acts point at them The Apartment Ownership and Apartment Associations Act does not regulate everything itself: for general meetings and boards it sends the reader to the Non-profit Associations Act, and for property and co-ownership to the Law of Property Act. Until now those references led nowhere. Now an answer shows the apartment-association provision first and the general rule it points to right beneath it. The property act also repaired a wrong answer: "Mis on hüpoteek?" used to be answered from the Law of Obligations Act, because the correct provision was not in the index at all.
  • And two for those who cannot ask for help themselves The Social Welfare Act covers subsistence benefit, home services, care homes, substitute and follow-up care, and special welfare services. The Animal Protection Act covers keeping requirements, stray animals, pets and animal experiments. Together with the Child Protection Act, these are three sides of one idea: help matters most where the person - or the animal - cannot ask for it.
  • What the measurements showed Across four additions accuracy held flat: the correct provision is in the top three for 89% of questions, even though the index grew by a quarter. Before each addition we test the act against a copy of the index and check whether any previously working answer breaks - four times in a row the answer was "none did". A self-contained act does not damage what already worked; the dangerous ones are acts whose answers live outside our index.
New acts Accuracy

Twelve acts - and three bugs no metric was showing

  • What changed Added the Personal Data Protection Act (IKS), the Apartment Ownership and Apartment Associations Act (KrtS, 81 provisions) and the Child Protection Act (LasteKS, 52 provisions). Twelve acts and 2236 provisions in total. Accuracy rose: correct provision ranked first 76% (was 63%), in the top three 90% (was 85%).
  • Three silent bugs Adding acts surfaced that seven of the nine existing acts were serving superseded text: Riigi Teataja returns the "current version" id even for a long-expired version, so the logic meant to keep us current never updated anything. Second, the index held 66 repealed provisions whose body is just "Kehtetu -" (repealed) - questions were being answered with nothing. Third, the splitter for long provisions had never once fired: a single vector was averaging up to fifteen thousand characters. All three are fixed.
  • What it taught us None of them looked like a bug in the numbers - the system answered confidently, just from outdated, empty or diluted text. When a symptom tracks the size of an act or the shape of its numbering, suspect the pipeline before the model.
  • Data protection is a special case IKS only supplements the EU GDPR, which Riigi Teataja does not host. That leaves much of data protection effectively unanswerable - and we say so: every answer resting on IKS carries a separate note. Chapter 4 of the act, which binds only law enforcement authorities, is deliberately excluded from the index, because its headings read like general rules.
Security App

The API got keys - and the app moved to its own address, without PHP

  • What changed The Lectorium API now requires an API key. The app moved to app.lectorium.ee and the API to its own address, api.lectorium.ee, both behind HTTPS. See the API documentation.
  • Why Honestly: until now the API had no authentication. The old guard only restrained browser windows - no script had to care about it. It was an open door, and we closed it.
  • And PHP is gone The app is now nothing but HTML, CSS and JavaScript. A small PHP intermediary used to sit between the browser and the API; the web server now does that job itself. Fewer moving parts, fewer things that can break.
  • The back door is closed Until now the Lectorium service was also reachable directly, unencrypted, via a numeric address and port. That door is shut: the service now listens only on the server's own loopback interface, and the only way in from outside is through the lectorium.ee addresses, always over HTTPS. No question travels the public internet unencrypted any more.
  • What changes for you Nothing. Conversations still live only in your browser, and an answer is still a quote from the law with a citation. This release is about how the system is built - not about what it tells you.
Website

Technical overview and API documentation published

  • What changed Two new pages on lectorium.ee: a technical overview covering the whole pipeline, the measured accuracy and the known failures, and API documentation with real response examples. Both in Estonian and English.
  • Why If a system tells you what the law says, it should be possible to check how it got there. The overview also covers what does not work - including one query that currently returns the wrong act with high confidence.
Platform

Lectorium got its own domain: lectorium.ee

  • What changed Lectorium is moving from lectorium.crowned-phoenix.com to its own domain, lectorium.ee. Registered in Estonia, nameservers pointed at the server, HTTPS certificate in place.
  • Why A tool built for Estonian law belongs on a .ee address. It also sets up three separate addresses: the intro site, the app and the API.
New acts

Nine acts: succession, family law and consumer protection

  • What changed Added the Consumer Protection Act (TKS, 101 provisions), the Law of Succession Act (PärS, 193 provisions) and the Family Law Act (PKS, 227 provisions). Nine acts and 2120 provisions in total.
  • Why Until now we grew mostly on request. Succession and family law we added deliberately, on our own: these questions reach people at their hardest moments, and that is exactly where an assistant that invents nothing - that just finds the right provision - is worth the most.
  • What we measured The Law of Succession Act fitted in without breaking a single earlier answer - results stayed identical. The Family Law Act overlaps succession more tightly: the word "abikaasa" (spouse) lives in both acts, and we watched Lectorium confuse them. We now know exactly where that happens.
New acts

From three acts to six - and the Law of Obligations showed us a weak spot

  • What changed Added the Civil Service Act (ATS), the Youth Work Act (NTS) and the Law of Obligations Act (VÕS). All three by user request.
  • Scale VÕS alone has over 1100 provisions - more than the entire index before it. The amount of searchable text roughly quadrupled.
  • What we measured We were worried that pouring in this much new text would degrade answers that already worked. It did not - the employment-law answers held almost exactly where they were. We only know that because we measured it.
  • But VÕS exposed a real weakness: short definition questions ("what is a sales contract?") go astray in a large act, because the general "definition of contract" provision is such a strong match that it crowds out the specific one. Concrete questions - interest rates, deadlines - land correctly.
Public beta

Lectorium opened: three employment acts, every answer cited

  • What changed The first public version. Ask in plain Estonian, get a real statutory provision back with a link to Riigi Teataja. We started with three employment acts: the Employment Contracts Act, the Occupational Health and Safety Act, and the Collective Agreements Act.
  • Why so narrow We made ourselves a promise: start narrow, get it right, then widen. Better to do three acts honestly than to promise "all of Estonian law" and hand over something nobody could trust.
  • Technically The query service was finished in pure Go: the embedding model runs through ONNX Runtime in the same process, with no Python needed to answer.
Model

The model learned Estonian in 41 minutes - and immediately started lying

  • What changed The real training run, on a single rented RTX 3090: a 33.4-million parameter model, our own 16,000-token vocabulary, the whole Estonian Wikipedia (111 million tokens, 3 epochs), 15,000 steps. 41 minutes, total cost 0.24 USD. Perplexity fell from 210 to 24.
  • What went wrong The model wrote fluent, grammatically correct Estonian - and among other things claimed:

    "Tallinn on väljamõeldud piirkond Põhja-Makedooniast."
    ("Tallinn is a fictional region of North Macedonia.")

  • Why it mattered This was the most useful failure of the project. The model had learned how Estonian sounds, but not what is true. If a model can confidently claim Tallinn is in North Macedonia, it must not be the thing that tells you what your redundancy payment is. Out of that came Lectorium's central decision: the answer is a quote, not prose. More in the overview.
Preparation

Renting a brain by the hour

  • What changed We decided the real model would be trained on a rented GPU rather than the local CPU. The model settings were retuned for it: 8 layers, 512 dimensions, 512-token context.
  • Why CPU training worked, but ran about ten times under compute-optimal. Renting by the hour was cheaper than patience.
Model

Our small Estonian model said its first words

  • What changed The first real training run, on an ordinary processor with no GPU: a 6.79-million parameter model, our own 8000-token BPE vocabulary, 2200 steps, two hours. Validation loss fell from 9.02 to 5.36.
  • What came out Recognisable Estonian and real entities - Riigikogu, University of Tartu, the Republic of Estonia. Also plenty of repetition and rambling: the model was clearly undertrained.
  • Why it mattered The goal was not a usable model but proof that the whole pipeline - data, tokenizer, training, evaluation - worked on real data. That proof arrived.
The beginning

A question that would not go away

  • The idea Some projects start not from a customer brief but from a question that refuses to leave. Ours was simple: what would it take to build a small, purposeful AI - trained from scratch, by us - that actually understands Estonian?
  • Why Estonian, and why law The large models are built for a global audience; Estonian tends to sit at the margins - supported, but rarely a first-class citizen. Meanwhile Estonia has a richly digitised public information landscape. Riigi Teataja is public and free.
  • A decision made at the very start The model must not recite the law from memory. That path leads to confident-sounding but unreliable answers - the last thing anyone wants when the subject is the law. The answer has to be retrieved and cited. As the first post put it: an answer without a citation is not an answer worth giving.
  • And one deliberate constraint A small model, not a large one. Trainable on modest hardware, inspectable end to end, cheap enough to run that a single question does not require a fleet of cloud accelerators. Small was not a limitation. It was a choice.