Context
ALEI, Analise Legal Inteligente, was an AI-driven initiative aimed at supporting legal analysis for second-instance judicial chambers at TRF1. The project combined backend architecture, machine learning, and process automation in a setting where legal professionals needed tools they could actually use in daily work.
The project mattered because institutional AI adoption does not happen through models alone. It depends on data pipelines, APIs, operational reliability, and direct enablement of the professionals expected to work with the outputs.
My role
- Worked as Data Scientist & Backend Developer on the initiative.
- Built backend services and data workflows while also contributing the ML layer.
- Led a cross-functional development and research team across implementation, documentation, and delivery.
- Trained federal court staff to use and interpret the system outputs.
Problem
TRF1 needed support for legal analysis and case-management workflows that were still too dependent on manual handling. The challenge was not only to classify or cluster legal documents, but to package that intelligence inside a backend foundation that court teams could rely on.
That meant the solution had to work at multiple levels:
- usable APIs for institutional integration
- databases and services stable enough for ongoing operation
- ML pipelines that could support document clustering and analysis
- training and documentation that would help legal teams adopt the system
Architecture
The project combined backend and ML components in one delivery flow:
- RESTful services built with Flask and FastAPI
- relational data modeling with PostgreSQL and SQLAlchemy
- containerized services using Docker for local environments and repeatable setup
- ETL pipelines for structured legal datasets
- exploratory analysis and visualization with Pandas and Matplotlib
- unsupervised ML workflows for clustering and classification of legal documents
- automated tests with Pytest and documentation for maintainability
The key architecture choice was to avoid separating “backend work” from “AI work” as if they were independent streams. The system needed both to become useful in practice.
Challenges
- Legal workflows require technical systems that are stable enough for non-technical institutional users.
- Document analysis work becomes fragile if the data pipeline, API layer, and ML layer evolve separately.
- Adoption depends on staff understanding and trust, not only on model outputs.
Solution
I treated ALEI as a full delivery problem instead of a pure modeling exercise. That meant building the backend services, relational data layer, ETL flow, and ML workflows as one connected system with clearer technical documentation and automated checks.
I also invested directly in enablement. Training court staff and standardizing documentation made the project more operationally credible and helped the AI outputs become part of the real workflow instead of staying in a technical silo.
Impact
- Led a hybrid AI and backend team while balancing technical mentorship and delivery execution.
- Built a semi-automated data-analysis pipeline that reduced manual work on project datasets.
- Improved operational adoption by training legal professionals to use AI-assisted tools in their daily workflow.