Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A fact-centered legal narrative generation system that uses Answer Set Programming (ASP) to guide Large Language Models in creating structured legal narratives for fee waiver applications.

License

Notifications You must be signed in to change notification settings

jurisgpt/TruLex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

TruLex

🚧 PROJECT UNDER IDEATION/DEVELOPMENT 🚧
This project is currently in ideation/conceptual phase. The features described below represent our roadmap rather than current functionality. We welcome cross-functional contributors interested in colloborating on this applied project!

A fact-centered legal narrative generation system that uses Answer Set Programming (ASP) to guide Large Language Models in creating structured legal narratives for fee waiver applications.

Why TruLex Is Needed

The Problem with Standard LLMs for Legal Narratives:

Large Language Models (LLMs) excel at generating fluent text but have critical limitations in legal contexts:

  • They tend to predict what sounds persuasive rather than what's factually accurate
  • They often add creative embellishments or emotional details not present in the original facts
  • They lack understanding of proper legal argumentation structure
  • They can generate inconsistent or contradictory statements across longer narratives
  • They can generate compound statements when it is not needed.

In legal settings where factual accuracy is a must such as fee waiver applications, these limitations can be damaging or even ethically problematic. Courts require strictly factual submissions without embellishment, and improper narrative structure can lead to denied applications.

TruLex addresses these challenges by using Answer Set Programming (ASP) to create rule-based frameworks that guide LLM output toward factually accurate, properly structured legal narratives.

Project Vision

TruLex aims to combine symbolic reasoning (ASP) with neural language generation (LLMs) to produce legally sound, fact-centered narratives that follow proper legal argumentation structures. Unlike purely LLM-based approaches that may produce creative embellishments, our goal is to ensure narratives remain strictly factual while optimizing their legal effectiveness.

Planned Features

  • Fact-Centered Output: Maintain high factual adherence with minimal embellishment
  • Legal Structure Guidance: Use ASP-generated outlines to ensure proper legal argumentation
  • Constraint-Based Generation: Encode legal knowledge as logical constraints
  • Measurable Quality: Include metrics for evaluating factual adherence and legal relevance

Development Setup

Prerequisites

  • Python 3.8+
  • Clingo (Answer Set Programming solver)
  • Access to an LLM API (OpenAI, DeepSeek, etc.)

Initial Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/TruLex.git
    cd TruLex
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install development dependencies:

    pip install -r requirements-dev.txt
  4. Set up your environment variables:

    cp .env.example .env
    # Edit .env with your API keys and configuration

Current Project Structure

TruLex/
├── README.md              # This file
├── requirements-dev.txt   # Development dependencies
├── asp/                   # Answer Set Programming components
│   └── legal_narratives.lp # Initial ASP program (planned)
├── llm/                   # LLM integration components (planned)
│   └── prompts.py         # Initial prompt templates
└── examples/              # Example tenant cases and structures

Roadmap

  1. Phase 1 (Current): Project setup and initial ASP program development

    • Establish repository structure
    • Define initial ASP constraints for legal narratives
    • Create evaluation framework
  2. Phase 2: Core implementation

    • Develop ASP solver integration
    • Implement LLM narrative generation
    • Create basic CLI interface
  3. Phase 3: Web interface and API

    • Develop Flask backend
    • Create user-friendly web interface
    • Implement RESTful API
  4. Phase 4: Evaluation and refinement

    • Test with real fee waiver scenarios
    • Improve narrative quality based on feedback
    • Optimize fact-centeredness metrics

How to Contribute

We welcome contributions at this early stage! Here are some ways to get involved:

  1. Legal Expertise: Help define effective narrative structures for fee waiver applications
  2. ASP Development: Contribute to answer set programming constraints and rules
  3. LLM Integration: Help develop effective prompting strategies for fact-centered outputs
  4. Documentation: Improve our documentation and examples

To contribute:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Legal Disclaimer

IMPORTANT: DO NOT SUBMIT OUTPUTS FROM THIS TOOL DIRECTLY TO COURTS TruLex is provided for informational, research and educational purposes only. Narratives generated by this tool are not legal advice and should not be submitted to any court or legal authority without thorough review and verification by a qualified legal professional. The system may generate inaccurate, incomplete, or inappropriate content despite our best efforts to ensure fact-centered outputs. Users bear full responsibility for verifying all information and ensuring compliance with court rules, legal ethical standards, and accuracy requirements. By using TruLex, you acknowledge that all outputs must be reviewed by a qualified legal professional before any submission to a court or legal proceeding. The developers of TruLex assume no liability for any consequences resulting from the use or misuse of this tool in legal proceedings.

Contact

For questions, feedback, or collaboration opportunities, please open an issue or connect with me on LinkedIn.

License

This project is licensed under the MIT License - see the LICENSE file for details (coming soon).

About

A fact-centered legal narrative generation system that uses Answer Set Programming (ASP) to guide Large Language Models in creating structured legal narratives for fee waiver applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published