From 06bb12ecd60cd539b3f8e6ed45bb515e5249b467 Mon Sep 17 00:00:00 2001 From: alisalim17 Date: Wed, 27 Mar 2024 11:15:20 +0400 Subject: [PATCH 1/2] feat: add support for pgvector in SAML --- libs/superagent/app/api/workflow_configs/saml_schema.py | 1 + libs/superagent/app/utils/helpers.py | 2 ++ libs/superagent/app/vectorstores/base.py | 2 ++ 3 files changed, 5 insertions(+) diff --git a/libs/superagent/app/api/workflow_configs/saml_schema.py b/libs/superagent/app/api/workflow_configs/saml_schema.py index e494e0197..2c3ede9c3 100644 --- a/libs/superagent/app/api/workflow_configs/saml_schema.py +++ b/libs/superagent/app/api/workflow_configs/saml_schema.py @@ -26,6 +26,7 @@ class SuperragDatabaseProvider(str, Enum): pinecone = "pinecone" weaviate = "weaviate" qdrant = "qdrant" + pgvector = "pgvector" class SuperragIndex(BaseModel): diff --git a/libs/superagent/app/utils/helpers.py b/libs/superagent/app/utils/helpers.py index 4c03d7de3..2f188ae9f 100644 --- a/libs/superagent/app/utils/helpers.py +++ b/libs/superagent/app/utils/helpers.py @@ -114,6 +114,8 @@ def get_superrag_compatible_credentials(credentials: dict): # weaviate "WEAVIATE_API_KEY": "api_key", "WEAVIATE_URL": "host", + # PGVector + "SUPABASE_DB_URL": "database_uri", } superrag_credentials = {} diff --git a/libs/superagent/app/vectorstores/base.py b/libs/superagent/app/vectorstores/base.py index ec77c27d5..785cf222f 100644 --- a/libs/superagent/app/vectorstores/base.py +++ b/libs/superagent/app/vectorstores/base.py @@ -21,6 +21,8 @@ "astra": "ASTRA_DB", "weaviate": "WEAVIATE", "supabase": "SUPABASE", + # NOTE: we used "supabase" name initially for the pgvector databases in our database + "pgvector": "SUPABASE", } REVERSE_VECTOR_DB_MAPPING = {v: k for k, v in VECTOR_DB_MAPPING.items()} From ec4273189797ee0ea6398bcada36475cc480abd6 Mon Sep 17 00:00:00 2001 From: alisalim17 Date: Wed, 27 Mar 2024 11:17:40 +0400 Subject: [PATCH 2/2] fix: typo --- libs/ui/config/site.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/ui/config/site.ts b/libs/ui/config/site.ts index 1b45fc3dd..0cd152c0f 100644 --- a/libs/ui/config/site.ts +++ b/libs/ui/config/site.ts @@ -610,16 +610,16 @@ export const siteConfig = { name: "Supabase", logo: "/supabase.png", description: - "The pgvector extension is particularly useful for tasks such as vector similarity search, retrieval, generation, and clustering", - formDescription: "Please enter your Supabase Pgvector credentials.", + "The PGVector extension is particularly useful for tasks such as vector similarity search, retrieval, generation, and clustering", + formDescription: "Please enter your Supabase PGVector credentials.", metadata: [ { key: "SUPABASE_DB_URL", type: "input", - label: "Database Connection URL", + label: "Database Connection URI", placeholder: "postgres://postgres:postgres@localhost:5432/postgres", helpText: - "The connection URL for your database. You can find this in your Supabase dashboard.", + "The connection URI for your database. You can find this in your Supabase dashboard.", }, { key: "SUPABASE_TABLE_NAME",