Turning complex French legal questions into answers grounded in articles, legislation, and case law.
I built and deployed a private AI assistant for French lawyers that improved retrieval accuracy from approximately 50% to 95%+ in tested scenarios. The system combines legal data engineering, agentic retrieval, and locally hosted language models to answer legal questions with sources users can inspect.
My role: Lead AI Engineer / Agentic RAG Developer
Scope: Legal data pipelines, retrieval architecture, LLM integration, backend APIs, and Azure deployment.
The challenge: preserving legal context
Legal research depends on how information connects. An article can lose its meaning when separated from its title, section, or surrounding provisions. A relevant passage also needs a traceable source before a lawyer can confidently use it.
The project required a system that could process documents of different structures and lengths, identify the scope of a legal question, retrieve supporting articles and judicial cases, and present answers with verifiable references. Private deployment and isolated access for multiple tenants were also part of the requirements.
What I built
1. A legal data pipeline that preserves meaning
I developed an automated ETL pipeline to process thousands of French legal documents, articles, and judicial cases.
The pipeline handled ingestion, text cleaning, article extraction, section-aware structuring, metadata capture, embedding generation, and vector database ingestion. Custom chunking followed legal article and section boundaries to preserve context.
Each searchable unit retained metadata such as article number, title, section, source, and reference. This supported both targeted retrieval and source attribution. Repeatable ingestion also provided a foundation for expanding the legal collection.
2. An agentic workflow for focused legal research
I built a LangGraph workflow that identifies the question’s legal intent, domain, and scope before retrieving evidence.
For each question, the workflow generates 2–5 targeted search queries, retrieves relevant material, removes duplicate results, and reranks the evidence before generating an answer.
This allowed the system to search across different aspects of a legal question while keeping the final response grounded in the retrieved material.
3. Answers connected to articles and case law
I combined ChromaDB-based vector retrieval with Typesense-based search for French judicial cases, supported by reranking and source metadata.
The assistant returns legal answers with article-level references and supporting case law, giving users a way to inspect the basis of a response and continue their research.
Source grounding was central to the design: the goal was to reduce unsupported responses and make the evidence behind an answer visible.
4. Private model serving and cloud deployment
I evaluated and deployed open-source LLM infrastructure, including Qwen2.5:14B, with Ollama and vLLM for model serving.
The deployment included embedding and reranking models on a private Azure GPU VM in the France region, with optimization for an NVIDIA T4 16 GB GPU. I also developed the FastAPI backend, implemented isolated multi-tenant access, and managed Linux deployment and GitHub CI/CD.
This architecture gave the project control over model hosting, inference, and access to legal data.
Results
🔹 Retrieval accuracy improved from approximately 50% to 95%+ in the project’s tested scenarios.
🔹 Answers became traceable to legal evidence, with article references and supporting judicial cases available for verification.
🔹 Thousands of legal documents became searchable through a structured, repeatable ingestion pipeline.
🔹 The assistant was deployed with private model infrastructure, backend APIs, and isolated access for multiple tenants.
The delivered system connected the full research workflow: from raw legal documents to relevant evidence, source-grounded answers, and a deployed application for legal professionals.
Technology stack
Application & orchestration: Python, FastAPI, LangChain, LangGraph, LangSmith
Retrieval & data: ChromaDB, Typesense, embedding models, reranking models
Models & infrastructure: Qwen2.5:14B, Ollama, vLLM, Azure, NVIDIA T4, Linux, GitHub CI/CD
#LegalAI #AgenticRAG #GenerativeAI #LangGraph #Python #Azure #AIEngineering
1 like · 1 view · Nov 16, 2026
Built and deployed a private French legal AI assistant using Agentic RAG, custom legal data pipelines, and citation-backed answers.