michaleiatrak-star/Lex-Machina

Analityka polskiego prawa, przygotowanie pism procesowych, weryfikacja przepisów prawa polskiego i orzecznictwa z oficjalnych źródeł z zakazem cytowania z pamięci, przygotowanie umów i ich weryfikacja wraz z analizą ryzyk.

What it solves

Lex Machina tackles the problem of AI systems inventing or misremembering legal citations when asked about Polish law. A wrong article number, an unverified court-case signature, or a misattributed ruling can be professionally damaging. The system enforces a strict principle: no statute, journal number, deadline, or court signature may be quoted from memory — every citation must be verified online in the same step before it appears in any output.

How it works

Lex Machina is a set of 32 modular "skills" (structured Markdown instruction packages) that together form a complete legal-work toolkit. A case enters at a router that classifies the matter and selects the appropriate domain module — 16 modules cover areas from constitutional and civil law through taxes, employment, and EU law. An executive skill (such as drafting procedural documents, analyzing contracts, evaluating evidence, or planning witness interviews) then performs the task. Every citation of a legal provision or court ruling passes through shared verification gates that check it against official sources using deterministic APIs (the Polish Sejm ELI endpoint, court databases, EUR-Lex) before it can be included in the final answer. Each response carries a visible verification trail showing what was checked and when.

Who it's for

The system serves anyone working with Polish law who wants AI assistance without the risk of fabricated citations. It offers two entry modes: a lawyer mode (PRAWNIK) for legal professionals, and a layperson mode (LAIK) with a guided walkthrough for non-specialists. Because the skills are host-neutral, the same set runs on Claude, ChatGPT-compatible platforms, and Grok — users can keep their preferred AI assistant.

Highlights

  • Hard anti-hallucination gate — no provision, journal number, rate, deadline, or court signature may be cited without live online verification in the same step; sources are checked in a fixed hierarchy (MCP connectors first, then official APIs, then web search as last resort)
  • Four-status signature verification — court-case signatures resolve to FOUND, NOT_FOUND, AMBIGUOUS, or OUT_OF_SCOPE; the system never guesses between ambiguous candidates
  • Verification gradient — the level of verification must match the strength of the claim (existence vs. paraphrase vs. verbatim quote), closing the "true citation, false thesis" loophole
  • Visible audit trail — every response includes a verification marker (source and date), and a full audit journal (950+ sessions) with SHA-256 manifests supports AI Act article 12 compliance
  • Cross-platform by design — the identical skill set runs on Claude, OpenAI-compatible hosts, and Grok (which installs directly from the GitHub repository), with a runtime adapter that maps host-specific operations to equivalents where needed
  • Honest coverage reporting — the system documents its known gaps (for example, missing article content in the criminal enforcement code, scattered citations in the administrative procedure code) in coverage reports rather than masking them

Related

  • Project
  • Project
  • Project
  • Project