A React-based application that uses AI to analyze construction contracts, extract key terms, assess risks, and provide recommendations. Built with Autodesk LLM Proxy integration.
- Document Classification: Automatically recognizes construction contract documents
- AI-Powered Analysis: Extracts key contract terms using Autodesk LLM Proxy
- Multi-Format Support: Handles text files, PDFs, documents, and images
- Attachment-Based Processing: Direct file analysis without text extraction
- Risk Assessment: Evaluates contract risks and provides recommendations
- Two-Pane Interface: Side-by-side view of analysis results and original document
- Key Term Extraction: Identifies critical clauses including:
- Indemnification clauses
- Deliverables and scope of work
- Liquidated damages provisions
- Payment terms and schedules
- Change order procedures
- Termination clauses
- Insurance requirements
- Warranty provisions
- Force majeure clauses
- Dispute resolution mechanisms
- Frontend: React 19 with TypeScript
- UI Framework: Material-UI (MUI)
- File Upload: React Dropzone
- AI Service: Autodesk LLM Proxy (Claude Sonnet 3.7)
- Node.js: Version 22
- Node.js v22 (managed via nvm)
- Autodesk Developer Account with API access
- Valid Autodesk Client ID and Client Secret
-
Clone the repository:
git clone <repository-url> cd construction_contract_analysis
-
Use Node.js v22:
nvm use 22
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in the root directory:REACT_APP_AUTODESK_CLIENT_ID=your_client_id REACT_APP_AUTODESK_CLIENT_SECRET=your_client_secret REACT_APP_AUTODESK_AI_SERVICE_URL=https://developer-stg.api.autodesk.com/aiservice/model/invoke
-
Start the development server:
npm start
-
Open your browser and navigate to
http://localhost:3000 -
Upload a contract:
- Drag and drop a file or click to select
- Supports: TXT, PDF, DOC, DOCX, and Images (JPG, PNG, etc.)
- The system will automatically classify the document
- If it's a construction contract, analysis will begin
-
Review results:
- Left pane: Analysis results with extracted terms and risk assessment
- Right pane: Original document with highlighting
- Click on terms to highlight them in the document
A sample construction contract is provided in public/sample-contract.txt for testing purposes.
The application integrates with Autodesk's LLM Proxy service using:
- Authentication: OAuth 2.0 client credentials flow
- Model: Claude Sonnet 3.7 v1
- Endpoints:
- Authentication:
https://developer-stg.api.autodesk.com/authentication/v2/token - AI Service:
https://developer-stg.api.autodesk.com/aiservice/model/invoke
- Authentication:
src/
├── components/
│ ├── FileUpload.tsx # File upload with drag & drop
│ ├── AnalysisResults.tsx # Contract analysis display
│ └── DocumentViewer.tsx # Document viewer with highlighting
├── services/
│ └── AutodeskService.ts # Autodesk API integration
├── config/
│ └── environment.ts # Environment configuration
└── App.tsx # Main application component
- Drag and drop interface for contract files
- Automatic document classification
- Support for multiple file formats: TXT, PDF, DOC, DOCX, Images
- Attachment-based processing for optimal AI analysis
- Displays extracted contract terms
- Risk assessment with color coding
- Expandable sections by term type
- Interactive term selection
- Displays original contract text
- Highlights selected terms
- Document metadata display
- Handles authentication with Autodesk API
- Contract analysis using AI models
- Document classification functionality
The AI analyzes contracts for these key terms:
- Indemnification Clauses: Liability and responsibility terms
- Deliverables: Scope of work and project requirements
- Liquidated Damages: Penalty clauses for delays
- Payment Terms: Payment schedules and amounts
- Change Orders: Procedures for scope modifications
- Termination: Contract termination conditions
- Insurance: Required insurance coverage
- Warranty: Warranty periods and coverage
- Force Majeure: Uncontrollable circumstances clauses
- Dispute Resolution: Conflict resolution mechanisms
Each extracted term is assessed for risk level:
- High Risk: Requires immediate attention
- Medium Risk: Should be reviewed carefully
- Low Risk: Standard terms with minimal concern
- Update the
ContractTerminterface inAutodeskService.ts - Modify the AI prompt to include the new term type
- Update the UI components to handle the new term type
- Add new file type handlers in
FileUpload.tsx - Update the dropzone accept configuration
- Add MIME type support in the attachment processing logic
- For complex formats, consider attachment-based processing over text extraction
- Authentication Errors: Verify your Autodesk credentials
- File Upload Issues: Ensure file is a supported text format
- Analysis Failures: Check network connectivity and API limits
Make sure all required environment variables are set:
REACT_APP_AUTODESK_CLIENT_IDREACT_APP_AUTODESK_CLIENT_SECRETREACT_APP_AUTODESK_AI_SERVICE_URL
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and commit:
git commit -am 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License.
For support or questions:
- Review the troubleshooting section
- Check the Autodesk Developer documentation
- Open an issue in the repository
Built with ❤️ for the construction industry using Autodesk AI technology.