Skip to content

Commit 7cdbecf

Browse files
committed
Merge branch 'development' of https://github.com/mendix/docs into development
2 parents ab9d3eb + b3631d4 commit 7cdbecf

File tree

2 files changed

+66
-9
lines changed

2 files changed

+66
-9
lines changed

content/en/docs/appstore/use-content/modules/genai/concepts/rag-example-implementation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Before you start experimenting with the end-to-end process, make sure that you h
4141

4242
You have access to a (remote) PostgreSQL database with the [pgvector](https://github.com/pgvector/pgvector) extension available.
4343

44-
{{% alert color="info" %}}If you have access to an Amazon Web Services (AWS) account, Mendix recommends you use a [free-tier RDS](https://aws.amazon.com/rds/faqs/#product-faqs#amazon-rds-faqs#free-tier) setup described in the [Creating a PostgreSQL Database with Amazon RDS](/appstore/modules/genai/pgvector-setup/#rds-database) section. This is convenient, since PostgreSQL databases in Amazon RDS by default have the required pgvector extension available.{{% /alert %}}
44+
{{% alert color="info" %}}If you have access to an Amazon Web Services (AWS) account, Mendix recommends you use a [free-tier RDS](https://aws.amazon.com/rds/faqs/#product-faqs#amazon-rds-faqs#free-tier) setup described in the [Creating a PostgreSQL Database with Amazon RDS](/appstore/modules/genai/pgvector-setup/#aws-database-create) section. This is convenient, since PostgreSQL databases in Amazon RDS by default have the required pgvector extension available.{{% /alert %}}
4545

4646
### 3.2 Steps {#steps}
4747

content/en/docs/appstore/use-content/modules/genai/pg-vector-knowledge-base/vector-database-setup.md

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ This page describes how a PostgreSQL vector database can be set up to explore us
1616
This procedure describes a setup based on a PostgreSQL database with the pgvector extension to query embedding vectors. However, this is not the only possible solution. Other (vector) database types may better fit your use case.
1717
{{% /alert %}}
1818

19-
## 2 Creating a PostgreSQL Database with Amazon RDS {#rds-database}
19+
## 2 Managing a PostgreSQL Database with Amazon RDS {#aws-database}
20+
21+
### 2.1 Creating a PostgreSQL Database with Amazon RDS {#aws-database-create}
2022

2123
{{% alert color="info" %}}
2224
For detailed steps for creating a PostgreSQL Database with Amazon RDS, see [Create and Connect to a PostgreSQL Database](https://aws.amazon.com/getting-started/hands-on/create-connect-postgresql-db/) in the *AWS Documentation*. You can check out the following sections in the AWS Documentation for preliminary background knowledge:
@@ -70,10 +72,57 @@ You can use the values in the steps below for experimental purposes:
7072

7173
{{% alert color="info" %}}For a single IPv4 address, the CIDR range is equal to the IP address with `/32` appended.{{% /alert %}}
7274

73-
## 3 Deleting Resources in AWS {#deleting-aws-resources}
75+
### 2.2 Deleting Resources in AWS {#aws-database-delete}
7476

7577
If no action is taken, resources in AWS will stay around indefinitely. Make sure to think about deleting the resources when you are done experimenting. When using services from AWS, you are responsible for having the necessary resources and deleting the ones that are no longer needed, to prevent from being charged more than is required. This is especially relevant the moment resources fall outside of the free-tier after a certain time.
7678

79+
## 3 Managing a PostgreSQL Database with Microsoft Azure {#azure-database}
80+
81+
### 3.1 Creating a PostgreSQL Database with Microsoft Azure {#azure-database-create}
82+
83+
{{% alert color="info" %}}
84+
For detailed steps for creating a PostgreSQL Database with Azure and enabling the *pgVector* extension, see [Quickstart: Create an Azure Database for PostgreSQL](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/quickstart-create-server-portal) and [How to enable and use pgvector on Azure Database for PostgreSQL](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-use-pgvector) in the *Azure Documentation*.
85+
{{% /alert %}}
86+
87+
You can use the values in the steps below for experimental purposes:
88+
89+
1. Create a new resource from the home page of the Azure Portal.
90+
91+
2. Search and select **Azure Database for PostgreSQL Flexible Server**.
92+
93+
3. Click **Create** and use the following specifications in the **Basics** tab:
94+
1. Select a **Subscription** and **Resource**.
95+
2. Enter a **Server name**. The name needs to be unique.
96+
3. Choose a **region** that best fits your requirements.
97+
4. Select a **PostgreSQL version**.
98+
5. If your main purpose of the database is development and testing, choose **Development** for **Workload type** that will reduce the estimated costs.
99+
6. At the bottom, choose an **Authentication method**:
100+
1. For **PostgreSQL authentication**, make sure that you store username and password securely.
101+
2. For **Microsoft Entra authentication**, select an admin.
102+
103+
4. Continue with the **Networking** configurations in the next tab.
104+
1. Based on your requirements, decide how the database server can be accessed (for testing purposes, it is recommended to use *Public Access*):
105+
1. **Public access**: firewall rules need to be added for the IP addresses that are allowed to access the server. Use **Add current client IP address** to add your own IP when running the application locally. For apps running in the Mendix cloud, add the IP of that environment, see [Mendix IP Addresses: Outgoing IP](/developerportal/deploy/mendix-ip-addresses/#outgoing) for a list of addresses to safe-list in this scenario. Alternatively, you can use **Add 0.0.0.0 - 255.255.255.255** so that no IP addresses are blocked. Use this carefully and make sure that this aligns with your security requirements.
106+
2. **Private Access**: the server can only be accessed from a **Virtual Network** that needs to be selected (or created). Make sure that your Mendix App is running in the same network.
107+
108+
{{% alert color="info" %}}For experimental purposes, you do not need to configure anything in the **Security** or **Tags** tabs to get the server running.{{% /alert %}}
109+
110+
5. On the last tab **Review + create**, review your settings and estimated costs. **Create** the resource if there is nothing you need to change.
111+
112+
6. Wait for the database to be created. This can take some time. You may already navigate to the newly created resource by searching for the name you chose.
113+
114+
8. Once the server is running, you can add the pgVector extension to the allowed extensions list (see [How to enable and use pgvector on Azure Database for PostgreSQL](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-use-pgvector) in the *Azure documentation*) or see the following steps:
115+
1. Search for **Server parameters** in the search bar on the left. A list of parameters is loaded.
116+
2. Search for **azure.extensions**.
117+
3. In the column *VALUE*, search in the dropdown for **VECTOR** (note that in Azure the extension is not called *pgVector* but just *Vector*).
118+
4. Save the changes.
119+
120+
9. Search for **Databases** in the search bar on the left. Verify that there is already a database that you can use. Alternatively, create a new database by clicking **Add** at the top.
121+
122+
### 3.2 Deleting Resources in Azure {#azure-database-delete}
123+
124+
If no action is taken, resources on Azure will stay around indefinitely. Make sure to think about deleting the resources when you are done experimenting. When using services from Azure, you are responsible for having the necessary resources and deleting the ones that are no longer needed, to prevent from being charged more than is required.
125+
77126
## 4 Configuring the Database Connection Details in Your Application {#configure-database-connection}
78127

79128
1. Add the [PgVector Knowledge Base](https://marketplace.mendix.com/link/component/225063) module and its dependencies to your Mendix app and set it up correctly, see [PgVector Knowledge Base](/appstore/modules/genai/pgvector/).
@@ -86,27 +135,35 @@ If no action is taken, resources in AWS will stay around indefinitely. Make sure
86135

87136
5. Edit the configuration details as follows:
88137
1. Format the Jdbc URL in the following way:
89-
`jdbc:postgresql://{endpoint-from-the-AWS-console}:5432/{vectorDatabaseName}`.
138+
`jdbc:postgresql://{endpoint}:5432/{vectorDatabaseName}`.
139+
140+
{{% alert color="info" %}}The default port for PostrgreSQL databases is `5432`. If you manually chose another port, then change this in the URL as well.{{% /alert %}}
90141

91-
To find the endpoint in the AWS console:
142+
To find the endpoint in the **AWS console**:
92143

93144
1. Go to Amazon RDS and make sure the right region in which the RDS database was created is selected at the top.
94145

95146
2. Under **Databases**, click your new database to view the details.
96147

97148
3. On the **Connectivity & Security** tab, you can find the endpoint.
149+
150+
The value for `{vectorDatabaseName}` in the URL is the initial database name you set when you [created the PostgreSQL database with Amazon RDS](#aws-database-create).
151+
152+
To find the endpoint in the **Azure portal**:
153+
154+
1. Search for your resource that was newly created.
98155

99-
The value for `{vectorDatabaseName}` in the URL is the initial database name you set when you [created the PostgreSQL database with Amazon RDS](#rds-database).
156+
2. On the **Overview** page, copy the value next to **Server name**, for example *my-servername.postgres.database.azure.com* as the `{endpoint}` in the URL.
100157

101-
4. `5432` is the default port for PostgreSQL databases. If you manually chose another port, then change this in the URL as well.
158+
3. In the search bar on the left, search for **Databases**. In the search result, there is a list of possible databases that can be used for `{vectorDatabaseName}` in the URL. Only use a database with *schema type* "User".
102159

103-
2. Use the master username and master password that you set in the **Settings** when you [created the PostgreSQL Database with Amazon RDS](#rds-database) as your username and password.
160+
2. Use the master username and master password that you set in the **Settings** when you [created the PostgreSQL Database with Amazon RDS](#aws-database-create) or for the admin user in the [Azure Portal](#azure-database-create) as your username and password.
104161

105162
3. Save and test the configuration.
106163

107164
## 5 Setup Alternatives {#setup-alternatives}
108165

109-
Setting up an AWS RDS database with the pgvector extension is one of the easiest options for using a vector database for our sample implementation. However, there are also alternatives and general considerations, which are described in this section.
166+
Setting up a cloud database with the pgvector extension is one of the easiest options for using a vector database for our sample implementation. However, there are also alternatives and general considerations, which are described in this section.
110167

111168
### 5.1 Running a PostgreSQL Database Locally {#local-database}
112169

0 commit comments

Comments
 (0)