ASCM is an application that leverages Large Language Models (LLMs) and the power of agents to streamline and enhance maintenance and logistics processes within a supply chain context.
Here's a breakdown of the repository's structure:
Folder/File | Description |
---|---|
Agents/ | Contains the definitions and implementations of all agents. |
Agents/agent_definitions.py | Defines the functionalities and behaviors of different agents. |
Agents/core.py | Implements the core functionalities of the agent interactions. |
Agents/orchestrator.py | Defines an orchestrator agent that manages and calls other agents. |
Agents/init.py | Marks directories as Python packages. |
Files/ | This folder stores various files, including images, templates, and other resources, serving as a placeholder for data and assets used by the agents. |
Files/DeterminationOutput.csv | Contains sample data for preferential status determination. |
Files/employees.csv | Contains sample employee data. |
Files/guidebushBOM.csv | Contains sample Bill of Materials (BOM) data. |
Tools/ | Includes utility scripts, helper functions, and external libraries that support the core functionalities of the agents and the application. |
Tools/python_functions.py | Contains various Python functions used by the agents. |
Tools/tool_instructions.py | Contains functions to create tool instructions based on available tools. |
Tools/init.py | Marks directories as Python packages. |
TL-2000_StingSport.jpg | An image file for testing purposes. |
main.py | The primary entry point of the ASCM backend application. Good for testing. |
requirements.txt | Lists the required Python packages. |
settings(template).yaml | A template for the settings.yaml file. Needs to be renamed. |
streamlit_frontend.py | Implements the user interface of the ASCM application using Streamlit. |
.gitignore | Specifies files and folders to be excluded from version control. |
session_handler.py | Provides a chat session manager for interacting with Gemini models. |
-
Set up a Google Cloud Project: If you don't already have one, create a Google Cloud project. Make sure billing is enabled.
-
Enable the Vertex AI API: Enable the Vertex AI API for your project.
-
Enable the Google Calendar API: Enable the Google Calendar API for your project. This is necessary for scheduling functionalities.
-
Install Required Libraries: Create and activate a virtual environment. Then install the required packages from
requirements.txt
:pip install -r requirements.txt
-
Configure Authentication: Set up authentication for your Google Cloud project. You can do this using the gcloud command-line tool:
gcloud auth application-default login
-
Create two Cloud Storage buckets: one for aircraft manuals and another for safety reports. Replace your-bucket-name with unique names.
gsutil mb gs://your-bucket-name-manuals gsutil mb gs://your-bucket-name-safety-reports
Upload your PDF manuals into the your-bucket-name-manuals bucket and your safety reports into the your-bucket-name-safety-reports bucket.
-
Set up Search Engines: Create two Search Engines, one for indexing manuals and one for safety reports, following the instructions in the Google Cloud documentation. Note their application IDs.
-
Set up a Google Calendar: Create a Google Calendar specifically for scheduling maintenance tasks. Obtain the Calendar ID. This is typically found in the calendar's settings. For the purpose of this application, we will refer to the person who owns the calendar as "John Smith", to use the Google Calendar API.
-
Configure settings.yaml: Replace the placeholder values in settings.yaml with your actual configuration details:
project_id: "your-project-id" location: "your-project-location" #e.g., "us-central1" manuals_bucket: "your-bucket-name-manuals" safety_reports_bucket: "your-bucket-name-safety-reports" app_id_manuals: "your-app-id-manuals" # Refer to step 7. app_id_safety_reports: "your-app-id-safety-reports" # Refer to step 7. gcal_api_key: "YOUR_GCAL_API_KEY" # Obtain this from the Google Cloud Console. johnSmith_gcal_ID: "john.smiths.calendarId" # Replace with John Smith's Google Calendar ID. Refer to step 8.
-
Prepare Data: Load the
Files/employees.csv
into a BigQuery table on your GCP project. Put the dataset project, dataset name (e.g. 'ascm') and table name (e.g. employees) in settings.yaml. -
Rename settings(template).yaml: Remove the (template) and rename to
settings.yaml
. -
Run the Application:
Backend: python main.py Frontend (Streamlit): streamlit run streamlit_frontend.py