Skip to main content
Back to projects

Legy.md

AI legal assistant for Moldovan legislation

My role
Founder and builder. I designed and implemented the retrieval pipeline and the full application — frontend, backend services, deployment — and I run it.
Status
Live · 2026
Source
Source code is private · legy.md (opens in a new tab)
Stack
  • Next.js
  • TypeScript
  • Python
  • FastAPI
  • OpenAI API
  • PostgreSQL
  • Qdrant / ChromaDB
  • RAG

What it is

Legy.md answers questions about Moldovan legislation in Romanian, Russian and English, and shows the articles each answer is based on. It is my own product, live at legy.md in public beta.

The problem

Moldovan law is spread across codes and amendments that are hard to search for non-lawyers, and a general-purpose chatbot answers confidently without saying where an answer comes from. For legal questions, an answer is only useful if the reader can check it against the source.

Architecture

Legal sources are ingested from PDF, split into chunks and indexed twice: as vectors (dense) and for keyword search (sparse). A question retrieves candidates from both, a reranker orders them, and the answer is generated from the top passages with citations back to the articles.

Legy retrieval pipelineINGESTIONQUESTION TIMELegal sources (PDF)Parse and chunkVector index (dense)Keyword index (sparse)User question (RO/RU/EN)Hybrid retrievalRerankerAnswer with cited articles

What I built

The front end is a Next.js/TypeScript app; retrieval and answer generation run as Python/FastAPI services over PostgreSQL and a vector store (Qdrant/ChromaDB), with the OpenAI API for embeddings and generation. Requests are routed by language (RO/RU/EN), and every request's token usage is tracked.

Reliability and safety

  • Answers cite the source articles, so they can be checked
  • Usage tracking and cost control per question
  • A consent dialog explains that answers are legal information grounded in Moldovan law
Legy landing page — 'Your Pocket Lawyer' hero
Legy landing page — 'Your Pocket Lawyer' hero 1 / 9

Outcome

  • Live at legy.md in public beta, answering in three languages with cited sources.