Back to projects
AI
Legal Consulting Firm

AI Chatbot with RAG for Legal Firm

Document cataloging and semantic search system for legal consulting

Docker
LangChain
n8n
Next.js
OpenAI API
PostgreSQL
TypeScript

The Challenge

The legal firm managed a massive amount of information fragmented across different formats: not just legal PDFs and contracts, but also audio transcripts of hearings, emails, client chats, and agreements. Cataloging was manual and error-prone, making it nearly impossible to quickly cross-reference data from such heterogeneous sources to build a defense strategy or respond to a client. Centralizing this knowledge while ensuring maximum privacy was paramount.

The Solution

I developed a unified platform for the ingestion and analysis of multimodal documents. The system allows lawyers to upload any digital file type (text, audio), which is processed by a local workflow automation system. The engine extracts content, transcribes audio if necessary, and automatically catalogues it by client and case. Thanks to an advanced RAG engine, users can query the entire knowledge base (from a single email to a PDF judgment) in natural language, obtaining answers that precisely cite the original source.

Key Features

Next.js platform for intuitive upload and management of legal documents and evidence
Multimodal ingestion: support for PDF, Docx, Email, Chat exports, and Audio Transcripts
Automatic cataloging by Client, Period, and Consultation Type
AI flow automation via local workflow engine (n8n)
Advanced semantic search to find concepts across different formats
Privacy-Focus architecture with granular permission management

Results

70% reduction in time required for cross-referenced document research
Ability to query the entire client history (audio, emails, contracts) in one go
Elimination of manual cataloging errors
Secure and organized digitization of the firm's historical archive

Tech Stack

Frontend: Next.js, React, Tailwind CSS. Automation: n8n (Self-hosted). AI/LLM: OpenAI / Local Models (Ollama), LangChain, Whisper (Audio). Database: PostgreSQL + pgvector. Infra: Docker, Private Cloud.