HusamettinYilmazz GitHub avatar

Hierarchical-RL-Agents-for-Legal-Contract-Analysis

HusamettinYilmazz

A full-stack pipeline for legal contract analysis that uses supervised fine-tuning and GRPO-based reinforcement learning on CUAD data, with Temporal-based PDF processing and a FastAPI orchestration layer.

Stars

8

7-day growth

No data

Forks

0

Open issues

0

License

No data

Last updated

2026-07-20

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It combines SFT and GRPO reinforcement learning to optimize contract extraction, integrates with Temporal for scalable workflow management, and provides a complete API for document processing and review.

Who it is for

  • Machine learning engineers working on legal NLP
  • Legal tech developers building contract analysis tools
  • Contract analysts seeking automated extraction workflows
  • Researchers exploring reinforcement learning for structured information extraction

Use cases

  • Automated extraction of key clauses and obligations from contract PDFs
  • Multi-document contract review with workflow orchestration and status tracking
  • Training custom instruction-following models for legal document analysis
  • Batch processing of contracts in cloud storage with asynchronous workflows

Strengths

  • Uses both SFT and GRPO with reward signals based on exact match and similarity for improved accuracy
  • Full-stack solution: data preprocessing, model training, and production-grade inference with Temporal and FastAPI
  • Leverages the CUAD benchmark dataset, a widely recognized legal contract standard
  • Includes a demo video and sample PDFs for immediate local testing

Considerations

  • Requires external credentials (AWS, OpenRouter) and model checkpoints to be configured by the user
  • Training demands a GPU, making it resource-heavy without cloud compute
  • Dependency on external services (Temporal server, cloud storage) adds operational complexity

README quick start

Installation

Related repositories

Similar projects matched by category, topics, and programming language.

lopopolo
Featured
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI & Machine LearningAI Agents
2,390
slvDev
Featured
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI & Machine LearningLarge Language Models
1,960
littledivy
Featured
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI & Machine Learning
1,482