Skip to content

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

IDExtensionPackageVersionCategoryLicenseLanguage
101655pgaipgai1.0RAGUnknownPython

Usage

Sources:

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

CREATE EXTENSION pgai;

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 returns TABLE.
  • fetch_google_stock(input_date DATE) is an extension function and returns TABLE.
  • fetch_tesla_stock(input_date DATE) is an extension function and returns TABLE.
  • get_arima_prediction(target_date TEXT) is an extension function and returns FLOAT.
  • get_db_config() is an extension function and returns TABLE.
  • get_prediction_for_date(prediction_date DATE) is an extension function and returns TABLE.
  • predict_stock_close_value_apple(input_date_str TEXT) is an extension function and returns FLOAT.
  • predict_stock_close_value_tesla(input_date_str TEXT) is an extension function and returns FLOAT.
  • apple_stocks is an extension-defined materialized view.
  • google_stocks is an extension-defined materialized view.
  • tesla_stocks is 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.

Table reader