How it works under the hood: How we are building a legal AI assistant – Part 1
Discover why traditional legal search fails and how our legal AI assistant combines full-text search and semantics to find answers faster and more accurately, without the frustration.
You search for “monitoring workplace communications” but find nothing. You try “retaining emails for archiving”—still nothing. Perhaps you are simply searching incorrectly, or you need to try another tool. Maybe switch to Google.
No, it is not your fault. It is the system’s fault.
This post is the first in a series in which I will show you how our legal AI assistant works, helping users find legal answers faster, more intelligently, and without frustration. We will examine the technical foundations on which it is built—from semantic search and text processing to system prompts and working with documents—all within a legal context.
The problem with traditional legal search
Legal search today often resembles detective work more than working with information.
From our experience, we know that lawyers do not use just one tool. They alternate between Slov-lex, various paid tools, or—when nothing else works—Google and even Czech legislation.
They repeat the same query over and over, changing the wording slightly, trying synonyms, and searching both with and without diacritics.
Traditional search either requires every word to appear exactly in the text being retrieved, which often means finding nothing, or retrieves every text containing at least one search term, which usually produces far too many results.
And this is the biggest problem:
When you search for something and find nothing, you do not know whether it truly does not exist—or whether the system simply failed to understand what you meant.
Alternative search methods
Full-text search
Unlike conventional search, full-text search is more advanced.
It can search automatically both with and without diacritics, recognizes different forms of words (for example, monitor, monitoring, and monitored), and intelligently ranks results by their likelihood of matching. This increases the chance of relevant results appearing even when the query is phrased less precisely.
Some more advanced systems even allow users to modify queries with characters such as “-”, “+”, or “*” to exclude words or find partial matches.
Another advantage is speed and accuracy for clearly formulated queries. Full-text search is well suited to finding the names of laws, specific statutory sections, or known phrases—especially when you know exactly what you are looking for.
However, you still need to know the specific words used in the text, understand how to operate a complex system, and be willing to review a large number of results—often an order of magnitude more.
Smarter search through semantics
Semantic search works in a completely different way. It does not look for specific words, but for meaning. (We will discuss how semantic search and embeddings work in greater detail in the next article.) In short, it attempts to capture the “essence” of words or sentences and find passages with similar meanings, even when they are phrased entirely differently.
A system may therefore find the phrase “monitoring electronic communications” through queries such as “retaining emails for archiving”, “police—collecting and analyzing text messages”, or “monitoring workplace communications”.
This approach is particularly useful when you do not know exactly which words should appear in the text, or when legislation or a court decision uses different wording from yours.
Naturally, this approach also has limitations, which we will address later.
Hybrid search: The best of both worlds
The best approach is to combine the advantages of both alternative systems: use the accuracy and speed of full-text search where we know exactly what we are looking for, and semantic search where simple word matching returns nothing meaningful.
Our system automatically determines which type of search to use and how to combine them. You therefore do not need to learn any complex systems.
We also use several techniques to improve this combination further—for example, we apply semantics primarily to longer queries, use stemming, try word synonyms, preprocess queries for specific phrases, and more.
In the next article, we will look at embedding—how a system can “understand” the meaning of sentences in semantic search.
If this interests you, try our tool at praktik.ai. Enter your own legal issue and compare the results with what you would find manually. Alternatively, contact us directly—we will be happy to provide more information, a demonstration, or feedback on your specific case.