Creating AI-ready databases on AIX using vector databases.
Introduction
Overview of PostgreSQL 18.0 and pgvector 0.8.1
The latest release of PostgreSQL 18.0 and pgvector-0.8.1 is now available in AIX Toolbox for users in AIX 7.2 and above. For a detailed overview of new features and enhancements, you can refer to the official PostgreSQL community notes here. With pgvector in AIX Toolbox, AIX users can now store and query embeddings—unlocking AI use cases in the database layer of your applications. This marks a step for developers building modern data and AI pipelines on IBM Power using AIX.
Installing PostgreSQL 18 and pgvector
Step-by-Step Installation Guide
Note: If this is your first time using PostgreSQL in AIX, [i.e. you have no database cluster in your LPAR] then jump to step 4. Otherwise begin from step 1. Everything within the <> in the commands mentioned, for example <user_name>, has to be replaced with your application names.
1: Back up your database.
If you are upgrading from an earlier version of PostgreSQL to PostgreSQL 18, then we would strongly recommend you to back up your databases. In our tests and experiments we used pg_dump like below to back up our database, but we will advise you to read the community documents here, especially if your deployments are larger, and select the best method for your database backup.
pg_dump -U <user_name> -d <DB_name> > <backup_file_name>
Kindly verify your backup size and file permissions before you proceed.
2: Stop the running PostgreSQL service
Use the pg_ctl command and stop your running server service in your LPAR. In our case we had to stop like the below command.
pg_ctl -D <Data_directory_name> -l logfile stop
3: Erase your older PostgreSQL RPMS using the below command.
dnf erase postgresql15-server
Make sure you do not have any postgresql15 RPMS installed by using rpm -qa | grep postgresql15 command.
4: Install the new RPMs using the command below.
dnf install postgresql18-server
5: After this, create your cluster again and restart your database service.
initdb -D <Data_directory>
pg_ctl -D <Data_directory> -l logfile start
Note: if your Data_directory is the same as the previous version, you have to delete it before running initdb.
6: Now restore your database if backed up in step 1
In our experiments we recovered our database using the below command. You can recover based on what you had selected in step 1 and reading the community notes here.
psql -U <user_name> -d <database_name> -f <backup_file_name>
Verify your database now, and it should work.
Note: If you want to install the vector extension to use vector database in AIX and have installed PostgreSQL-18, then do
dnf install postgresql18-pgvector
After this you will be able to run vector operations in your database after running the below command in your database.
CREATE EXTENSION IF NOT EXISTS vector;
Use Cases
You can use the pgvector vector database along with PostgreSQL-18 for the below use cases in AIX.
-
Retrieval Augmented Generation [RAG]: Since ONNX Runtime is available in AIX Toolbox for AIX users 7.2 and above, PyTorch is available for AIX users with AIX 7.3 and above, one can use sentence-transformers or ONNX Runtime to inference LLM’s to generate embeddings for your database locally. You can also use Langchain for context-based reasoning pipelines whose installation steps are given below.
-
AI-assisted application log and anomaly detection: Since AIX is used for core transactions and infrastructure workloads, one can embed log messages or event patterns into vectors that enable you to do similarity-based anomaly detection.
-
Recommendation Engines: pgvector allows storing product, user, or transaction embeddings, supporting recommendation systems inside PostgreSQL.
-
Semantic search in enterprise knowledge bases like ticketing systems.
Note: You can run any LLM of your choice and inference it using ONNXRUNTIME or PyTorch, depending on your environment in AIX, to generate embeddings.
Adapters and langchain
Integrating python Adapters with PostgreSQL 18 and pgvector
If you want to connect your database using Python using psycopg2 and then use LangChain for context-aware chunking of your logs/documents, then follow the below steps for installation.
We would recommend a venv to avoid confusion with system-installed packages from dnf.
pip3.12 cache purge
dnf install rust* cargo*
dnf install python3.12-pydantic-core
python3.12 -m venv --system-site-packages my_env
source my_env/bin/activate
export CXX="g++ -pthread"
export CXXFLAGS=-maix64
export OBJECT_MODE=64
export LDFLAGS="-maix64 -lm"
export CC="gcc -pthread"
export CFLAGS=-maix64
export RUSTFLAGS="-C link-arg=-bbigtoc -L/opt/freeware/lib -lpython3.12 -Clink-args=-blazy -Clto=no -Cembed-bitcode=no -Clinker-plugin-lto=no"
pip3.12 install psycopg2 psycopg2-binary
pip3.12 install langchain-core langchain-community langchain-text-splitters --no-build-isolation
Observability
Monitoring and Debugging PostgreSQL 18 and pgvector
You can use Beats to monitor your PostgreSQL application by creating a yml file as shown below.
# Sample postgres metricbeat.yml
metricbeat.modules:
- module: postgresql
enabled: true
metricsets:
- database
- bgwriter
- activity
# ... other metricsets
hosts: ["<Database_URL>?sslmode=disable"]
output.elasticsearch:
hosts: ["<Server_name>"]
username: uname
password: pass
ssl.verification_mode: none
Then run metricbeat -e -c metricbeat.yml
You can read more about beats on AIX here.
Tool Box Journey
In 2025 the AIX toolbox continues to evolve as a key bridge between the AIX workloads and the open-source innovations, broadening its scope from GNU utilities to build tools to the modern AI/ML toolchains like ONNX Runtime and PyTorch. With over 400 packages in the AIX toolbox, the toolbox emphasise on the roll out of GPG signed RPMs and continues Python migration from 3.9 to 3.12. You can always check out what is new in the AIX toolbox by following the page here.
If you have any questions about postgresql/pgvector in AIX or need anything else for setting the vector database or want to build your own AI pipelines apart from the technologies as mentioned above in AIX, then let us know.
References
Additional Resources