← Projects 日本語 →

JURYBEE: AGENTIC NDA ANALYZER

2025-11-05
Artificial Intelligence
Tech Stack:
Python Python
Next.js Next.js
TypeScript TypeScript
LangChain LangChain

A multi-agent legal tech prototype orchestrating a Tree-of-Thoughts (ToT) workflow to semantically review and negotiate Non-Disclosure Agreements with blockchain auditability.

Architecture Overview

JuryBee is an agentic AI prototype designed to simplify the complexity of Non-Disclosure Agreements (NDAs). It acts as a simulated legal team—comprising a Risk Analyst, a Compliance Checker, and a Negotiation Strategist—to debate, refine, and explain NDA clauses with an auditable trail.

The system features a decoupled architecture:

  • AI Backend (jurybee-proto): A Python-based core utilizing LangChain for complex agent orchestration. A ToTPlanner (Tree-of-Thoughts) acts as the orchestrator, delegating tasks to specialized sub-agents.
  • Web Frontend (jurybee-web): A modern interface built with Next.js (App Router), TypeScript, and Chakra UI, offering a responsive chat interface where users can paste contract text and interrogate the AI.
  • Blockchain Ledger: Designed to log all critical analysis steps and output hashes to a tamper-proof Polygon testnet ledger.

Engineering Challenges Solved

NDAs often contain deliberately vague clauses. Rather than relying on simple, single-prompt generation, JuryBee implements a Tree-of-Thoughts approach. It explicitly generates branching legal interpretations of a clause (e.g., assessing the risk of an "indefinite" timeline) and quantitatively evaluates these branches against legal patterns using semantic embedding similarity (sentence-transformers).

Agent Resilience & Hallucination Mitigation

Legal technology demands precision; hallucinations are unacceptable. The agents strictly enforce structured outputs using Pydantic models. If the underlying LLM generates malformed JSON, the agents utilize OutputFixingParser to auto-repair the payload, wrapped in exponential backoff retry loops (using the tenacity library) to ensure high reliability.

Semantic vs. Lexical Diffs

By utilizing Sentence-BERT embeddings, the system can highlight semantic differences between two drafts of an NDA rather than just basic textual diffs. This allows the system to catch clever rewording of the exact same legal risk, a major upgrade over traditional redlining software.


Outcomes

  • Automation of Legal Review: JuryBee replaces hours of manual review by instantly categorizing risk (from Low to Critical), explaining compliance status, and automatically proposing actionable, safe counter-clauses.
  • Explainable AI (XAI): Through the multi-agent debate and blockchain logging, users receive fully explainable decisions rather than a "black box" output, ensuring trust and transparency in automated legal processes.

View Original Video (Facebook)

← Projects