← All projects

VisionLawyer

A Telegram bot that answers legal questions based on Ukrainian codes—in Ukrainian, with references to specific articles, strictly adhering to the text of the codes (RAG).

  • Python
  • Telegram Bot
  • RAG
  • ChromaDB
  • OpenAI
  • Whisper
  • PyMuPDF
  • Docker
HTML ★ 0 ⑂ 0 ⟳ 2026-07-04

Telegram bot that answers legal questions based on the codes (legal codes) of Ukraine.
It responds in Ukrainian with citations of specific articles, strictly relying on the texts of the codes (RAG: hybrid search across articles + semantic search).

Features

  • Text-based Q&A on legal codes with LLM-based reranking of candidates.
  • Verbatim text of the article + adjacent articles (N–1, N+1) in context.
  • Inline buttons for "full text of the article" under each response.
  • 📷 Image understanding of documents (protocols, summons, fines) — recognizes text/article numbers from photos.
  • 🎤 Voice messages — transcribed via Whisper.
  • /status — version check of the codes against zakon.rada.gov.ua.
  • Conversation memory, per-user rate limiting, legal disclaimer attached to every response.

Tech Stack

Parsing: PyMuPDF / BeautifulSoup4 · Chunking by articles · Embeddings: OpenAI text-embedding-3-large · Vector store: ChromaDB · Responses: OpenAI GPT · Interface: python-telegram-bot · Deployment: Docker Compose.