Skip to content
AzizMbayePublic

About

AI-Powered Building Energy Modelling

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

AI-Powered Building Energy Modelling (AI-BEM)

Warning

AI-BEM, as work in progress, is currently an experimental research framework intended to explore AI-assisted building energy modeling. It is not intended for production use.

The primary goal of AI-BEM is to showcase the potential of AI in streamlining the creation of EnergyPlus models. It is not meant as a standalone tool, and is primarily for research and educational purposes.

Overview

AI-Powered Building Energy Modelling (AI-BEM) is an open-source project that leverages artificial intelligence to streamline and enhance the process of creating EnergyPlus epJSON models for building energy simulations. Developed by researchers at Boson Labs, this tool aims to bridge the gap between complex building requirements and accurate energy simulation inputs.

Key Features

  • Automated Class Identification: Utilizes AI to identify necessary EnergyPlus classes based on building requirements.
  • Intelligent Class Content Generation: Generates detailed content for each identified class, ensuring comprehensive model creation.
  • Relationship Management: Automatically establishes and verifies relationships between different classes in the epJSON model.
  • Validation and Error Correction: Implements a robust validation process with automatic error detection and correction.
  • Extensible Architecture: Built on a modular structure allowing for easy extensions and customizations.

Technology Stack

  • Python: Core programming language
  • OpenAI GPT Models: Powers the natural language understanding and generation capabilities
  • JSON Schema: Used for validating the generated epJSON content against EnergyPlus standards
  • Pydantic: Provides data validation and settings management using Python type annotations

How It Works

  1. Requirement Analysis: The system processes user-provided building requirements.
  2. Class Identification: AI agents identify necessary EnergyPlus classes based on the requirements.
  3. Content Generation: For each identified class, detailed content is generated adhering to EnergyPlus standards.
  4. Relationship Establishment: The system ensures proper relationships between different classes.
  5. Validation and Correction: The generated epJSON is validated, and any errors are automatically addressed.
  6. Output: A complete, valid epJSON model is produced, ready for use in EnergyPlus simulations.

Getting Started

Prerequisites

  • Python 3.8+
  • OpenAI API key

Installation

  1. Clone the repository:

    git clone https://github.com/Boson-Labs-Inc/ai-bem.git
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Set up your OpenAI API key and other parameters in a .env file:

    OPENAI_API_KEY=your_api_key_here
    MODEL=gpt-4o-mini
    TEMPERATURE=0.5
    MAX_TOKENS=16000
    TIMEOUT=3600
    MAX_ITERATIONS=100
    VERBOSE=True
    

Usage

Run the main script with your input file:

python main.py path/to/your/input_file.txt

For sequential processing (non-agentic mode), use the --sequential flag:

python main.py path/to/your/input_file.txt --sequential

The sequential mode processes classes one by one without recursive agent calls, which can be useful for debugging or when a more controlled, step-by-step approach is needed. After each class is processed, the epJSON is validated and the results are printed to the console.

We're excited to see how the research community will use and enhance this tool. Together, we can push the boundaries of building energy modelling and contribute to more sustainable built environments!

Data Model

AI-BEM uses a comprehensive data model created from the EnergyPlus schema file to represent various aspects of the building energy simulation. The data model is defined using Pydantic, which provides runtime type checking and validation. Some key classes in the data model include:

  • Building: Represents the overall building characteristics
  • SimulationControl: Controls various aspects of the simulation
  • ShadowCalculation: Handles shadow calculations for the building
  • Zone: Represents individual zones within the building
  • People: Models occupancy and associated heat gains
  • Lights: Represents lighting systems and their energy use
  • ElectricEquipment: Models electrical equipment and their energy consumption

For a complete list of available classes and their properties, refer to the data_model/building.py file.

The data model can be created by running datamodel-codegen with the EnergyPlus schema file. First, install datamodel-codegen:

pip install datamodel-code-generator

Then, run the following command:

datamodel-codegen --input Energy+.schema.epJSON --input-file-type jsonschema --output data_model/building.py --output-model-type pydantic_v2.BaseModel --use-annotated --use-field-description --strip-default-none --use-schema-description  

Contributing

We welcome contributions from the research community! Please feel free to contact us at contact@bosonlabs.ca to discuss how you can contribute to this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • EnergyPlus community for providing the foundation for building energy modelling
  • OpenAI for their GPT models that power our AI agents
  • Pydantic for providing runtime type checking and validation
  • Jsonschema for validating the generated epJSON content against the EnergyPlus epJSON schema
  • Datamodel-codegen for generating the data model from the EnergyPlus schema
  • All contributors and researchers who have provided valuable insights and feedback

Contact

For any queries or collaborations, please contact contact@bosonlabs.ca.


We're excited to see how the research community will use and enhance this tool. Together, we can push the boundaries of building energy modelling and contribute to more sustainable built environments!

About

AI-Powered Building Energy Modelling

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages