Skip to content

This repo provides examples of using Generative AI applications to streamline the design of gas pipelines.

Notifications You must be signed in to change notification settings

Farhad-Davaripour/GenAI_Applications_in_Pipeline_Engineering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ALA2005 Pipeline Design Guideline Augmented with a ReAct Agent

Streamlit.

This Streamlit application assists users in retrieving specific information from the ALA2005 pipe design standard (American Lifelines Alliance 2005: Guidelines for the Design of Buried Steel Pipe) and performing calculations related to the different sections of the guideline. The app leverages a ReAct (Reasoning and Acting) Agentic Workflow to split the user query into smaller pieces and execute them sequentially or in parallel to answer. It utilizes Retrieval Augmented Generation (RAG) for question answering and contextual information retrieval and Function Calling to perform calculations.

Important Notes

  1. Disclaimer: The American Lifelines Alliance (ALA) is not involved in the development of this application and does not approve or validate the results generated by the ReAct agent.
  2. Responsibility: You are fully responsible for validating the results produced by the ReAct agent.

Features

  • Retrieve Information from ALA Guidelines: Get detailed context from the ALA2005 pipe design standard.
  • Design a Pipe against ALA Guidelines: Calculate stresses applied to the pipe against the ALA2005 pipe design standard.

Installation

  1. Clone the Repository:

    git clone https://github.com/Farhad-Davaripour/GenAI_Applications_in_Pipeline_Engineering.git
    cd GenAI_Applications_in_Pipeline_Engineering
  2. Create a Virtual Environment:

    python -m venv .venv
    source .venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install Dependencies:

    pip install -r requirements.txt
  4. Set Environment Variables: Create a .env file from .env_template and add the following:

    LLAMA_CLOUD_API_KEY=your_llama_cloud_api_key
    OPENAI_API_KEY=your_openai_api_key
    DEFAULT_QUERY=your_default_query
    
  5. Run the Application:

    streamlit run demo.py

File Descriptions

  • demo.py: Main script for the Streamlit application. It sets up the environment, loads models, and defines the app layout and functionality.
  • src/tools.py: Contains utility functions for processing documents and performing calculations.
  • src/prompt_temp.py: Defines custom prompt templates for the ReAct system.

Usage

  1. Enter Query: Input your query in the text area provided.
  2. Submit Query: Click on the "Submit" button to process your query.
  3. View Results: The app will display the final response along with the reasoning steps.

Deployed Version

You can access the deployed version of the Streamlit app here.

License

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

Is it Legal to Use ALA Material in a RAG Application?

In my efforts to utilize the "Guidelines for the Design of Buried Steel Pipe" from the American Lifelines Alliance (ALA) for educational purposes in a Retrieval-Augmented Generation (RAG) application, I have undertaken due diligence to ensure compliance. The document is publicly accessible from this link and allows for copy for accessibility permissions. Although RAG is a nuanced assistive technology, it likely falls under tools to improve accessibility. Despite attempts to contact the ALA for explicit permission (emails returned as undeliverable), I understand that using this publicly accessible document for non-commercial educational purposes aligns with fair use principles. I remain committed to complying with any future requests from the document's stakeholders.

About

This repo provides examples of using Generative AI applications to streamline the design of gas pipelines.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published