DEV Community

acuerdio for Acuerdio

Posted on • Originally published at acuerdio.com

Real-time Mediation with WebSockets: How We Built a Legal Dispute Resolution Platform

When two parties are in conflict, communication is everything. At Acuerdio (https://acuerdio.com), we built a real-time mediation platform where AI and human mediators guide disputes to resolution — all through WebSockets.

Why Real-time Matters in Mediation

Mediation isn't like a chatbot conversation. It's a structured negotiation where:

  • Both parties need to see proposals simultaneously
  • A mediator (AI or human) orchestrates the conversation
  • Legal documents need to be drafted and signed in real-time
  • Video sessions happen alongside text-based negotiation

We needed a system that handles all of this with sub-second latency.

Architecture: Django Channels + Remix

We use Django Channels with a Redis channel layer for WebSocket communication. The frontend uses Remix 2 + React 18 with custom hooks for real-time state management.

The Mediation Flow

  1. Party A opens case
  2. AI analyzes conflict
  3. Both parties join real-time session
  4. AI proposes resolution / Parties negotiate
  5. Agreement reached
  6. eIDAS signature
  7. Legal document generated

AI as Mediator

The AI mediator participates in the WebSocket session just like a human would — analyzing both parties' positions and suggesting fair resolutions in real-time.

Video Integration with Daily.co

For complex cases, we offer video mediation sessions powered by Daily.co with:

  • Private rooms (max 4 participants)
  • Recording enabled (legal requirement)
  • 1-hour session limit

Scaling Considerations

  • Redis Cluster for channel layer (handles 10K+ concurrent connections)
  • Celery workers for async LLM calls (don't block the WebSocket)
  • PostgreSQL with pgvector for legal document similarity search
  • S3 for recorded video sessions and signed documents

Lessons Learned

  1. WebSocket reconnection is critical — Users on mobile networks drop frequently
  2. Message ordering matters — In legal mediation, the sequence of proposals is legally significant
  3. AI latency management — Show typing indicators while AI processes
  4. Privacy by design — All messages are encrypted, mediations are confidential by law

Built with Django Channels, Remix, and a lot of legal expertise. Acuerdio (https://acuerdio.com) — Resolve disputes without going to court.

Top comments (0)