Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Construction Risk Assistant

An AI-powered Python application that helps construction project managers identify, analyze, and document project risks using the OpenAI API.

Project Overview

The Construction Risk Assistant is a practical AI automation tool designed for construction project risk management.

The user provides a construction risk description and a unique Risk ID. The application then uses the OpenAI API to generate a structured risk analysis covering:

  • Risk Description
  • Probability
  • Impact
  • Risk Level
  • Preventive Actions
  • Response Plan
  • Project Manager Recommendation

Each analysis is automatically dated and saved as a TXT report inside the risk_reports folder.

Technologies

  • Python
  • OpenAI API
  • python-dotenv
  • Git
  • GitHub

Features

  • Interactive construction risk input
  • Unique Risk ID
  • Automatic date recording
  • AI-powered risk analysis
  • Probability assessment
  • Impact assessment
  • Risk level assessment
  • Preventive action planning
  • Risk response planning
  • Project Manager recommendation
  • Automatic TXT report generation
  • Multiple risk analyses in one session
  • Error handling

Project Structure

Construction_Risk_Assistant/
│
├── main.py
├── requirements.txt
├── .gitignore
├── README.md
└── risk_reports/
    ├── RISK-001.txt
    ├── RISK-002.txt
    └── RISK-003.txt

Note: The .env file is created locally and is excluded from Git tracking because it contains the OpenAI API key.

How It Works

The application follows this workflow:

User
  │
  ▼
Enter Construction Risk
  │
  ▼
Enter Risk ID
  │
  ▼
OpenAI API
  │
  ▼
AI Risk Analysis
  │
  ├── Probability
  ├── Impact
  ├── Risk Level
  ├── Preventive Actions
  ├── Response Plan
  └── PM Recommendation
  │
  ▼
Display Analysis
  │
  ▼
Save TXT Report

Example Use Case

A project manager identifies the following construction risk:

Concrete delivery may be delayed due to supplier transportation issues.

The user enters a Risk ID such as:

RISK-004

The application sends the risk information to the OpenAI API and generates a structured analysis that can be saved as a project risk report.

Example Output

A generated report follows this general structure:

Risk Analysis - RISK-001
Date Recorded: YYYY-MM-DD

## Risk Description

...

## Probability

...

## Impact

...

## Risk Level

...

## Preventive Actions

- ...
- ...
- ...

## Response Plan

- ...
- ...
- ...

## Project Manager Recommendation

...

Installation

Clone the repository:

git clone https://github.com/samehsaad87/Construction_Risk_Assistant.git

Navigate to the project directory:

cd Construction_Risk_Assistant

Create a Python virtual environment:

python -m venv .venv

Activate the virtual environment on Windows:

.venv\Scripts\activate

Install the required packages:

pip install -r requirements.txt

Configuration

Create a .env file in the project directory:

OPENAI_API_KEY=your_api_key_here

Replace your_api_key_here with your own OpenAI API key.

Never commit or publish your real API key.

The .env file is excluded from Git through .gitignore.

Running the Application

Run:

python main.py

The application will ask for:

  1. A construction risk description
  2. A Risk ID

It will then generate the AI-powered risk analysis and save the report inside:

risk_reports/

Sample Reports

The repository includes sample risk analysis reports:

  • RISK-001.txt
  • RISK-002.txt
  • RISK-003.txt

These demonstrate the type of output generated by the application.

Error Handling

The application includes basic error handling around the OpenAI API request so that API or runtime errors do not immediately terminate the application.

Security

The OpenAI API key is stored locally in the .env file.

The .gitignore configuration prevents the following from being tracked by Git:

.env
__pycache__/
*.pyc
.venv/

API keys and other secrets should never be committed to a public repository.

Portfolio Purpose

This project demonstrates practical experience with:

  • Python application development
  • API integration
  • Environment variable management
  • AI automation
  • Construction project risk management
  • Automated report generation
  • Git version control
  • GitHub repository management

The project combines construction project management knowledge with practical AI automation and Python development.

Future Improvements

Potential future enhancements include:

  • Risk database storage using SQLite
  • Excel risk register integration
  • Risk scoring matrix
  • Dashboard visualization
  • PDF report generation
  • CSV/Excel export
  • Risk trend analysis
  • Web interface
  • Integration with project management workflows

Author

Sameh Saad

Construction Project Management | AI Automation | Python

About

AI-powered construction project risk analysis and automated risk reporting.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages