A tool for reviewing contracts against GDPR compliance guidelines using AI.
- Contract analysis using AI
- GDPR compliance checking
- Local and cloud-based implementations
- Detailed compliance reports
- Clause-by-clause analysis
- Python 3.9 or higher
- OpenAI API key (for GPT-4)
- LlamaCloud API key (optional, for cloud implementation)
- Clone the repository:
git clone https://github.com/yourusername/ContractReviewAssistant.git
cd ContractReviewAssistant- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
# Option 1: Using pip
pip install -r requirements.txt
# Option 2: Using setuptools
pip install -e .- Set up environment variables:
Create a
.envfile in the project root with:
OPENAI_API_KEY=your_openai_api_key_here
LLAMA_CLOUD_API_KEY=your_llama_cloud_api_key_here # Optional
The project supports two LLM providers:
- Set
LLM_PROVIDER=openaiin your.envfile - Configure your OpenAI API key:
OPENAI_API_KEY=your-api-key - Optionally specify the model:
OPENAI_MODEL=gpt-4
- Install Ollama following instructions at https://ollama.ai
- Start the Ollama server locally
- Set
LLM_PROVIDER=ollamain your.envfile - Configure the model:
OLLAMA_MODEL=llama2(or any other model you've pulled) - Optionally specify a different base URL:
OLLAMA_BASE_URL=http://localhost:11434
- Add your GDPR guidelines to
data/guidelines/directory - Run the local version:
contract-review-local- Set up your LlamaCloud credentials
- Run the cloud version:
contract-review--contract-path: Path to the contract file (default: data/vendor_agreement.md)--verbose: Enable verbose output (default: True)
contract_review/
├── config/ # Configuration files
├── models/ # Data models
├── prompts/ # AI prompts
├── utils/ # Utility functions
├── workflows/ # Workflow definitions
├── cli.py # Command-line interface
├── main.py # Cloud implementation
└── main_local.py # Local implementation
To contribute to the project:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE file for details