Zing Forum

Reading

Nyayrithm: A Multi-Agent Court Simulation Platform Where AI Acts as Judges, Lawyers, and Witnesses

Nyayrithm is an open-source multi-modal legal reasoning and court simulation platform. It simulates real court scenarios using a multi-agent system, supports various evidence formats including PDF, audio, and video, and provides legal practitioners with tools for strategy rehearsal and case analysis.

AI法律科技多智能体系统法庭模拟RAG开源项目多模态Gemini法律推理
Published 2026-05-23 14:15Recent activity 2026-05-23 14:18Estimated read 6 min
Nyayrithm: A Multi-Agent Court Simulation Platform Where AI Acts as Judges, Lawyers, and Witnesses
1

Section 01

Nyayrithm: Open-source Multi-agent Court Simulation Platform

Core Overview Nyayrithm is an open-source multi-modal legal reasoning & court simulation platform developed by Aayush-Joshi-01 (hosted on GitHub, released on 2026-05-23). It uses multi-agent systems to simulate real court scenarios, supporting PDF/audio/video evidence formats. Key features include role-aware RAG, dynamic agent generation, and citation traceability, serving as a tool for legal strategy rehearsal and case analysis.

Key Keywords: AI, legal tech, multi-agent system, court simulation, RAG, open-source, multi-modal, Gemini, legal reasoning

2

Section 02

Background: AI's Entry into the Legal Field

The legal industry has long been seen as AI-resistant due to complex laws, subtle evidence weighing, and human experience. However, large language models are changing this. Nyayrithm stands out by simulating full court processes—AI agents play 8 roles (judge, prosecutor, defense lawyer, witness, etc.) to conduct debates and reasoning, moving beyond basic Q&A tools.

3

Section 03

Core Features & Technical Architecture

Multi-agent Role System

8 predefined roles (judge, prosecutor, witness, etc.) with clear duties, mimicking real court operations.

Dynamic Agent Graph

Auto-generates sub-agents for knowledge gaps (e.g., financial expert for fraud cases).

Multi-modal Evidence Handling

Supports PDF, Word, audio (Whisper transcription), video (ffmpeg+Whisper), and images.

Role-aware RAG

Agents only access authorized evidence (e.g., defense lawyers can't view undisclosed prosecution evidence).

Citation System

Inline references like [EVIDENCE:uuid:chunk_idx] for traceable reasoning, with hoverable source cards.

4

Section 04

Technical Implementation Details

Frontend

Built with Next.js15 (App Router), shadcn/ui, and react-flow for agent graph visualization. Uses WebSocket for real-time token streaming.

Backend

FastAPI framework with core modules: Agent Orchestrator (manage agent lifecycle), Simulation Engine (3 modes: court trial, witness inquiry, strategy discussion), RAG pipeline (evidence embedding/retrieval).

Pluggable Layers

  • LLM providers: OpenAI, Anthropic Claude, Google Gemini, Ollama
  • Vector DBs: Qdrant, Chroma, Pinecone, pgvector
  • Databases: PostgreSQL, MongoDB, SQLite, DynamoDB
  • File storage: Local, S3, MinIO, GCS, Azure Blob
  • Embedding models: OpenAI, Gemini, Cohere, Sentence Transformers
5

Section 05

Zero-cost Local Deployment Guide

Gemini Free Tier

Gemini 2.5 Flash offers 1,500 daily requests for free, enough for multiple simulations.

Local Embedding Model

Use Sentence Transformers' all-MiniLM-L6-v2 (384D) on local CPU (no API key).

Lightweight Dependencies

  • SQLite as database, Chroma (in-process mode) as vector DB (no Docker)
  • Redis optional: use CELERY_BROKER_URL=memory:// for in-memory task queue
6

Section 06

Application Scenarios & Value

  1. Legal Education: Law students practice mock trials with AI opponents for instant feedback.
  2. Case Strategy: Lawyers test debate strategies and identify evidence gaps before court.
  3. Evidence Review: AI helps spot contradictions and structure case summaries.
  4. Judicial Research: Simulate policy impacts for reform data support.
7

Section 07

Limitations & Future Outlook

Limitations

  • Can't replace human lawyers (lacks nuanced legal judgment, possible hallucinations)
  • Multi-modal evidence faces format compatibility and privacy risks

Future Prospects

  • Better voice interaction
  • More precise evidence understanding
  • Improved legal reasoning aligned with human thinking
8

Section 08

Conclusion: Nyayrithm's Significance

Nyayrithm is a milestone in AI legal applications, showing multi-agent systems' ability to simulate complex collaboration and multi-modal tech's potential for real-world info processing. It's open-source with detailed docs, making it accessible for legal professionals, researchers, and tech enthusiasts to explore AI in law.