Installing AIDB
===============

AIDB is a standalone PostgreSQL extension — it installs directly on your
Postgres instance with no dependency on AI Factory or Hybrid Manager.
The steps below walk you through installing it as a standalone package.

!!!note If you’re deploying through AI Factory, AIDB is bundled and
configured as part of that setup. Refer to the AI Factory installation
guide instead.

AIDB is supported on the same platforms as the Postgres distribution
you’re using. For details, see:

- `PostgreSQL product compatibility <https://www.enterprisedb.com/resources/platform-compatibility#pg>`_ 

- `EDB Postgres Advanced Server product compatibility <https://www.enterprisedb.com/platform-compatibility#epas>`_ 

- `EDB Postgres Extended Server product compatibility <https://www.enterprisedb.com/resources/platform-compatibility#epas_extended>`_ 

Prerequisites
-------------

Before you begin the installation process:

1. Set up the repository: Setting up the repository is a one-time task.
   If you’ve already set up your repository, you don’t need to perform
   this step. To set up the repository, go to `EDB repositories <https://www.enterprisedb.com/repos-downloads>`_  and follow
   the instructions provided there.

2. Install your flavor of Postgres if not already installed. See:

   - :ref:`Installing PostgreSQL <Installing AIDB>` 

   - `Installing EDB Postgres Advanced Server <https://www.enterprisedb.com/docs/epas/latest/installing/>`_ 

   - `Installing EDB Postgres Extended Server <https://www.enterprisedb.com/docs/pge/latest/installing/>`_ 

3. Install the pgvector extension:

AIDB relies on the pgvector extension for vector data management.

For installation instructions, see :ref:`Installing pgvector <Installing AIDB>`  .

1. Install VectorChord (optional): for high-performance, low-latency
   vector retrieval. See :ref:`Installing VectorChord <Installing AIDB>`  .

2. Install VectorChord-BM25 (optional): required only if you need hybrid
   keyword + semantic search. See :ref:`Installing VectorChord-BM25 <Installing AIDB>`  .

Install the package
-------------------

The syntax for the package install command is:

.. code:: shell


   #  For Debian/Ubuntu:

   sudo apt-get install edb-<postgres><postgres_version>-aidb

   #  For Linux:

   sudo dnf install edb-<postgres><postgres_version>-aidb

Where

- ``<postgres>`` is the distribution of Postgres you’re using:

.. csv-table::
  :header: Postgres distribution,Value
  :widths: 10,30
  :align: left
  :class: longtable

  PostgreSQL,pg
  EDB Postgres Advanced Server (EPAS),as
  EDB Postgres Extended,pgextended

- ``<postgres_version>`` is the version of Postgres you’re using.

For example, to install AIDB for EDB Postgres Advanced Server 17 on
Debian/Ubuntu:

.. code:: shell

   sudo apt-get install edb-as17-aidb

For example, to install AIDB for PostgreSQL 16 on RHEL8:

.. code:: shell

   sudo dnf install edb-pg16-aidb

After installing AIDB package, see :ref:`Configuring AIDB <Configuring AIDB>`  for the next steps.
