News / public record

Checking
  1. Update / Component / Readiness · CheckingOpenLegalCore Word Connector public launch is completeThe Apache-2.0 v0.1.0-beta.1 source-only release now has a complete public component record, homepage feature, Roadmap outcome and discovery path.
  2. Update / Component / Release · CheckingOpenLegalCore Word Connector v0.1.0-beta.1 is publicThe Apache-2.0 source-only beta brings verified Slovenian legal-source research into Word for the web through OLC Engine, directly or through Open WebUI.
  3. Article · CheckingLegal RAG Can Fail Before the Model AnswersA genuine provision can still support the wrong answer. This article shows how collection scope, document splitting, filters and ranking determine which sources a legal AI model ever sees.
  4. Article · CheckingWhen a Correct Citation Leads to the Wrong LawA genuine provision and an official link do not prove that the right law was applied. This article explains why legal AI must preserve temporal versions, transitional rules and the source-selection path.
  5. Update / Project · CheckingPublic project foundation gate is completeOpenLegalCore has completed its public project foundation gate: core public routes, bounded participation channels and publication controls are operating.
  6. Article · CheckingAn Audit Trail Is Not a Log: What a Digital Legal Process Must PreserveAn audit trail is useful when it permits a reasonable reconstruction of the particular process while remaining purpose-bound, appropriately protected and subject to retention rules.
  7. Article · CheckingArticle 86 of the AI Act: Does the right to explanation already apply to Annex III systems?The legal question remains open. The technical capacity to provide an intelligible explanation should not.
  8. Update / Project · CheckingPrivate security reporting is now availableOpenLegalCore now provides a monitored project-wide private channel and a canonical security-reporting policy.
  9. Update / Component / Release · CheckingSlovenian Case Law Pipeline v0.1.7 is publicOpenLegalCore has published the production-verified Slovenian case-law ingestion component as a source-available BUSL-1.1 release.
  10. Article · CheckingA Result Is Not a Method: Why Visible Methods Matter in Legal AIWhy legal AI needs inspectable sources, provenance and human review: a legal and technical analysis of the EU Artificial Intelligence Act and GDPR.
  11. Update / Component / Release · CheckingSlovenian Legislation Pipeline v0.1.0 is publicOpenLegalCore has published the production-verified PISRS legislation-ingest component as a source-available BUSL-1.1 release.
  12. Update / Component / Release · CheckingLegal OCR Pipeline v0.1.2 is publicThe first public OpenLegalCore component is available with code, tests, offline review tooling and a bounded acceptance record.
Explore the code
Menu

LEGAL SOURCES BEFORE THE ANSWER

Legal RAG Can FailBefore the Model Answers

How the legal sources a system holds—and the sources it selects—set the limits of an AI answer

READING KEY

  • Legal RAG
  • Legal retrieval
  • Collection scope
  • Document chunking
  • Ranking
  • Evidential support
  • Answer withholding

Summary. Legal AI can cite a genuine provision and still give the wrong answer. The failure does not always occur while the answer is being written. It may happen earlier: the decisive authority is absent from the collection, a statute has been split into unhelpful passages, the search process selects the general rule but misses the exception, or an important judgment falls below the cut-off for material sent to the model. This article explains how retrieval-augmented generation works, where a legally material source can be lost, why accurate citations do not prove that the search was adequate, and what a system must reveal before its answer can be seriously reviewed.

A filing was made on day 45.

The general rule sets a 30-day deadline. But the same instrument contains an exception: if the official portal was unavailable for a prolonged period, the deadline extends to 90 days. A court decision also explains which kinds of disruption amount to such unavailability. The applicant has evidence of the outage and asks an AI system whether the filing was made in time.

The system finds the general rule, summarises it accurately and links to the genuine provision. It does not find the exception. The court decision does appear among the search results, but it ranks too low to be included in the material given to the language model. The answer is therefore clear: the filing was late.

Nothing cited in the answer is fabricated. The provision exists. The link leads to the correct source. The language model faithfully summarises the text it was given.

The answer is wrong nonetheless.

The example is fictional, but the failure mechanism is real. A legal AI system can fail before the model writes its first word. If a decisive source never reaches the model, the model cannot take it into account. A genuine citation then tells us little about the quality of the underlying research. It shows only that one of the sources found by the system is real.

Search first, write second

RAG stands for retrieval-augmented generation. It describes an AI setup in which the system searches an external collection before composing an answer, selects a number of documents or passages, and supplies them to a language model. The model then uses that material to draft its response.

The foundational design was described in the 2020 paper Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. Modern systems may contain many more stages and components, but the basic division remains easy to understand: one part finds the material; another turns it into an answer.

Put simply: search first, write second.

This arrangement is useful. The language model is no longer limited to information contained in its training data. It can be given current legislation, court decisions, contracts, administrative acts or internal documents. The system can attach citations, and the user can open the sources on which the answer relies.

But the intermediate step—the selection of material—sets the limit for everything that follows. The model will not usually receive the entire legal collection. It sees only a small selection that has survived a sequence of earlier decisions:

  1. which sources are included in the collection;
  2. whether they were successfully obtained and converted into searchable text;
  3. how long documents were divided into shorter passages;
  4. how the user’s question was transformed into search queries;
  5. which filters restricted the jurisdiction, period or type of source;
  6. how the search results were ranked;
  7. how much of the highest-ranked material was ultimately sent to the model.

Only then does the model begin to write.

The word “model” in the title therefore refers primarily to the generative language model: the part of the system that produces the final answer. Other models may also be used during search, but the decision about which sources the writer will ever see is made before the answer is composed.

This distinction also matters because not every error should be blamed on search. A language model may receive the correct sources and misinterpret them. It may overlook an important fact, conflate two legal standards or make a claim that its citation does not support. But the converse is equally important: even a highly capable model cannot reliably ground an answer in a source it was never given.

The first source can disappear inside the collection

When a provider says that its system “uses legislation and case law”, the claim sounds comprehensive. In reality, it does not tell us which documents were available to the search process on a particular day.

A legal source may exist on an official website but be absent from the system’s collection. It may have been scheduled for inclusion, yet the transfer failed. The file may be stored, but conversion from a scanned document to text may have damaged a provision or footnote. The document may have been converted correctly but omitted from the active search index. It may even be present and searchable, only to be excluded by a filter before ranking begins.

There is therefore a long route between “the source exists” and “the model used it”:

published source → obtained document → usable text → document indexed for search → eligible result → selected passage → material supplied to the model → citation used in the answer

Every arrow represents a condition that can be satisfied or missed.

This is why a verifiable collection inventory is necessary. It should not merely list broad categories such as legislation and case law. It should identify the collections and document types included, the jurisdictions and periods covered, the last successful update, the version of the active search collection, and any known gaps or failed processing steps.

Slovenia’s Legal Information System of the Republic of Slovenia (Pravno-informacijski sistem Republike Slovenije, PISRS) provides text comparison, links between legal acts, advanced search and an application programming interface for access to frequently requested data and texts. It is important public infrastructure. But the description of that service does not prove that an external system has successfully obtained everything a human can access through PISRS, or that every obtained document has been prepared correctly for search.

The official database is responsible for its own service. The developer or operator of an external system must be able to account for its part of the route. Merely naming PISRS in a technical description is no substitute for an actual inventory of obtained documents, the date of the latest update and a record of processing failures.

The consequence for our opening example is direct. If the 90-day exception is not in the active collection at all, a better query, different ranking or more capable language model cannot recover it. The system is searching a library in which the decisive book is missing from the shelf.

The presence of a document does not guarantee that the system will preserve it as a meaningful legal source. Long documents are commonly divided into shorter passages for search. This is often called document chunking.

Splitting a document may be technically necessary, but it is not a neutral choice in law. A cut in the wrong place can separate:

  • a general rule from its exception;
  • a provision from the definition that gives a key term its meaning;
  • a rule from an annex or transitional provision;
  • the operative part of a judgment from the reasons on which it rests;
  • the parties’ submissions from the court’s own reasoning;
  • a cross-reference from the document to which it points.

A passage may be linguistically complete yet legally impoverished. Imagine that a system stores the sentence “the time limit is 30 days”, but drops the section heading, article number, connection to the next paragraph and cross-reference to the exception. The search process has retained genuine words while losing the relationships that give them legal meaning.

Good document splitting should therefore preserve more than text. It should retain the document’s identity, the number of the provision or paragraph, the passage’s position in the whole, links to neighbouring parts and resolvable references to other provisions. For a court decision, the system should also preserve which court decided the case, when it did so, the type of proceedings and the part of the decision from which the passage comes.

The study Towards Reliable Retrieval in RAG Systems for Large Legal Datasets examined this problem in multi-document collections of contracts and privacy policies. In one of its experimental settings, more than 95 per cent of highly ranked passages came from the wrong document. Adding a short document description to each passage roughly halved that error.

That result is a strong warning, not a universal instruction. The study did not concern Slovenian legislation or case law. A substantial share of incorrect results remained after the improvement, and the experiment did not evaluate the complete legal answer. It does, however, demonstrate something fundamental: text stripped of document identity can mislead search, particularly in collections containing many similarly worded legal documents.

The answer is therefore not one standard passage length for every source. The right unit for a contractual clause is not necessarily the right unit for judicial reasoning. The aim is to preserve a legally meaningful unit and its relationships, not to meet an arbitrary character count.

Similar wording is not necessarily legally decisive

When a person searches a legal database, they will often use words taken from the question. Modern search systems can go further: they convert text into mathematical representations and compare meaning even where the wording is not identical. This is known as semantic search.

It is useful, but similarity is not the same as legal relevance.

Two decisions may use almost identical language yet belong to different jurisdictions. An older judgment may contain the precise expression used by the questioner, while a newer judgment uses different words for the legal standard that now governs the issue. A general rule will often be longer and more similar to the question than a short exception, even though the exception decides the case. A summary of one party’s submissions may closely resemble the user’s account but say nothing about the court’s own position.

Legal relevance therefore depends on several further questions:

  • Is this the correct and authoritative document?
  • Does it belong to the relevant jurisdiction?
  • What kind of source is it, and what legal authority does it carry?
  • Did it apply during the relevant period?
  • What is its procedural and institutional position?
  • Is it connected to a definition, exception, annex or another instrument?
  • Does it support, limit, distinguish or contradict the proposed rule?

A search system that recognises textual similarity well does not answer these questions automatically. It also needs reliable metadata, links between documents and rules adapted to the legal task at hand.

The scale of the challenge is illustrated by CLERC, a benchmark built from 1.84 million US federal court documents. Without task-specific adaptation, none of the tested methods recovered more than half of the expected target citations within its first 1,000 results. A conventional lexical search method achieved 48.3 per cent, while a system trained specifically for the task reached approximately 68.5 per cent.

This is not a measurement of Slovenian or European law. The collection contains historical US documents, optical character recognition output and a specialised task in which a removed citation must be reconstructed. The permissible conclusion is narrower: even a very broad search of a legal collection can miss an important source, while recurring legal language can push the wrong documents towards the top.

A search process that collects only support for its first plausible answer is especially dangerous. Legal review must also look for material counter-authority: an exception, a superior rule, a conflicting decision or other material capable of changing the applicable rule, the outcome or at least the degree of confidence. The expression does not imply an identical professional duty in every jurisdiction. It describes a practical test: did the system search for material that could undermine its initial conclusion?

Five gateways through which a decisive source can disappear

Return to the filing made on day 45. The general rule, the exception and the interpretative court decision may all exist in official sources, yet they travel towards the model by different routes. Decisive material can be lost at five points.

Where the failure occurs What happens What the user sees
Collection The exception or judgment was not obtained, converted correctly or included in the active search collection. No warning; the system behaves as though the source did not exist.
Document splitting The rule loses its connection to an exception, definition or another part of the document. A genuine but legally impoverished passage.
Query and filters The system searches the wrong jurisdiction, period, proceedings or source type. Results that sound relevant but answer a different question.
Ranking The correct source is found but falls below the cut-off for material supplied to the model. Only the higher-ranked, often repetitive sources.
Final source package The model receives several supporting passages but not the exception, conflict or direct basis for a material part of the conclusion. A fluent answer with genuine citations and an invisible gap.

The first is a failure of scope. The second damages legal structure. The third changes the search space. The fourth determines which of the sources found will ever be read. The fifth creates an appearance of completeness from material that is only partial.

An official notice on the EUR-Lex page for EU case-law provides a real example of the third distinction. On the cut-off date for this article, the page warns that decisions delivered after 20 June 2025 are temporarily unavailable through subject-matter searches because of a migration, and directs users to CURIA for that search route.

EUR-Lex is not a RAG system, and the notice does not mean that those decisions are absent from official systems. It does establish a clear principle: the existence of a document in a legal information environment is not the same as its availability through a particular search path.

Search performance can be measured. The problem begins when a technical metric is made to carry more meaning than it actually has.

Suppose a checked reference set for a question contains four relevant passages. The system returns three of them among its first five results, together with two irrelevant passages. It has found three quarters of the expected relevant material, so its recall among the first five results—written technically as recall@5—is 75 per cent. Three of its five results are relevant, so its precision among the first five results—precision@5—is 60 per cent.

Both figures are useful. The first shows how much of the pre-labelled relevant material the system recovered. The second shows how much of the returned material was relevant.

Neither tells us:

  • whether the reference set itself missed a decisive exception;
  • whether the collection contained every required type of source;
  • whether a retrieved document had the correct legal authority;
  • whether the model understood the passage correctly;
  • whether the most important conclusion in the answer had direct support.

High recall therefore does not mean that the legal research was complete. It means only that the system found a large share of the material that had been labelled as relevant in advance.

LegalBench-RAG is useful precisely because it evaluates the retrieval of exact passages separately and examines the effects of different document-splitting methods and result counts. Its smaller version contains 776 queries from 72 documents, with the target answer for each query located in a single document. In one tested setting, a particular splitting method without additional reranking outperformed the alternatives; returning more results increased recall but reduced precision.

That is the outcome of a particular experiment, not a league table for every legal search system. A score belongs to a defined collection, set of questions, labelled answers and system version. If any of those elements changes, the claim must be tested again.

More results are not a magic solution

When search misses a source, the first response is understandable: give the model more material. That can help, but the cost is not limited to a longer answer.

More results may make it more likely that the decisive source is included. They also introduce more repetition, irrelevant material and conflicting passages. In RAGChecker, a general rather than legal benchmark, increasing the number of passages from five to twenty raised claim recall from 61.5 to 77.6 per cent and also produced a small increase in sensitivity to noise. This is not a legal result. It does, however, illustrate a trade-off that every legal system must measure on its own tasks.

A second apparent solution is an extremely long input: send the model the entire document, or as many documents as possible. This merely moves the boundary. Someone must still decide which documents enter the input. Lost in the Middle found that, for the models and tasks tested, relevant information was often used less effectively when it appeared in the middle of a long input. The finding cannot be generalised to every current model, but it is enough to reject the assumption that information being present and information being used effectively are the same thing.

Nor is an additional reranking stage an automatic improvement. In LegalBench-RAG, a general-purpose reranking component reduced performance in one setting. In Grounded Answers from Multi-Passage Regulations, task-specific ranking improved results on a different, synthetic collection of regulatory questions. There is no contradiction. The collections, questions, adaptation methods and experimental objectives were different.

Similarly, the Legal RAG Bench preprint used 100 expert-written questions from a single Australian criminal-law practice manual and found that the mathematical representation chosen for search had a greater effect in its experiment than the choice of language model. This is interesting evidence about the importance of early stages, not a universal verdict. The collection is small and narrow, only a limited number of components were compared, and the authors are founders of the company that developed and funded the highest-scoring search component.

There is no single configuration that will reliably solve every legal collection. More results, a longer input, a combination of lexical and semantic search, a graph of document relationships or a more capable model may all help. Each can also introduce a new kind of error. It must therefore be tested against the documents, questions and risks for which the system will actually be used.

And one further point: a better language model cannot serve as an evidential substitute for a missing source. It may correctly guess the answer from knowledge acquired during training. But a correct guess is not the same as a verifiable answer grounded in specific, visible legal sources.

What a system must show before we trust it

A correctly selected citation matters, but it is merely the last visible link in a longer chain. To review an answer seriously, we also need to know which collection it came from, how it was found and what other material was excluded during the search.

This requires a record of the search and source-selection path. At a minimum, the record should make it possible to answer the following questions:

  • What did the user actually ask, and which jurisdiction, date and type of proceedings mattered?
  • Which version of the collection was used, which official databases did it include, and what known gaps did it have?
  • How did the system transform the user’s question for search?
  • Which restrictions did it apply for time, jurisdiction, document type or access?
  • Which documents were found, how were they ranked, and where was the selection cut-off placed?
  • Which passages did the language model actually receive, and in what order?
  • Were linked provisions, exceptions, counter-authority and direct support for material claims checked?
  • Why did the system answer, request further information, expand the search or withhold the answer?

This does not require every internal detail to be made public. A query may contain personal or confidential information, and a collection may contain access-restricted material. Access and retention rules require separate treatment. What matters here is that an authorised reviewer, under appropriate conditions, can reconstruct what happened.

The meaning of a sufficient source package is equally important. It does not mean that the system has found every piece of law that could possibly be found. For an open or disputed legal question, such completeness will often be impossible to establish through one score or one procedure.

Sufficiency must be tied to the task and the risk. For a defined type of question, the required families of sources, links that must be resolved, forms of counter-authority that must be checked and gaps that prevent a reliable answer should be specified in advance. A simple request for a provision requires a different package from an assessment of case law, the validity of a termination or the lawfulness of an administrative decision.

In A Result Is Not a Method, we argued that a legally material result must preserve visible sources, transformations of the material, limitations and the review path. An Audit Trail Is Not a Log explains why a bare technical log is not yet a meaningful reconstruction of a process. The same requirement is narrowed here to search: a reviewer must be able to see not only the cited sources, but also the boundaries of the collection, the routes used and the exclusions that mattered.

For OpenLegalCore, this is an architectural criterion, not a claim that the functionality has already been implemented. Open source code can make the system’s rules, filters and components inspectable. It does not by itself prove that the collection is complete, the search adequate or the legal conclusion correct.

When the system should withhold an answer

Sometimes the most responsible system response is: “An important fact or source is missing, so a reliable conclusion cannot yet be reached.”

That need not end the process. The system can:

  • request a missing date, jurisdiction or type of proceedings;
  • extend the search to another required collection;
  • reveal that the sources conflict;
  • limit the answer to the part that can be supported;
  • escalate the matter to an authorised reviewer;
  • or withhold the answer altogether.

Such a response is appropriate when a required collection is unavailable, document ingestion has failed, an important cross-reference leads to a missing source, a material claim lacks direct support, or a conflict between rules remains unresolved.

The study Sufficient Context supports using a separate assessment that considers not only model confidence but whether the material supplied to the model is sufficient for an answer at all. On general tasks, guided abstention improved the proportion of correct answers among answered cases by approximately two to ten per cent. This was not a legal evaluation, and its concept of sufficiency is broader than legal evidential support. A legal system must define its own conditions according to the task and the consequences of error.

Withholding an answer is not automatic proof of safety either. A system can remain silent too often, fail to stop when it should, or request the wrong additional fact. Evaluations should therefore measure both correct and incorrect refusals, with particular attention to dangerous answers that were not withheld.

Human review is not a magic remedy. If a lawyer sees only the same incomplete source package and citations as the model, the lawyer may approve a beautifully reasoned error. Effective review requires visibility into the limits of the collection, the search path, excluded material and the reason for withholding an answer.

What the AI Act adds—and what it does not

The AI Act matters for risk management, documentation, traceability and human oversight. It is not a shortcut to the claim that every system searching legal sources is automatically high-risk.

Under the currently consolidated text of Regulation (EU) 2024/1689, as amended by Regulation (EU) 2026/1744, classification depends on the system’s intended purpose and actual use.

Point 8(a) of Annex III covers, among other things, systems intended to be used by or on behalf of a judicial authority to assist with researching and interpreting facts and law, or with applying law to particular facts. Similar use in alternative dispute resolution is also included.

It does not follow that every search tool in a law firm, every internal legal assistant and every general conversational system falls into the same category. The identity of the user, the intended purpose, the effect on decision-making and the other conditions in the Regulation all matter.

Article 6(3) provides that certain systems listed in Annex III are not high-risk where they do not pose a significant risk to health, safety or fundamental rights, including by not materially influencing the outcome of decision-making, and perform one of the tasks specified there. Those tasks include a narrow procedural task; improving the result of a human activity already completed; detecting decision-making patterns or deviations without replacing or influencing the completed human assessment in the absence of proper human review; and performing a preparatory task for an assessment relevant to an Annex III use case. A system that profiles natural persons is always considered high-risk under the same paragraph.

In May 2026, the Commission published draft guidelines on the classification of high-risk AI systems. On the cut-off date for this article, the document was still labelled as a draft. It is useful for understanding the Commission’s proposed interpretation, but it is not a final substitute for the Regulation or for an assessment of the particular use.

The timeline also matters. The Regulation applies generally from 2 August 2026. Under the current Article 113, however, Sections 1 to 3 of Chapter III, except Article 6(5), apply to high-risk systems under Article 6(2) and Annex III from 2 December 2027, and to systems under Article 6(1) and Annex I from 2 August 2028. On 3 September 2026, the requirements in Articles 9 to 15 therefore cannot be presented as obligations already applying generally to every legal RAG system.

Article 10 requires particular care. Within the relevant high-risk framework, it governs training, validation and testing data sets. The definition in Article 3 ties the concept of training data to training a system by fitting its learnable parameters. A collection of legal documents searched when a user asks a question is not, merely by serving that function, a training data set for the purposes of Article 10. The same documents could have a different legal role if used to train or independently test the system.

Principles of documented provenance, preparation, relevance and visible gaps nevertheless offer useful guidance for the sound governance of a legal collection. They should not be presented as a direct statutory specification for every RAG system.

If a system does fall within the high-risk category and the relevant provisions apply to it in time, Articles 9 and 11 to 15 support broader requirements concerning risk management, technical documentation, record-keeping, information about limitations, human oversight, accuracy and robustness. They do not prescribe passage length, the number of results, a search method or a threshold at which the system must withhold an answer. Those choices must be justified by the system’s purpose and evidence about its performance.

Seven questions to ask before trusting the answer

Before a legally material answer is used in decision-making, seven questions deserve a clear response:

  1. What was in the collection, and when were its update and contents last verified?
  2. Which required sources were not obtained, converted correctly or included in search?
  3. When documents were split, how did the system preserve provisions, exceptions, cross-references and source identity?
  4. How did it interpret the question, and which rules restricted the jurisdiction, time, proceedings and document types?
  5. Which sources were found, which were excluded, and which passages did the model actually receive?
  6. Were related sources, exceptions, contrary authority and direct support for the most important claims checked?
  7. Which verifiable condition triggers further search, a request for more information, escalation to a human reviewer or withholding the answer?

These questions do not establish that legal research is absolutely complete. They do, however, define what the system actually checked: the part of the legal material it searched, the way it selected sources, and the point at which it acknowledges that the assembled material is insufficient.

One high score cannot end the assessment. A benchmark may measure a defined property of a system well on one precise collection. It cannot, by itself, prove equal performance in another jurisdiction, on other documents, with different questions or after the system has changed. That is the subject of the next article in this series: why a benchmark is not a guarantee.

Limits of this analysis

This article is concerned primarily with legal source collections, search, ranking, the source package supplied to a model and the evidential support for an answer. It does not offer a complete method of legal interpretation, fact-finding, resolving conflicts between jurisdictions or assessing professional duties in a particular country. The opening example is fictional. The cited benchmarks do not measure the Slovenian legal environment. This article is not individual legal advice.

Return to day 45

The applicant’s case is simple only in appearance.

The system found the genuine general rule setting a 30-day deadline. It did not invent a provision or fabricate a link. But the 90-day exception lost its connection to the rule, and the interpretative court decision fell below the selection cut-off. The language model then produced a persuasive answer from incomplete material.

If the search record had been visible, a reviewer could have identified where the failure occurred. If the system had checked the exceptions and linked decisions required for that task, it could have expanded the search. If it could not obtain the decisive source, it should have said so and withheld the answer.

Instead, a genuine citation created the impression that the legal basis had been checked.

That is the danger. A fabricated source alerts the reader that something is wrong. A real provision, official title and working link can conceal the fact that the system saw only half of the legal question.

A citation is therefore not the end of verification. It is the beginning. It tells us what supports the answer. On its own, it does not tell us which collections were searched, which paths were used, which sources were excluded or whether the decisive exception ever reached the model.

A model cannot prove an answer with a source the system never retrieved—and genuine citations do not reveal what the system never searched for or saw.

Selected sources

Law and official infrastructure

Research

Legal and research sources last checked: 3 September 2026.

Publication record

Research verified 3 September 2026Legal cut-off 3 September 2026