Agent 04 / 04

Legal Intelligence

Supplier contract management with AI-powered review. Analyzes T&Cs, purchase agreements, PO terms, and payment conditions for risks, missing protections, and cross-supplier consistency.

Port 3007
Data Source PostgreSQL ERP (7 tables)
AI Claude Sonnet 4.6

Overview

The Legal Intelligence agent queries 7 supplier-contract tables in the ERP and provides a risk-first view of EFI's supplier agreements. AI review is opt-in — only the specific clause text is sent to Claude when an admin clicks "Review with AI", never full documents.

Pages

Dashboard

KPI cards (suppliers, contract terms, pending approvals, risk flags), auto-computed risk register (missing T&Cs, unapproved terms, empty language, FSVP gaps), recent activity, payment terms matrix, FSVP compliance summary.

Contract Library

Three sortable tables: Supplier Contract Terms (48 records), Purchase Contracts (4 with 18 line items), PO Term Sheets (33). Click any row to expand full text. "Review with AI" button per contract.

Terms Consistency

Cross-supplier coverage matrix: which suppliers have T&Cs, approval status, text on file, payment terms. PO term categories breakdown. "Compare with AI" for bulk consistency analysis.

Compliance

FSVP checklist status per supplier/product. Approved vs pending tracking, document counts, suppliers with contracts but no FSVP checklist flagged.

AI Contract Review

Select any contract or term sheet from a dropdown, Claude analyzes for: risk flags, missing clauses (force majeure, IP, dispute resolution), non-standard language, payment term assessment, compliance gaps.

ERP Tables

TableRowsKey Columns
supplier_contract_terms48terms_title, terms_language, approval_status, operational_status
supplier_purchase_contracts4contract_num, contract_date, total_mton, fob_price, pdf_filename
supplier_purchase_contract_line_items18shipment_window, metric_tons, fob_price, payment_terms
po_term_sheets33category, description, verbiage, req_approval
ref_po_terms4terms_title, verbiage (templates)
supplier_payment_terms18terms_language, notes, approval_status
supplier_to_payment_term28Junction: supplier ↔ payment term
supplier_fsvp_checklists8checklist_items (JSONB), approved_date
supplier_fsvp_documents15file_name, file_title

Risk Register (auto-computed)

  • Missing T&Cs — suppliers with purchase orders but no contract terms on file
  • Pending Approval — terms that exist but haven't been approved
  • Empty Terms — term records with no language text (shell records)
  • Missing Payment Terms — suppliers with no payment conditions assigned
  • FSVP Pending — checklists without an approved date

AI Privacy

Only specific clause text is sent to the LLM. Full documents are never transmitted. Claude API (not claude.ai) is used — Anthropic's API terms guarantee zero data retention. All parsing, indexing, and risk computation happens locally. AI is only invoked when an admin explicitly clicks "Review with AI".