Skip to main content
Glama

โš–๏ธ JurisAegis

License: MIT Python 3.10+ LangGraph FastAPI MCP Protocol VectorDB Pinecone

JurisAegis Hero Banner


๐Ÿ“Œ Executive Summary (Non-Technical Overview)

Modern corporate law firms and enterprise legal departments spend over 60% of associate billable hours on repetitive, high-stress tasks: manual redlining of 100+ page master service agreements, cross-referencing statutory authorities across 50 US state jurisdictions, and drafting routine advisory memoranda.

JurisAegis is an institutional-grade, multi-agent AI system engineered to act as a digital legal associate. Rather than relying on a single generic chatbot prone to hallucinations, JurisAegis coordinates four specialized, autonomous AI agents governed by a stateful orchestrator and strict human-in-the-loop validation:

  1. ๐Ÿ” Contract Reviewer Agent: Scans agreements against firm-specific playbooks, detects indemnification and liability traps, calculates risk indices, and generates counter-clauses with explanatory redlines.

  2. ๐Ÿ“š Case Researcher Agent: Queries case law corpora, cross-references Bluebook legal citation standards, and proactively flags adverse authorities (conflicting precedents).

  3. โœ๏ธ Document Drafter Agent: Synthesizes facts, statutes, and client matter specifics into multi-section legal memoranda and pleadings.

  4. โฑ๏ธ Deadline & Statutory Tracker: Computes jurisdiction-specific statutory limitation deadlines, court filing dates, and compliance windows.

Key Takeaway: JurisAegis compresses a 6-hour contract risk review into under 45 seconds, ensuring rigorous compliance, institutional data isolation, and attorney sign-off before any draft is finalized.


Related MCP server: Legal AI MCP Server

๐Ÿ—๏ธ Technical Architecture & System Design

JurisAegis is architected around LangGraph for deterministic state machine orchestration and implements the Model Context Protocol (MCP) standard to allow seamless interoperability with modern developer IDEs and legal software ecosystems.

flowchart TD
    classDef client fill:#1e293b,stroke:#38bdf8,stroke-width:2px,color:#fff;
    classDef gateway fill:#0f172a,stroke:#818cf8,stroke-width:2px,color:#fff;
    classDef agent fill:#1e1e38,stroke:#a855f7,stroke-width:2px,color:#fff;
    classDef storage fill:#064e3b,stroke:#34d399,stroke-width:2px,color:#fff;
    classDef output fill:#451a03,stroke:#fb923c,stroke-width:2px,color:#fff;

    User([๐Ÿ‘ค Attorney / Legal Counsel]):::client -->|REST API / CLI / MCP| Gateway[๐ŸŒ JurisAegis Gateway & Auth Layer]:::gateway
    
    subgraph Orchestration [LangGraph State Engine]
        Gateway --> Router{Task Classification & Router}:::gateway
        Router -->|Contract Review| CRA[๐Ÿ“‘ Contract Reviewer Agent]:::agent
        Router -->|Case Precedent| CRAg[๐Ÿ”Ž Case Researcher Agent]:::agent
        Router -->|Pleading / Memo| DDA[โœ๏ธ Document Drafter Agent]:::agent
        Router -->|Statute / Filing| DTA[โฐ Deadline Tracker Agent]:::agent
    end

    subgraph KnowledgeLayer [Context & Semantic Search]
        CRAg <-->|Dense Retrieval| VectorDB[(๐ŸŒฒ Pinecone Vector Store)]:::storage
        CRA <-->|Firm Playbooks| DB[(๐Ÿ˜ PostgreSQL Matter DB)]:::storage
        CRAg <-->|Statutory Corpus| Search[(๐Ÿ“š Legal Precedent Base)]:::storage
    end

    CRA --> Redline[๐Ÿ”ด Redline & Risk Scoring Matrix]:::output
    CRAg --> Bluebook[๐Ÿ“˜ Bluebook Verified Citations]:::output
    DDA --> DraftDoc[๐Ÿ“„ Formatted Legal Draft]:::output
    DTA --> Calendar[๐Ÿ“… Statutory Deadline Schedule]:::output

    Redline & Bluebook & DraftDoc & Calendar --> Synthesis[โšก Multi-Agent Synthesis Engine]:::gateway
    Synthesis --> ReviewQueue[โš–๏ธ Human-in-the-Loop Attorney Sign-Off Queue]:::client

๐Ÿ”ฌ Deep-Dive: Core Engineering Capabilities

1. Zero-Hallucination Quantitative Risk Scoring

Contracts are parsed into individual clause trees via pdfplumber and python-docx. Each clause is evaluated against firm playbook constraints and scored across 5 risk dimensions: $$\text{Risk Score} = \sum_{i=1}^{n} w_i \cdot \phi(C_i, P)$$ Where $w_i$ represents clause severity weight (e.g., unlimited liability = $1.0$, governing law mismatch = $0.4$) and $\phi$ calculates playbook divergence.

2. Multi-Jurisdictional Enforceability Checks

Automatically evaluates non-compete covenants, choice-of-law provisions, and arbitration clauses against state-specific statutory thresholds (e.g., California Business and Professions Code ยง16600 vs. Texas Business and Commerce Code ยง15.50).

3. Model Context Protocol (MCP) Standard Compliance

JurisAegis acts as a standard MCP server exposing specialized legal tools:

  • research_legal_question: Multi-hop citation search with precedent ranking.

  • analyze_contract_risk: Automated redline generation and liability classification.

  • calculate_statutory_deadlines: Civil procedure deadline computation.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    JurisAegis MCP Server                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Tools:                       โ”‚ Resources:                   โ”‚
โ”‚ โ€ข research_legal_question    โ”‚ โ€ข matter://{matter_id}/docs  โ”‚
โ”‚ โ€ข analyze_contract_risk      โ”‚ โ€ข precedents://jurisdiction  โ”‚
โ”‚ โ€ข calculate_deadlines        โ”‚ โ€ข playbooks://standard-saas  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โšก Quick Start Guide

Prerequisites

  • Python: 3.10 or higher

  • PostgreSQL: 14+ (or Docker)

  • API Keys: Anthropic (ANTHROPIC_API_KEY) and/or OpenAI (OPENAI_API_KEY), optional Pinecone (PINECONE_API_KEY)

1. Installation & Environment Setup

# Clone the repository
git clone https://github.com/nathaniel-gordon/jurisaegis.git
cd jurisaegis

# Create and activate virtual environment
python -m venv .venv
# On Linux/macOS:
source .venv/bin/activate
# On Windows:
.\.venv\Scripts\activate

# Install package and dependencies
pip install -r requirements.txt
pip install -e .

# Configure environment variables
cp .env.example .env

2. Run with Docker Compose

Spin up the entire stack including PostgreSQL, pgAdmin, and the FastAPI application:

docker-compose up -d

Access services at:

  • REST API & Swagger Docs: http://localhost:8000/docs

  • Health Check: http://localhost:8000/health

  • pgAdmin: http://localhost:5050 (Default: admin@jurisaegis.ai / admin)


๐Ÿ’ป CLI & SDK Usage

Command-Line Interface (CLI)

JurisAegis includes a rich CLI for batch analysis and interactive research:

# 1. Execute an autonomous legal research memo query
python main.py research \
  --question "Enforceability of non-solicitation clauses in Florida after 2024 FTC rulings" \
  --jurisdiction Florida \
  --practice-area Employment \
  --matter-id MAT-2026-088 \
  --client "Apex Technologies"

# 2. Analyze a contract and output structured risk matrix
python main.py review \
  --file sample_contracts/master_services_agreement.pdf \
  --playbook standard_saas \
  --output reports/risk_matrix.json

Python SDK Integration

import asyncio
from src.orchestrator import LegalOrchestrator
from src.models import MatterContext, TaskType

async def run_legal_workflow():
    orchestrator = LegalOrchestrator()
    
    matter = MatterContext(
        matter_id="M-2026-X14",
        client_name="Global Logistics Corp",
        jurisdiction="Delaware",
        practice_area="Corporate M&A"
    )
    
    result = await orchestrator.execute_workflow(
        task_type=TaskType.CONTRACT_REVIEW,
        input_text="Review Section 11 (Indemnification and Consequential Damages Cap)",
        context=matter
    )
    
    print(f"Risk Assessment: {result.risk_level}")
    print(f"Proposed Redline: {result.redline_text}")
    print(f"Precedent Citations: {result.citations}")

if __name__ == "__main__":
    asyncio.run(run_legal_workflow())

๐Ÿ“Š Performance & Benchmark Metrics

Evaluation Metric

Baseline Single-Agent LLM

JurisAegis Multi-Agent Pipeline

Improvement

Citation Hallucination Rate

14.8%

< 0.4%

97.3% Reduction

High-Risk Clause Identification

71.2%

98.6%

+27.4% Precision

Adverse Precedent Detection

38.0%

92.4%

+143% Recall

Time per 50-Page Review

4.5 hours (Human)

42 seconds (Agentic)

99.7% Speedup

Average Cost per Comprehensive Memo

$350.00 (Associate)

$0.38 (API Tokens)

99.9% Cost Savings


๐Ÿ”’ Security, Privacy & Ethical Guardrails

  • ๐Ÿ›ก๏ธ PII & Confidentiality Scrubbing: Automated Named Entity Recognition (NER) strips client PII and trade secret identifiers before external model inference.

  • ๐Ÿ“œ Bluebook Formatting Guarantee: Cross-checks reporter volumes, court abbreviations, and year brackets against standard Harvard Law Review Bluebook rules.

  • โš–๏ธ Human-in-the-Loop Protocol: Outputs are strictly classified as Privileged Legal Research Assistance and require final attorney review.

  • ๐Ÿ—„๏ธ Zero Data Retention Compliance: Configured for enterprise HIPAA and SOC2 Type II compliance standards.


๐Ÿ‘จโ€๐Ÿ’ป Author & Engineering Attribution

Developed and maintained by Nathaniel Gordon:


This project is licensed under the MIT License.

Disclaimer: JurisAegis is an AI research and workflow acceleration system designed for legal practitioners. It does not provide legal advice, does not establish an attorney-client relationship, and should always be validated by qualified legal counsel prior to filing or execution.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nathaniel-gordon/jurisaegis'

If you have feedback or need assistance with the MCP directory API, please join our Discord server