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.
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.
- 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.
- 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
- Requirement Analysis: The system processes user-provided building requirements.
- Class Identification: AI agents identify necessary EnergyPlus classes based on the requirements.
- Content Generation: For each identified class, detailed content is generated adhering to EnergyPlus standards.
- Relationship Establishment: The system ensures proper relationships between different classes.
- Validation and Correction: The generated epJSON is validated, and any errors are automatically addressed.
- Output: A complete, valid epJSON model is produced, ready for use in EnergyPlus simulations.
- Python 3.8+
- OpenAI API key
-
Clone the repository:
git clone https://github.com/Boson-Labs-Inc/ai-bem.git -
Install dependencies:
pip install -r requirements.txt -
Set up your OpenAI API key and other parameters in a
.envfile:OPENAI_API_KEY=your_api_key_here MODEL=gpt-4o-mini TEMPERATURE=0.5 MAX_TOKENS=16000 TIMEOUT=3600 MAX_ITERATIONS=100 VERBOSE=True
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!
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 characteristicsSimulationControl: Controls various aspects of the simulationShadowCalculation: Handles shadow calculations for the buildingZone: Represents individual zones within the buildingPeople: Models occupancy and associated heat gainsLights: Represents lighting systems and their energy useElectricEquipment: 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
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.
This project is licensed under the MIT License - see the LICENSE file for details.
- 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
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!