Tomasz KozakiewiczTK
← Work

Legal search for public-sector lawyers

An assistant that searches Polish law and the office's own archive, and shows where every answer comes from. It runs on the office's own servers. Rolled out one department and one archive at a time, it now serves about 45 lawyers.

Role
Built it and rolled it out
Where
A Polish public agency
When
2025 > now · live
In short
RAG · on-prem · 200K+ docs · 45 lawyers

The problem

The lawyers look things up in Polish law and in their own case archive all the time. Much of that archive is scanned paper.

What I built

An assistant on the office’s own hardware, with no cloud. A lawyer asks a question, and it finds the passages that matter in the law and in the archive, scans included, then writes the answer from them with a link to each source document. So every answer can be checked.

Find first, write second. RAG, Django, PostgreSQL with pgvector, local models.

How it got used

First I sat with the lawyers and mapped how they actually research. Then I added single sign-on, so they log in automatically, and rolled it out one department’s archive at a time. It holds over 200,000 documents now, and about 45 lawyers use it.