Zing 论坛

正文

CLAUSULA_AI:基于LangGraph多智能体的巴西法律合同AI审查平台

CLAUSULA_AI是一个面向巴西法律和会计事务所的智能合同分析管理平台,采用React+FastAPI+Word插件三层架构,基于LangGraph多智能体工作流实现自动化合同审查,支持DREI合规检测、条款重写、电子签名等全流程功能。

LangGraph多智能体合同审查法律AIFastAPIReactWord插件DREI合规巴西法律GPT-4o
发布时间 2026/04/23 23:15最近活动 2026/04/23 23:58预计阅读 7 分钟
CLAUSULA_AI:基于LangGraph多智能体的巴西法律合同AI审查平台
1

章节 01

CLAUSULA_AI: AI-Powered Contract Review Platform for Brazilian Legal & Accounting Firms

CLAUSULA_AI is an intelligent contract analysis and management platform tailored for Brazilian legal and accounting firms. It leverages LangGraph multi-agent workflows to automate contract review, supporting full-process functions like DREI compliance detection, clause rewriting, and electronic signatures. The platform uses a three-layer architecture (React Web dashboard + FastAPI backend + Word plugin) to integrate AI capabilities directly into lawyers' daily work environments, improving review accuracy and efficiency.

2

章节 02

Background: Pain Points in Manual Contract Review

In the legal industry, contract review is time-consuming and error-prone. For Brazilian firms, ensuring compliance with DREI (Department of Business Registration and Integration) regulations via manual review is inefficient and risky. CLAUSULA_AI addresses these issues by automating the process, reducing human error and saving time.

3

章节 03

System Architecture & Core Tech Stack

Three-layer Architecture:

  1. Microsoft Word Add-in (Office.js, React/TS/Vite)
  2. Web Dashboard (React/TS/Vite, Zustand, TipTap)
  3. FastAPI Backend (Python3.11, Uvicorn) connected to LangGraph Agents (GPT-4o), Firebase (auth/storage), and ZapSign (e-signature).

Tech Stack Details:

  • Backend: FastAPI, LangGraph+LangChain+GPT-4o, PyMuPDF (doc parsing), Tesseract (OCR), Firebase Admin, ZapSign API.
  • Frontend: React18+TS, Vite5, Zustand, TipTap, Tailwind CSS.
  • Word Plugin: Office.js, React18+TS, Vite5, Tailwind CSS.
4

章节 04

LangGraph Multi-agent Workflow: Core Innovation

The platform uses a four-node LangGraph pipeline:

  1. CleanTextNode: Removes OCR artifacts, page numbers, and noise from raw text.
  2. DetectIssuesNode: GPT-4o-driven audit for DREI compliance, CNAE alignment, capital clause clarity, and accounting governance. Returns structured issues with references.
  3. ClassifyIssuesNode: Maps issues to PDF bounding boxes and standardizes severity (deterministic, no LLM call).
  4. GenerateSummaryNode: Creates structured review summaries with issues, suggestions, and compliance assessments.
5

章节 05

Key Functional Features

  • Smart Contract Review: Auto-detects compliance defects, ambiguous clauses, and logical contradictions with precise location marking.
  • Spatial Highlighting: Links AI-detected issues to PDF paragraph bounding boxes for visual highlighting.
  • AI-assisted Clause Rewriting: Generates DREI-compliant alternatives for problematic clauses (lawyers can accept/modify/keep original).
  • Multi-format Export: PDF (ReportLab), Word (python-docx), Excel (openpyxl) reports.
  • Cloud Storage: Firebase Storage for secure document storage with version control.
  • E-signature: ZapSign API integration for end-to-end signing workflows.
  • Word Plugin: Embeds AI analysis directly into Word, enabling seamless workflow integration.
6

章节 06

Deployment & Usage Guide

Docker Compose Deployment: Run docker compose up --build to start the stack. Access:

Environment Variables:

  • Backend: OPENAI_API_KEY, FIREBASE_CREDENTIALS_PATH, ZAPSIGN_API_TOKEN.
  • Frontend: VITE_API_URL, Firebase configs.
7

章节 07

Application Scenarios & Value Proposition

  • Legal Firms: Reduces initial contract review time from hours to minutes, letting lawyers focus on complex tasks.
  • Accounting Firms: Ensures client documents (charters, shareholder agreements) comply with DREI regulations, lowering compliance risks.
  • In-house Legal Departments: Standardizes review processes, improves consistency, and reduces human errors.
8

章节 08

Conclusion & Open Source Community

CLAUSULA_AI demonstrates AI's potential in legal tech. It uses LangGraph multi-agent architecture to automate contract review and integrates AI into Word for seamless use. The platform is open-source (hosted on GitHub) and welcomes community contributions: new contract types, compliance rules for other jurisdictions, UI/UX improvements, and performance optimizations. Its value lies in augmenting (not replacing) legal professionals, freeing them from repetitive work to focus on high-value tasks.