pgai
In-database predictive analytics using LSTM, Prophet, ARIMA, and SARIMA models.
pgai · In-database predictive analytics using LSTM, Prophet, ARIMA, and SARIMA models.
Overview
Usage
Sources:
- Official upstream README
- Official extension control file (pgai.control)
- Official extension SQL (pgai–1.0.sql)
pgai — This guide provides step-by-step instructions to install PostgreSQL on various operating systems. Use it for the corresponding vector, model, or retrieval workflow. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.
Core Workflow
Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.
Important Objects
fetch_apple_stock(input_date DATE)is an extension function and returnsTABLE.fetch_google_stock(input_date DATE)is an extension function and returnsTABLE.fetch_tesla_stock(input_date DATE)is an extension function and returnsTABLE.get_arima_prediction(target_date TEXT)is an extension function and returnsFLOAT.get_db_config()is an extension function and returnsTABLE.get_prediction_for_date(prediction_date DATE)is an extension function and returnsTABLE.predict_stock_close_value_apple(input_date_str TEXT)is an extension function and returnsFLOAT.predict_stock_close_value_tesla(input_date_str TEXT)is an extension function and returnsFLOAT.apple_stocksis an extension-defined materialized view.google_stocksis an extension-defined materialized view.tesla_stocksis an extension-defined materialized view.
Requirements and Caveats
- The reviewed control file declares default version
1.0. - The control file marks the extension as relocatable.
- Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.