An LLM agent prototype for structural steel design automation, which integrated building layout generation, structural analysis, and visualization.
This repository combines three preliminary components: building layout generation, PINN-based strength prediction, and an automated structural analysis based on OpenSeesPy code generation.
Project Information:
- Version: v3.0.0
- Developer: Kai Chen (kchen137@alumni.jh.edu), Cem Bartu Cevik (bartu@datatoolpack.com), Zhidong Zhang (zhidong9263@gmail.com), and Cristopher D. Moen (cris.moen@runtosolve.com).
- Institution: Johns Hopkins University, University of Virginia, Datatoolpack LLC, and RunToSolve LLC.
- Last Updated: April 21, 2026
- Generate layouts from natural-language building descriptions
- Create SVG blueprints with columns, beams, and connections
- Calculate column loads automatically
- Calculate column compressive strength with a PINN model
- Support chat-based interaction
- Support multi-turn conversations with context memory
- Recognize design parameters in multiple formats
- Support OpenAI-compatible APIs and DashScope
- Use separate agents for geometry parsing, code translation, and validation
- Convert structural descriptions into a JSON intermediate format
- Generate OpenSeesPy code from structured models
- Validate syntax, semantics, and structural stability
- Run OpenSeesPy analyses and parse results automatically
- Generate engineering summaries with displacements, forces, and checks
- Support an end-to-end workflow from natural-language input to analysis results
- Generate JSON and natural-language reports
- Coordinate multiple specialized components in one workflow
- Further tuning and optimization of the framing geometry design module
- Strength prediction of structural steel components based on pre-trained ML models, such as flexural strength alculation
- The accuracy, efficiency, robustness, and user interaction of this prototype agent-based steel building design will be further evaluated with AISC steel-framed building archetype examples
For setup instructions, see QUICKSTART.md.
pip install -r requirements.txtCreate a .env file with one of the following configurations:
# DashScope
DASHSCOPE_API_KEY=your-api-key
LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
LLM_MODEL=qwen-max
# Or OpenAI
# OPENAI_API_KEY=your-openai-api-key
# LLM_BASE_URL=https://api.openai.com/v1
# LLM_MODEL=gpt-4-turbo-previewLinux/macOS:
./start_agent.shWindows:
start_agent.batInteractive workflow:
python integrated_design.py --mode interactiveConversational agent:
python -m agent.agentQuick examples:
python examples/examples_quickstart.pyCommand: python integrated_design.py --mode interactive
Describe your building: I need a 3-story office building with 4 rooms per floor,
each 20x15 feet, with a central corridor
Dead load (psf) [default: 50]: 60
Live load (psf) [default: 40]: 50
Number of floors [default: 1]: 3
[System processes the design...]
Blueprint saved to: output/blueprint.svg
Analysis results: output/opensees_analysis/
Design report saved to: output/complete_design_report.json
python -m agent.agentExample:
User: Hello, I want to calculate steel column strength
Agent: Please provide A, I, c, L, fy, and delta_o.
User: A=10, I=100, c=5, L=120, fy=50, delta_o=0.1
Agent: [Returns the calculated strength and a short explanation]
from agent import SteelDesignAgent
agent = SteelDesignAgent(
model_path="PINN model/normal/model_20250123_165719.pth"
)
response = agent.chat(
"Calculate steel column strength: A=10, I=100, c=5, L=120, fy=50, delta_o=0.1"
)
print(response)from agent.tools import SteelStrengthCalculator
calculator = SteelStrengthCalculator(
model_path="PINN model/normal/model_20250123_165719.pth"
)
params = {
'A': 10.0,
'I': 100.0,
'c': 5.0,
'L': 120.0,
'fy': 50.0,
'delta_o': 0.1,
}
result = calculator.calculate_column_strength(params)
print(result)python -m pytest tests/ -vpython examples/usage_examples.py
python examples/multi_turn_demo.py
python examples/examples_quickstart.pyLLM_steel_design/
├── agent/ # Agent core code (Task 2)
│ ├── agent.py # LLM Agent main program
│ ├── config.py # Configuration file
│ ├── models/
│ │ └── pinn_predictor.py # PINN model inference
│ ├── tools/
│ │ └── steel_strength_tools.py # Steel strength calculation tools
│ └── utils/
│ └── create_scalers.py # Scaler generation tool
├── building_design/ # Building design module (Task 1)
│ ├── __init__.py # Module initialization
│ ├── building_parser.py # Natural language building parser
│ ├── blueprint_generator.py # 3D blueprint SVG generator
│ └── column_analyzer.py # Column load analysis and optimization
├── openSeesIntegrate/ # Structural analysis module (Task 3)
│ ├── agents/ # Multi-agent system
│ │ ├── geometry_agent.py # Natural language → JSON
│ │ ├── code_translator.py # JSON → OpenSeesPy code
│ │ └── model_validator.py # Model and code validation
│ ├── models/ # Data models
│ │ ├── structural_json.py # Structural JSON schema
│ │ └── wsection_database.py # W-section database (40+ sections)
│ ├── executor/ # Execution engine
│ │ ├── opensees_runner.py # OpenSeesPy executor
│ │ └── result_parser.py # Result parser and interpreter
│ ├── opensees_integration.py # Complete integration system
│ └── openseespyDoc/ # OpenSeesPy documentation (468 files)
├── integrated_design.py # Complete system integration
├── examples/
│ └── examples_quickstart.py # NEW: Quick start examples
├── tests/ # Test suite
│ ├── test_agent.py # Agent tests
│ ├── test_llm_agent.py # LLM integration tests
│ ├── test_steel_tools.py # Steel tools tests
│ └── test_integration.py # Integration tests
├── PINN model/
│ └── normal/
│ ├── model_20250123_165719.pth # Pre-trained model
│ └── scalers.pkl # Scaler
├── output/ # Generated files directory
│ ├── blueprint.svg # Generated blueprints
│ ├── design_report.json # Design reports
│ └── demo_generated_code.py # NEW: Generated OpenSeesPy code
├── README.md # This document
├── requirements.txt # Python dependencies
├── env.example # Environment variable template
├── start_agent.sh # Linux/Mac startup script
└── start_agent.bat # Windows startup script
| Parameter | Symbol | Unit | Description | Supported Parameter Names |
|---|---|---|---|---|
| Cross-sectional Area | A | in² | Steel column cross-sectional area | A, area |
| Moment of Inertia | I | in⁴ | Section moment of inertia | I, inertia |
| Distance | c | in | Distance from section center to edge | c, distance |
| Length | L | in | Effective length of column | L, length |
| Yield Strength | fy | ksi | Steel yield strength | fy, yield_strength |
| Initial Imperfection | delta_o | in | Initial geometric imperfection | delta_o, imperfection |
{
"success": true,
"component_type": "column",
"nominal_strength_Pn": 670.74, // PINN predicted compressive strength (kip)
"theoretical_strength": 469.28, // Perry-Robertson theoretical strength (kip)
"prediction_ratio": 1.43, // Ratio of predicted to theoretical value
"unit": "kip",
"message": "Steel column strength calculation successful"
}The system consists of three integrated tasks working together:
- Natural language parsing for building descriptions
- Automated room layout generation
- 3D blueprint SVG visualization
- Column load calculation and analysis
- Model Type: Physics-Informed Neural Network (PINN)
- Input Features: A, I, c, L, fy, delta_o (6 features)
- Output: Steel column compressive strength Pn (kip)
- Physical Constraints: Perry-Robertson formula
- Network Structure: 3 hidden layers, 64 neurons per layer
- Multi-Agent Architecture:
- Geometry Agent: Natural language → Structural JSON
- Code Translation Agent: JSON → OpenSeesPy code (template-based)
- Model Validation Agent: Three-layer validation (syntax, semantic, structural)
- W-Section Database: 40+ AISC standard sections
- OpenSeesPy Integration: Automated execution and result parsing
- Natural Language Output: Engineering reports with design checks
- Framework: OpenAI Function Calling
- Supported Models: Qwen, GPT-4, and OpenAI-compatible APIs
- Workflow Orchestration: Seamless agent coordination
- Output: Comprehensive design reports with all analysis results
Task 3 provides fully automated structural analysis using OpenSeesPy. The workflow is:
- Natural Language to JSON – The Geometry Agent parses the user's description (e.g., "A two‑story frame with 20‑ft columns and a 30‑ft beam") and creates a structured JSON model.
- JSON to OpenSeesPy – The Code Translation Agent converts the JSON into a complete OpenSeesPy script based on validated templates.
- Model Validation – The Validation Agent performs three layers of checks:
- Syntax: Ensures the generated Python code is syntactically correct.
- Semantic: Verifies that geometric relationships and boundary conditions are consistent.
- Structural: Checks for duplicate node IDs, unsupported element types, and stability of the model.
- Execution & Parsing – OpenSeesPy runs the model, and the Result Parser extracts displacements, reactions, and member forces. The system then produces a concise natural‑language report that highlights:
- Maximum lateral displacement and its location
- Critical member forces and utilization ratios
- Design check status (pass/fail) against AISC limits
- Suggested remedial actions if any checks fail
python integrated_design.py --mode interactive # Step‑by‑step wizard
# or
python -m agent.agent # Direct chat interface, then call `analyze_structure` toolUser: Perform structural analysis for a portal frame with two 20‑ft columns, a 30‑ft beam, dead load 50 psf, live load 40 psf, static analysis.
The agent will return a JSON block containing max_displacement, support_reactions, critical_forces, and a brief natural‑language summary suitable for inclusion in a paper.
This automation eliminates manual scripting errors and accelerates the design verification cycle.
- Core functionality tests: 8/8 passed (100%)
- Force equilibrium: Error < 0.001%
- Code generation: 110+ lines of valid OpenSeesPy code
- Result parsing: Displacement and force extraction validated
- Test coverage: All multi-agent components verified
- Test Framework: pytest 7.4.4
- Test Files: 12+
- Test Count: 58+
- Pass rate: 100%
- Lines of Code: 10,000+ lines (including Task 3.3)
- Execution Time: ~3 seconds
-
test_pinn_model.py (9 tests)
- Perry-Robertson formula calculation
- Model loading and prediction
- Batch prediction
- Boundary condition testing
-
test_steel_tools.py (13 tests)
- Parameter parsing (standard/Chinese/English formats)
- Parameter validation
- Steel column strength calculation
- Different parameter effects
-
test_llm_agent.py (11 tests)
- Agent initialization and configuration
- Conversation history management
- Tool integration
- Tool definition validation
-
test_conversation_features.py (4 tests)
- Conversation history recording
- Conversation reset
- System prompt validation
- Enhanced prompt content
- test_integration.py
- End-to-end workflow
- Multi-scenario design
- Parametric studies
- Real-world scenarios
- test_agent.py
- Basic functionality verification
- Quick testing
# Run all tests
cd tests
pytest -v
# Run specific test file
pytest test_pinn_model.py -v
# Show detailed output
pytest -v -s
# Generate coverage report
pytest --cov=agent --cov-report=htmlA: Make sure you've created a .env file in the project root directory and correctly filled in DASHSCOPE_API_KEY or OPENAI_API_KEY
A: Make sure the PINN model/normal/model_20250123_165719.pth file exists
A: Modify the .env file:
OPENAI_API_KEY=your-openai-key
LLM_BASE_URL=https://api.openai.com/v1
LLM_MODEL=gpt-4-turbo-previewA: This is normal. The PINN model considers more physical effects, and predicted values are typically 30-60% higher than Perry-Robertson theoretical values. It's recommended to regenerate the scaler using actual training data to improve accuracy.
A: Add new calculation functions in agent/tools/steel_strength_tools.py and define corresponding tools in STEEL_STRENGTH_TOOLS.
torch>=2.0.0
numpy>=1.24.0
pandas>=2.0.0
scikit-learn>=1.3.0
matplotlib>=3.7.0
seaborn>=0.12.0
openai>=1.0.0
python-dotenv>=1.0.0
svgwrite>=1.4.0 # For blueprint generation
pydantic>=2.0.0 # NEW: For structural data validation
openseespy>=3.5.0 # NEW: For structural analysis
- Kai Chen - PINN model development and Agent framework implementation
- Cem Bartu Cevik - Geometry optimization module development
- Zhidong Zhang - ML model development, Project guidance, Repository Organization, and Post-processing
- Cristopher D. Moen - Project advisor
- OpenAI Function Calling Documentation
- ANSI/AISC. (2022). AISC 360-22: Specification for Structural Steel Buildings. https://www.aisc.org/aisc/publications/current-standards/aisc-360/
- ASCE. (2022). ASCE/SEI 7-22 Minimum Design Loads and Associated Criteria for Buildings and Other Structures. American Society of Civil Engineering. https://sp360.asce.org/personifyebusiness/Merchandise/Product-Details/productId/276865145
- Chen, J., & Bao, Y. (2025). Multi-agent large language model framework for code-compliant automated design of reinforced concrete structures. Automation in Construction, 177, 106331. https://doi.org/10.1016/j.autcon.2025.106331
- Geng, Z., Liu, J., Cao, R., Cheng, L., Wang, H., & Cheng, M. (2025). A Lightweight Large Language Model-Based Multi-Agent System for 2D Frame Structural Analysis (arXiv:2510.05414). arXiv. https://doi.org/10.48550/arXiv.2510.05414
- Liang, H., Kalaleh, M. T., & Mei, Q. (2025). Integrating Large Language Models for Automated Structural Analysis (arXiv:2504.09754). arXiv. https://doi.org/10.48550/arXiv.2504.09754
- Liang, H., Zhou, Y., Kalaleh, M. T., & Mei, Q. (2025). Automating Structural Engineering Workflows with Large Language Model Agents (arXiv:2510.11004). arXiv. https://doi.org/10.48550/arXiv.2510.11004
- Liu, J., Geng, Z., Cao, R., Cheng, L., Bocchini, P., & Cheng, M. (2025). A Large Language Model-Empowered Agent for Reliable and Robust Structural Analysis (arXiv:2507.02938). arXiv. https://doi.org/10.48550/arXiv.2507.02938
- Mazzoni, S., McKenna, F., Scott, M. H., & Fenves, G. L. (2006). OpenSees command language manual (pp. 137–158). Pacific Earthquake Engineering Research (PEER) Center.
- Sarker, P. K., Shoumik, S. C., Palit, S., Chowdhury, A. A. N., Alam, M. S., Gazi, M. D. H., & Rahman, M. (2025). Machine learning applications in predicting structural failures and earthquake damage. International Journal of Research in Civil Engineering and Technology, 6(1), 36–45. https://doi.org/10.22271/27078264.2025.v6.i1a.79
- Silvia, M. (2024). The OpenSeesPy Library—OpenSeesPy 3.5.1.3 documentation. https://openseespydoc.readthedocs.io/en/latest/index.html
- Wu, Q., Bansal, G., Zhang, J., Wu, Y., Li, B., Zhu, E., Jiang, L., Zhang, X., Zhang, S., Liu, J., Awadallah, A. H., White, R. W., Burger, D., & Wang, C. (2023). AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation (arXiv:2308.08155). arXiv. https://doi.org/10.48550/arXiv.2308.08155
- Yu, H., Wang, Y., Cheng, T., Yan, Y., Dawson, K. A., Li, S. F. Y., Zheng, Y., & Jin, Y. (2025). Empowering scientific discovery with explainable small domain-specific and large language models. Artificial Intelligence Review, 58(12), 371. https://doi.org/10.1007/s10462-025-11365-w
- Zhang, Z., Chen, K., Cevik, C. B., & Moen, C. D. (2025). Mechanics-informed data-driven prediction model of steel column strength. Proceedings of the Annual Stability Conference Structural Stability Research Council.
This project is licensed under the MIT License. See the LICENSE file for details.
This associated research paper is available in "2026 Proceedings of the SSRC Annual Stability Conference": https://files.ssrcweb.org/proceedings/2026/Zhang_et_al_SSRC_2026.pdf