DEV Community

acuerdio for Acuerdio

Posted on • Originally published at acuerdio.com

Building an AI Mediator: Multi-LLM Architecture for Legal Dispute Resolution

At Acuerdio (https://acuerdio.com), we built Spain's first AI-powered online mediation platform. Here's how we designed a multi-LLM architecture that understands legal conflicts and proposes fair solutions.

The Problem

Spain's new law (LO 1/2025) requires parties to attempt alternative dispute resolution before going to court. That's millions of potential cases — from neighbor disputes to family conflicts — that need a scalable, AI-assisted mediation process.

We needed an AI system that could:

  • Understand legal context in Spanish
  • Propose balanced solutions to both parties
  • Generate legally valid documents
  • Handle sensitive emotional situations with empathy

Architecture: Multi-Provider LLM Strategy

We don't rely on a single LLM. Our architecture uses multiple providers with intelligent routing.

Why Multi-LLM?

  1. Resilience — If one provider goes down, we failover automatically
  2. Cost optimization — Use cheaper models for simple tasks
  3. Best-of-breed — Each model excels at different aspects of mediation
  4. Compliance — We can route sensitive data to EU-hosted models

The Mediation Pipeline

  1. Case Analysis → Understand the conflict type and legal framework
  2. Party Profiling → Assess each party's position and interests
  3. Proposal Generation → Create balanced resolution proposals
  4. Agreement Drafting → Generate legally binding documents

Legal Context Understanding

Spanish legal mediation has specific requirements. We built a RAG system with:

  • Spanish Civil Code
  • LO 1/2025 (mandatory ADR law)
  • Regional mediation regulations
  • CGPJ case law database

AI-Assisted Proposals

The AI generates resolution proposals that consider:

  • Legal precedent for similar cases
  • Both parties' stated interests
  • Fair distribution principles
  • Enforceability of the agreement

Tech Stack

  • Backend: Django 5 + DRF + Channels (WebSocket for real-time mediation)
  • Database: PostgreSQL 16 with pgvector for embeddings
  • Task Queue: Celery + Redis for async LLM calls
  • Frontend: Remix 2 + React 18
  • Video: Daily.co for live mediation sessions
  • Signatures: eIDAS-compliant electronic signatures

Results

  • AI resolves ~70% of simple disputes without human mediator involvement
  • Average case resolution: under 72 hours (vs 14.3 months for courts)
  • Cost: from 9 EUR (vs 3,000-10,000 EUR for litigation)

What's Next

  • Voice-based mediation using real-time speech-to-text
  • Predictive analytics for case outcomes
  • Multi-language support (Catalan, Basque, Galician)

Acuerdio is Spain's first AI-powered mediation platform. Try it at acuerdio.com

Top comments (0)