Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
Showing results for 
Search instead for 
Did you mean: 


In the ever-evolving landscape of technology, leveraging the power of Artificial Intelligence (AI) and machine learning has become essential for businesses seeking a competitive edge. SAP's Business Technology Platform (BTP) offers a robust ecosystem for deploying AI solutions, and one crucial component of this ecosystem is the PostgreSQL Database. This guide will walk you through the process of utilizing a SAP BTP-hosted PostgreSQL Database as a vectorstore database for AI embeddings. By following the steps outlined below, you can harness the capabilities of AI embeddings to enhance your data analytics and decision-making processes.


  • BTP Account (can be trial)
  • BTP PostgreSQL Database which can be assesible by SSH Tunnel
  • Cloud Foundry CLI

Step 1 - Obtain necessary information from BTP Cockpit and CF CLI

Before you can configure your PostgreSQL database, gather essential information from both the BTP Cockpit and the CF CLI. This information includes authorization tokens, Cloud Foundry region details, instance IDs, and database names. These details will be crucial for the subsequent steps.

Step 1.1 - Obtain Authorization token from CF CLI


cf oauth-token



Step 1.2 - Obtain CloudFoundryRegion from BTP Cockpit


Step 1.3 - Obtain PostgreSQL InstanceID from BTP Cockpit


Step 1.4 - Obtain Database name from BTP Cockpit


Step 2- Activate vector extension for PostgreSQL database hosted on BTP

With the prerequisite information in hand, it's time to activate the vector extension for your PostgreSQL database hosted on SAP BTP. This extension will enable your database to efficiently store and manage AI embeddings. You can activate it using various methods, such as CURL commands or Postman requests, as outlined in the guide. This step is pivotal in preparing your database for AI-related tasks.

To activate vector extension, PostgreSQL version should at least be 13.




Activate with CURL


curl -X PUT 'https://api-backing-services.<CloudFoundryRegion><InstanceID>/extensions/vector' \
--header 'Authorization: <AuthorizationToken>' \
--header 'Content-Type: application/json' \
--data-raw '{"database": "<DatabaseName>"}'


Activate with Postman



Step 3 - Check 'Vector' extension activation on pgAdmin

To connect to your PostgreSQL database, you'll need to establish an SSH tunnel. Follow the instructions outlined in the blog post provided below to open the tunnel.
SAP BTP PostgreSQL Database import to pgAdmin with SSH Tunnel (Local Access) 

Now that your PostgreSQL database is configured as a vectorstore for AI embeddings, you can put it to the test. Additionally with above blog, you learnt how to connect to your PostgreSQL database through an SSH tunnel and interact with the vectorized data.



In conclusion, this guide has equipped you with the knowledge and steps required to harness the power of SAP BTP and PostgreSQL as a vectorstore database for AI embeddings. By following these instructions, you can elevate your data analytics, information retrieval, and decision-making capabilities to new heights. AI embeddings offer a transformative approach to handling unstructured data, enabling you to extract valuable insights and drive innovation within your organization. As technology continues to advance, embracing AI and leveraging robust platforms like SAP BTP becomes imperative for staying competitive in the modern business landscape.

1 Comment

Good one Ali Mert! 🙂

Labels in this area