Prawbot. 3.9 million Polish legal documents in a single conversation.
Prawbot. 3.9 million documents
of Polish law in a single conversation.
- General-purpose chatbots make up case references and regulations
- Law firm client data ends up in someone else's cloud
- Brzmienie przepisu sprzed nowelizacji
- Working on 50+ files at once, not on a single question
- Our own law database: 14 collections, hybrid search
- Case chat and citation guards
- Deep research, agents, case memory
- AI model on our own GPUs, server in Warsaw
- 3.9 million documents in 14 databases
- Every citation checked at the source before answering
- Subscription with implementation included or pay per use
- From first commit to production: 5 months
A lawyer asks a chatbot. The chatbot answers confidently. The case reference does not exist.
Law firms tried using general-purpose AI assistants for legal research. The result kept repeating: the answer sounds like a textbook, the case reference looks correct, and there is no such judgment in the case law database. Or there is, but it's about something else. The lawyer has to check everything from scratch, so the time savings disappear.
Drugi problem: dane klienta. A contract, an indictment or litigation documents pasted into a public chatbot end up on infrastructure the law firm has no control over. For a profession bound by confidentiality, this is not a technical detail, it's a question of liability.
Trzeci problem: currency. A language model remembers a provision as worded on the day of training. Polish law changes every week. Without access to the consolidated text “as of today” and the act's status (in force, repealed, amended), the answer may be correct for the state of the law a year ago.
The fourth problem is the least visible in a demo and the most important in real work: a law firm doesn't ask single questions. It gets a case with 50 files, scans and a history of correspondence. It needs a tool that will read all of it, remember it and work on it for weeks.
We had a head start. We had previously built, for our own needs, a Polish law database with semantic search and a set of tools used by our AI agents. We decided to turn it into a product for law firms.
What we built. Prawbot's four modules.
Polish law database with hybrid search
14 collections in one index: rulings of common courts, the Supreme Court, the Constitutional Tribunal and the National Appeals Chamber, rulings of the Supreme Administrative Court and regional administrative courts, articles of statutes and codes with wording history, tax interpretations, decisions of UODO, KNF and UOKiK, the KRS register, legal acts with ELI metadata, Sejm proceedings and votes, public procurement. Search combines semantic and full-text matching with reranking trained on Polish legal language.
Case chat and citation guards
The model doesn't answer from memory. It queries the database through more than 40 tools: search judgments, read an article as of a given date, check an act's status, show related rulings. Citation guards make sure every case reference and every article in the answer was actually read in this conversation. A citation that can't be anchored in a source is flagged as requiring verification.
Deep research, agents and case memory
For difficult cases: planning research questions, parallel specialist agents for individual areas of law, completeness checks and synthesis into a long opinion with footnotes. Case memory keeps findings between conversations. The agent workflow builder lets a law firm assemble its own process across dozens of files. A document generator with more than 400 document types completes the work.
SaaS platform for law firms
Accounts for individuals and law firms, law firm verification by tax ID (NIP) and bar registration number, workspace roles, cases and files with automatic scan reading, billing for actual use with starter credits, online payments. A full set of documents: terms of service, privacy policy, data processing agreement (Art. 28 GDPR), AI disclosure compliant with Art. 50 of the AI Act, data subject rights procedure.
Under the hood
The entire architecture is based on the RAG pattern with citation verification. Backend in Python (FastAPI), frontend in React and TypeScript. The law index lives in the Qdrant vector database: 14 collections, more than 20 million text chunks, each with a semantic vector and a full-text index. Tools for the model are exposed via the Model Context Protocol (MCP), so the same set serves the in-app chat, the research agents and external MCP clients.
The language model is an open-weight model running on our own GPU servers. No query or document is sent to an external model provider. The platform and data sit on a dedicated server in the OVHcloud data center in Warsaw. Deployments run blue/green behind a Caddy reverse proxy, and a CI/CD pipeline on Gitea Actions runs tests and switches traffic with zero downtime.
A general chatbot vs Prawbot. Same case, different answer.
- Sygnatura wyroku from the model's memory, without verification
- The provision as worded from the training date
- Client documents in your infrastructure outside the law firm's control
- One question, one answer, no case memory
- Per-user subscription, regardless of usage
- Brak umowy powierzenia dopasowanej do kancelarii
- Sygnatura read from the database in this conversation, or flagged for verification
- Przepis as of a given date, with the act's status and amendments
- Data on a server in Warsaw, model on our own GPUs
- A case with files, memory and research history
- Subscription or pay-per-use, start-up loans
- One GDPR agreement: controller and provider in one
Liczby projektu.
including 744k rulings
semantic + full-text
~200 tys. linii kodu
code and client isolation
Plus: 100+ database migrations, 120+ test files, more than 400 document types in the generator, 10 legal documents ready for publication. All in one repository, with an architecture wiki written alongside the code.
The hardest part wasn't deploying the model. The hardest part was teaching the system not to answer until it had read the source. A lawyer doesn't need an assistant that sounds confident. They need one that shows where it got the answer.
How the build went. Five months.
1
Law database, tools for the model, citation verifier
Indexing 14 collections into Qdrant, hybrid search with Polish-language reranking, a tool layer on the MCP protocol. The first SaaS module: a verifier that extracts case references and articles from an answer and checks them against the database. 270 commits in the first month.
2
App for law firms
Accounts, roles, workspace, cases and files. Case chat with streamed responses and tool calls. Reading scans and photos of documents. The first version of token-based billing.
3
Deep research, agents, audits
Research pipeline: question plan, specialist agents, completeness verification, synthesis. Memory of the case. Agent flow builder and template library. Two security audits (code and client isolation), fixes implemented. Landing, price list, set of legal documents.
4
Production and own equipment
Dedicated server in Warsaw, blue/green deploy, CI/CD. Transferring the language model to your own GPU servers with context counted in hundreds of thousands of tokens. Reasoning modes selected separately for chat and research.
5
Benchmarks, tests and gatekeepers
We built own set of legal benchmarks: cases from several fields, with traps for specific provisions and fictitious theses of judgments, assessed automatically by an independent model judge and compared with the best commercial models. The conclusion was clear: errors appeared almost exclusively where the model responded without reaching the database. We included citation and regulation guards, sifted out amending laws from the results, and banned guessing at facts in the prompt. Onboarding of subsequent law firms with verification within 24 hours.
AI for a law firm: how to implement an assistant that doesn't make up case numbers
A guide for law firm partners, in-house counsel, and people responsible for IT at legal businesses. We explain how AI for a law firm based on RAG and Polish law works, how it differs from a general-purpose chatbot, and what to ask a vendor before implementation.
Why a general-purpose chatbot isn't suitable for legal research
A general-purpose AI assistant answers from the model’s memory. It sounds confident and gives a case number in the correct format, but the case-law database has no such ruling, or it concerns something else entirely. The lawyer then has to check everything from scratch, so the time savings disappear.
The second problem is currency. The model remembers a provision as worded on the date of training, and Polish law changes constantly. Without access to the consolidated text as of a given date and the act's status, an answer may be correct for the state of the law a year ago.
The third problem is organizational. A law firm rarely asks one-off questions. It works on a case with dozens of files, scans, and correspondence it keeps coming back to for weeks. A tool built for one-off questions can't handle that.
RAG on Polish law: how it works and what it requires
RAG (retrieval-augmented generation) is a pattern in which the model searches for and reads sources before answering, and only then writes the answer based on them. In law, this means the quality of the system depends primarily on the database and the search engine, and only secondarily on the model itself.
In the implementation described above, the database covers 3.9 million documents in 14 collections, including 744,000 court rulings. These include rulings of the common courts, the Supreme Court, the Constitutional Tribunal, the National Appeals Chamber (KIO), and the administrative courts (NSA and WSA), articles of statutes and codes with their wording history, tax rulings, decisions of the UODO, KNF, and UOKiK regulators, legal acts with ELI metadata, and the work of the Sejm. The index contains more than 20 million text fragments.
Collecting the data alone isn't enough. Legal language requires hybrid search: semantic matching captures the meaning of the question, while full-text search catches exact case numbers and institution names. Finally, a reranker trained on Polish legal language orders the results by relevance. The database also has to be refreshed regularly from official sources, in this case daily.
The practical takeaway: when asking a vendor about RAG on Polish law, ask first about the scope and freshness of the database and how search works. The name of the language model matters less, because the model can be swapped, while building a well-indexed database of case law and legislation is the most labor-intensive part of the project.
AI hallucinations in law: verifying citations at the source
RAG reduces the risk of hallucinations but doesn't eliminate it. The model can still add a case number it hasn't read. That's why Prawbot has an additional layer: citation guards compare every case number and every article in the answer against the list of documents actually read in that conversation. A citation that can't be anchored in a source is flagged as requiring verification.
This mechanism came out of testing. The team built its own set of legal benchmarks with case problems from several areas of law, including traps involving special provisions and fabricated case-law holdings. The conclusion was clear: errors occurred almost exclusively where the model answered without consulting the database.
A practical tip when choosing a tool: ask to see what happens when the system can't find a source. Good AI for a law firm should clearly flag that, not answer in a confident tone.
Attorney-client privilege and a language model on your own servers
A contract, an indictment, or litigation documents pasted into a public chatbot end up on infrastructure the law firm has no control over. For a profession bound by confidentiality, that's a question of liability, not a technical detail.
The solution is an open-weight model running on servers controlled by the service provider or the law firm itself. In Prawbot, the model runs on its own GPU servers, and the platform and data sit on a dedicated server in an OVHcloud data center in Warsaw. Queries and documents are not sent to an external model provider. For law firms with stricter requirements, a dedicated instance isolated from the shared cloud is available.
On top of that comes the formal layer. During implementation, it's worth checking whether the vendor has a data processing agreement compliant with Art. 28 GDPR, an AI disclosure compliant with Art. 50 of the AI Act, and a procedure for handling data subject rights. In the project described, a full set of such documents was part of the product, and the code and client isolation were verified by two security audits.
What AI for a law firm should be able to do beyond answering questions
Chat with citations is just the beginning. In day-to-day work, what counts are features that support the entire case:
- a provision as of a given date, with the status of the act (in force, repealed, amended) and a list of amendments,
- case memory, which retains findings between conversations,
- reading scans and photos of documents uploaded to the case,
- deep research: a plan of research questions, parallel specialist agents for individual areas of law, and synthesis into a memo with footnotes,
- legal document generator, in Prawbot over 400 document types,
- custom agent workflows, in which the law firm assembles a repeatable process across dozens of files.
Technically, all of these features use a single set of more than 40 tools exposed via the Model Context Protocol (MCP): search judgments, read an article as of a given date, check the status of an act, show related rulings. As a result, the chat, research agents, and external MCP clients all work on the same verified sources.
How to choose an AI implementation partner for a law firm
Before signing a contract, it’s worth asking the vendor a few specific questions:
- Does the system read the source before answering, and how does it flag citations it hasn't verified?
- What data was it tested on, and can you test it on our documents?
- Where do the model and database physically run, and who is the data processor?
- How often is the legal database refreshed, and where does the data come from?
- What does maintenance look like after implementation, not just the project itself?
The answers to these questions tell you more than a demo. A demo shows well-chosen examples, but in practice, a tool's usefulness depends on how it behaves on a difficult case with incomplete data.
We describe the ready-made platform on the page Prawbot: an AI platform for lawyers, and we bring the same RAG pattern with source verification to other companies' documentation and procedures as part of AI implementations, and the easiest way to start a conversation about your specific law firm is through the contact.
Three questions we hear from every law firm.
AI makes things up. How do I know that this judgment really exists and says what the assistant claims?
Prawbot does not quote from memory. Before providing the reference number, he reads the ruling in the database in the same conversation. The citation guard compares each reference number and each article in the response with the list of actually read documents. If something can't be anchored, you get a clear „requires review” tag instead of a confident tone. Each quote is clickable and leads to the full text. More about the mechanism in our article about the six signals of a hallucinating chatbot.
Where is my customer data and who has access to it?
The platform and data are located on a dedicated server in the OVHcloud data center in Warsaw (ISO/IEC 27001 and 27701). The language model runs on our own GPU servers, so the content of conversations and documents does not go to any external AI provider. Prawbot is the sole data controller, OVHcloud acts as a processor only on our instructions. You sign the entrustment agreement once, with us. We don't train models on your questions or documents.
How much does it cost?
There are two models to choose from. A law firm that wants Prawbot as a platform for the entire team takes a subscription: PLN 800 per month, and implementation, integration and training are included in the price. You can calculate your variant in the calculator below. If you prefer to start with no strings attached, you only pay for actual use, in tokens. Fragments of the conversation that the model already has in its cache are not counted again, and you get free credits to start with. You can see consumption on an ongoing basis in the panel, per user and per case.
Does Prawbot work in the on-premise version, on our own server?
Yes. We install Prawbot Enterprise as an instance dedicated to the law firm, on your server or on a dedicated server of a selected cloud provider. The language model, Qdrant vector database and backend run in an isolated environment, without connection to the JSON Crew cloud. This is a scenario for large law firms and corporate legal departments with strict compliance requirements.
Where does Prawbot get its current regulations? Does it take into account the latest amendments?
The vector database is refreshed every day from official sources: the Sejm, the Journal of Laws, systems for publishing the jurisprudence of common courts, the Supreme Court, the Constitutional Tribunal, the Supreme Administrative Court and the Provincial Administrative Court, tax interpretations and decisions of the Personal Data Protection Office (UODO/KNF/UOKiK). Each article of the Act has a full wording history with ELI metadata. Prawbot can show the provision as „as of” and indicate that there were X amendments after that date.
How long does it take to implement Prawbot in a law firm?
Standard implementation (access to the general law database + integration with the office system + team training) takes 2-3 weeks from order to production. Implementation with the law firm's own database of precedents means an additional 2-4 weeks for indexing and verification of search quality. We set a specific date after a 30-minute diagnostic conversation and counting the volume of documents.
How to choose an AI implementer so as not to end up with a system that no one in the company uses?
Three signals that we check in-house and that are worth asking every supplier about: (1) own benchmarks on your documents, not on generic sets, (2) architecture with source citation verification, not trust in the model, (3) post-implementation maintenance plan, not just the design. We write about this in more detail in the article „how to choose an AI implementer for the legal industry”.
Calculate the cost of implementation
Choose the scope of Prawbot implementation in your law firm. The one-time price includes knowledge base setup, integration and training. The monthly subscription covers access for the entire law firm and updates to the Polish law database.
Do you have a knowledge base that AI should answer from without making things up?
We'll show you live how Prawbot checks citations at the source, and how we apply the same pattern to documentation, procedures or the product catalog in your company. 30 minutes, no sales pitch.
Check before we talk
Services associated with this deployment. Take a look at the offer, see how we approach similar problems in other customers.
Did you like this article?
If after reading this you feel your company also has processes worth rebuilding, book a free call. Together we will check where sales are really leaking and what makes sense to implement first.
Schedule a call