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.
- 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.
- Responsibility: You are fully responsible for validating the results produced by the ReAct agent.
- 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.
-
Clone the Repository:
git clone https://github.com/Farhad-Davaripour/GenAI_Applications_in_Pipeline_Engineering.git cd GenAI_Applications_in_Pipeline_Engineering
-
Create a Virtual Environment:
python -m venv .venv source .venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies:
pip install -r requirements.txt
-
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
-
Run the Application:
streamlit run demo.py
- 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.
- Enter Query: Input your query in the text area provided.
- Submit Query: Click on the "Submit" button to process your query.
- View Results: The app will display the final response along with the reasoning steps.
You can access the deployed version of the Streamlit app here.
This project is licensed under the MIT License. See the LICENSE file for details.
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.