Installing PostgreSQL (pgvector)
- SKIP this step if AI Pilot is enabled, as AI Agentic Builder is already configured to use a PGVector-enabled PostgreSQL instance deployed by UnO AI Pilot.
- If you set up PostgreSQL using the Installation and Configuration
section, update the values under
uno.agenticAIBuilder.common.postgresin thevalues.yamlfile to match your setup. No changes are needed if you are using the pgvector-enabled PostgreSQL instance deployed by UnO AI Pilot.
To set up a PostgreSQL database with pgvector support, follow these
steps:
- Generate Secure Passwords: You will need three unique, secure,
base64-encoded passwords. Run the following command three times and save the
output each
time.
head /dev/urandom | tr -dc A-Za-z0-9 | head -c32 | base64 - Create
password-secret.yamlCreate a file named
password-secret.yamlwith the following content.Replace
<base64-encoded-passwordX>with the actual passwords you generated in the previous step.apiVersion: v1 kind: Secret metadata: name: postgres-password-secret labels: app: postgres-password-secret annotations: helm.sh/resource-policy: keep data: password: <base64-encoded-password1> postgres-password: <base64-encoded-password2> replication-password: <base64-encoded-password3> - Create
values.yamlfor Helm DeploymentCreate a file named
values.yamlwith the following configuration. This uses a pre-built image that includes thepgvectorextension.auth: enablePostgresUser: true existingSecret: "postgres-password-secret" username: "pguser" tls: enabled: true autoGenerated: true # This section uses a pre-built image with pgvector included. # If you need to build your own custom image, see the optional steps below. image: registry: hclcr.io repository: uno/pgvector tag: 17 pullSecrets: [] # 🔑 Replace with your actual image pull secret(s), e.g., ["hclcr-pull-secret"] - Deploy PostgreSQL Using Helm- First, ensure you have set your Kubernetes
namespace as the
$NAMESPACEenvironment variable. Then, run the following commands to apply the secret and deploy the database.kubectl --namespace $NAMESPACE apply -f ./password-secret.yaml helm --namespace $NAMESPACE upgrade --install postgresdb \ oci://registry-1.docker.io/bitnamicharts/postgresql \ -f values.yaml - Optional: Enable Long-Term Memory Support with a custom image This guide
already includes
pgvectorvia the image in Step 3. However, if you want to build your own custom image instead of using the prebuilt one, follow these steps:- Build Your Own
pgvector-Enabled Image:Create aDockerfilewith the following content:FROM pgvector/pgvector:pg16 AS builder FROM bitnami/postgresql-repmgr:16 COPY --from=builder /usr/lib/postgresql/16/lib/vector.so /opt/bitnami/postgresql/lib/ COPY --from=builder /usr/share/postgresql/16/extension/vector* /opt/bitnami/postgresql/share/extension/ -
Build and Push the Image:
Build this image and push it to a container registry.
-
Update
values.yaml:Replace the
image:section in yourvalues.yamlwith your custom registry, repository, and tag.
- Build Your Own