AI Legal Assistant Bot with Automated Document Generation
A Telegram bot that helps service professionals handle client disputes. The user describes the conflict in plain words, the bot asks follow-up questions, analyses the case against relevant regulations, and produces a ready-to-use PDF document.
- Role
- Backend Engineer
- Evidence
- Guided intake · domain-constrained analysis · ready-to-send PDF
- Status
- Private by design
The problem
Service professionals face client disputes regularly, but rarely know their legal position. Hiring a lawyer for a small conflict costs more than the dispute itself.
What I built
A Telegram bot that walks the user through the situation and produces a formal document they can actually send.
- Guided intake. A dialogue state machine collects every fact required for the document type before anything is generated. The user cannot skip a step, and the bot cannot produce a half-empty document.
- Domain-constrained analysis. Structured prompting keeps the model inside the legal domain and grounded in supplied reference material, instead of improvising rules that do not exist.
- Document assembly. Collected data is rendered into a formatted PDF, ready to print or send.
Stack
Python, aiogram, LLM API, PDF generation, PostgreSQL, Docker.
Delivered for a private client. Source code is under NDA, so no public link is available. I am happy to walk through the architecture on a call.
Ready when the problem is real
Where does manual work become expensive for you?
Describe the process, the failure you cannot afford and the result you need. We will propose the smallest system that solves it reliably.