Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: Add Azure DB for PostgreSQL vector store #9326

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lossyrob
Copy link
Contributor

Motivation and Context

This adds a VectorStore for Azure DB for PostgreSQL.

Currently, the only additional functionality this provides over the PostgresVectorStore is to easily connect to the database using Entra authentication. In the future, we will add capability to leverage the new DiskANN indexing.

Description

  • Leverage the ability to pass in a custom AsyncConnection class to psycopg_pool's AsyncConnectionPool. The custom AsyncEntraConnection class will identify if a azure.core.credentials TokenCredential or AsyncTokenCredential has been passed as a 'credential' connection argument, or supply the DefaultAzureCredentials if no user or password has been set. This will be used to set the username and password for the Entra user for each new connection the pool creates.
  • The AzureDBForPosgresSettings overrides methods from PostgresSettings to provide Entra authentication, allowing the user and password to not be set and generating the connection pool with AsyncEntraConnection
  • The tutorial was updated to allow the user to choose either AzureDBForPostgres or Postgres as the vector store.

TODO:

  • Unit tests
  • Integration tests

Contribution Checklist

@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel memory labels Oct 18, 2024
@markwallace-microsoft
Copy link
Member

Python Unit Test Overview

Tests Skipped Failures Errors Time
2659 4 💤 0 ❌ 0 🔥 1m 22s ⏱️

@moonbox3
Copy link
Contributor

Hi @lossyrob, is this PR ready for a review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
memory python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants