Skip to content

Code for "PAKTON: A Multi-Agent Framework for Question Answering in Long Legal Agreements", accepted for Oral Presentation at the Main Conference of EMNLP 2025. Paper available at: https://arxiv.org/abs/2506.00608

License

Notifications You must be signed in to change notification settings

petrosrapto/PAKTON

Repository files navigation

PAKTON Logo

PAKTON: A Multi-Agent Framework for Question Answering in Long Legal Agreements

Petros Raptopoulos, Giorgos Filandrianos, Maria Lymperaiou, Giorgos Stamou

Making Contract Review Accessible to Everyone Through AI

Paper Demo License Discord

Venue

Try PAKTON | View Evaluation and Experiments | Read Paper | View Poster | View Recording | Underline


🎯 About PAKTON

Reviewing contracts is often slow, complex, and requires expert legal knowledge. Legal language can be vague and open to interpretation, making it hard for non-experts to understand. On top of that, contracts are usually private, which limits the use of proprietary AI tools and calls for open-source solutions.

PAKTON solves these problems with an open-source, end-to-end framework for automated contract review. It uses a team of LLM agents working together, along with smart retrieval tools (RAG), to make legal document analysis easier, more private, and customizable.

PAKTON Overview

PAKTON user flow: legal query submission followed by comprehensive report generation

PAKTON was published at the Main Conference of EMNLP 2025 and presented orally by Petros Raptopoulos.

πŸš€ Live Deployed Version at pakton.site

PAKTON UI - Main Interface

PAKTON Login/Signup Page

PAKTON UI - Advanced Features

Contract upload and chat interface

⚠️ Important Note: The deployed version and the code currently in the repository are missing a few components that will be added shortly. These updates are being organized to ensure a clean and robust push.

πŸ—οΈ Architecture

PAKTON employs a sophisticated multi-agent architecture that orchestrates specialized AI agents to handle different aspects of contract analysis. The framework leverages collaborative agent workflows combined with advanced retrieval-augmented generation (RAG) to provide comprehensive, accurate, and explainable contract review.

PAKTON Architecture

Detailed PAKTON architecture showing the multi-agent workflow and RAG component integration

πŸ§ͺ Evaluation and Experiments

We evaluated PAKTON using both qualitative and quantitative methods to ensure its effectiveness in real-world legal tasks. You can explore all experiment results and details at: πŸ”— https://pakton.site/evaluation

πŸ“ˆ Complete Evaluation Framework

Qualitative Evaluation

Quantitative Evaluation

❓ Why PAKTON?

Proven Performance

  • Superior Generation Quality: Outperforms baseline methods on the ContractNLI dataset
  • State-of-the-Art Retrieval: RAG component (Researcher) leads performance on LegalBenchRAG benchmark
  • Human-Preferred: Chosen by human evaluators over ChatGPT for contract analysisβ€”especially for Explainability and Completeness.
  • LLM Validation: GEVAL evaluations show consistent preference for PAKTON over GPT-4o
  • Statistical Validation: Strong statistical agreement (cosine similarity 0.88-0.92) between automated and human evaluation methods confirms reliability of assessment results

Robust, Open, and Adaptable

  • Privacy-First: Fully open-source with on-premise deployment capabilities
  • Robust: According to our robustness analysis, it bridges performance gaps between small and large LLMs, enabling smaller open-source models to rival larger proprietary ones
  • Plug-and-Play: Modular architecture for seamless extension and custom workflow integration
  • Transparent Design: Explainable outputs that contrast with typical black-box AI models

πŸ“ Repository Structure

PAKTON/
β”œβ”€β”€ LICENSE                                             # License information
β”œβ”€β”€ README.md                                           # This file
β”œβ”€β”€ CONTRIBUTING.md                                     # Contributing Guidelines
β”œβ”€β”€ Docs/                                               # Documentation and research papers
β”‚   β”œβ”€β”€ ACL_Anthology_version.pdf                       # ACL Anthology published version
β”‚   β”œβ”€β”€ EMNLP 2025_Poster.pdf                           # Conference poster
β”‚   └── Preprint_May_25.pdf                             # Research preprint
β”œβ”€β”€ deployment/                                         # Deployment configurations
β”‚   β”œβ”€β”€ development/                                    # Development environment configs
β”‚   β”œβ”€β”€ production/                                     # Production environment configs
β”‚   └── nginx/                                          # Nginx server configurations
β”œβ”€β”€ PAKTON Framework/                                   # Core framework implementation
β”‚   β”œβ”€β”€ API/                                            # Backend API service
β”‚   β”œβ”€β”€ Archivist/                                      # Archivist agent implementation
β”‚   β”œβ”€β”€ Interrogator/                                   # Interrogator agent implementation
β”‚   β”œβ”€β”€ Researcher/                                     # Researcher agent (RAG component)
β”‚   └── Frontend/                                       # Frontend applications
β”œβ”€β”€ Experiments and Evaluation/                         # All experimental work and evaluation
β”‚   β”œβ”€β”€ Frontend/                                       # Frontend for experiments visualization
β”‚   β”œβ”€β”€ Qualitative/                                    # Qualitative evaluation methods
β”‚   β”‚   β”œβ”€β”€ Human Evaluation/                           # Human assessment results
β”‚   β”‚   β”œβ”€β”€ LLM as a judge - GEVAL/                     # Automated evaluation using GEVAL
β”‚   β”‚   └── Statistical Agreement/                      # Statistical validation between LLM and human evaluations
β”‚   └── Quantitative/                                   # Quantitative performance evaluation
β”‚       β”œβ”€β”€ Classification Performance - ContractNLI/   # ContractNLI experiments
β”‚       └── RAG Performance - LegalBenchRAG/            # LegalBenchRAG experiments
└── Machine Learning Experimentation/                   # Additional ML experiments (not mentioned in the paper)

🀝 Contributing & Community

PAKTON is dedicated to making contractual obligations clearer and more accessible to everyone. We believe in the power of community-driven development and welcome contributors (ideas, code, feedback).

Join Our Community

Join our vibrant Discord community where developers, researchers, and legal tech enthusiasts come together to:

  • Share ideas and get instant feedback
  • Troubleshoot and solve implementation challenges
  • Find collaborators for new features and research
  • Stay ahead with the latest updates and releases

Contributing to PAKTON

Whether you're fixing bugs, adding features, improving documentation, or sharing use cases, your contribution matters! To get started, please review our Contributing Guidelines.

Ways to contribute:

  • Report bugs and issues
  • Suggest new features or improvements
  • Improve documentation
  • Submit pull requests
  • Help with translations and accessibility
  • Share PAKTON with others who might benefit

License

This project is licensed under the terms specified in the LICENSE file.


Democratizing contract analysis

🌟 Star this repository if PAKTON helped you! 🌟

About

Code for "PAKTON: A Multi-Agent Framework for Question Answering in Long Legal Agreements", accepted for Oral Presentation at the Main Conference of EMNLP 2025. Paper available at: https://arxiv.org/abs/2506.00608

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages