System Overview
An AI-powered HSSE (Health, Safety, Security, and Environment) system for work order management and risk assessment.
Development Environment Setup
<aside>
Development Environment Setup Guide:
- Download and install PyCharm Community Edition 2023.3.5 from the official JetBrains website. Navigate to the downloads section and select the appropriate version for your operating system (Windows, macOS, or Linux). Follow the installation wizard's instructions to complete the setup process.
- Configure Python interpreter in PyCharm by selecting Python 3.9 or a more recent version (3.9, 3.10, or 3.11 are all compatible - 3.9 preferred). This configuration can be accessed through Settings > Project > Python Interpreter, where you can either use an existing interpreter from your system or create a new one specifically for this project. When creating a new interpreter, ensure it's compatible with the project requirements and verify that it's properly recognized by PyCharm.
- Open Project in PyCharm:
- Open PyCharm Community Edition
- Click on 'Open' from the welcome screen
- Navigate to the folder where you have the HSSE Agent code files
- Select the folder and click 'OK'
- Set up virtual environment for dependency management using PyCharm's built-in tools. This involves creating an isolated Python environment that will contain all the project-specific packages and dependencies, preventing conflicts with other Python projects on your system. You can create a new virtual environment through PyCharm's interface or use command-line tools like venv or virtualenv.
- Open the Terminal in PyCharm:
- Go to 'View > Tool Windows > Terminal'.
- In the terminal, ensure you're in the project root directory.
- Run the following command to install required dependencies: pip install -r requirements.txt
- Wait for the package installation to complete.
</aside>
Required Packages:
fastapi
streamlit
pandas
requests
langchain
langgraph
pydantic
Project Structure
- c.py
- API constants
- Authentication tokens
- HSSE_Agents.py
- Main agent logic
- Agent communication and coordination logic
- Implements langgraph for sequential agent execution
- State management and data flow between agents
- Contains Planner, Risk Assessment, and Analytical agents
- restApi.py
- FastAPI endpoint configuration
- HSSE Agent API setup
- UI.py
- Streamlit interface
- User interaction handling
Key Components
Data Flow
graph TD;
A["User Input (Streamlit UI)"] --> B["FastAPI Endpoint"];
B --> C["HSSE Reasoning Agent"];
C --> D["Specialized Agents"];
D --> E["Results Processing"];
E --> F["UI Display"];
System Features
Error Handling
- Comprehensive error logging
- Debug view in UI
- Exception management
User Feedback
- Response helpfulness rating
- Suggested next steps
- Interactive feedback loop
Installation Steps:
- Install PyCharm Community Edition 2023.3.5 - https://www.jetbrains.com/pycharm/download/
- Install Python (if not already installed) - https://www.python.org/downloads/