For the first few years few people knew about the pgvector extension to Postgres—and then in 2023, pgvector took the world by storm. Why? Because pgvector
gives you ways to store and search vectors in Postgres, enabling all sorts of generative AI capabilities to be built into applications.
If you’re building AI applications on top of Azure Database for PostgreSQL – Flexible Server, you can of course use use pgvector on Azure with Flexible Server.
And the big news is that Flexible Server in Azure Database for PostgreSQL is now directly integrated with Azure OpenAI. Yep, last November we rolled out the new azure_ai extension (Preview) to Azure Database for PostgreSQL.
This blog post will outline the key things to know about how azure_ai
can help you build recommender systems by using semantic search capabilities—along with a demo.
In addition to demo’ing semantic search (looking for high protein recipes), the demo also features using azure_ai
to do text classification such as sentiment analysis and language detection, as well as info extraction, specifically PII redaction.
azure_ai
?
Before you watch the demo below, here are some introductory basics about azure_ai
:
azure_ai
you can use Azure OpenAI directly from Azure Database for PostgreSQL. This means you can generate text embeddings[1] by using SQL queries to call into both Azure OpenAI and Azure AI Language services—without needing a separate application layer. azure_ai
to generate embeddings, you’ll still want to use pgvector
to store the embeddings (and do distance computations) in Azure Database for PostgreSQL.
At the PASS Data Summit 2023 there was a Microsoft keynote led by Shireesh Thota. And I was invited on stage to give a demo of what azure_ai
can do. No pressure. Seriously, this tech made it quite easy to deliver a solid demo.
This short 5.5 minute demo of azure_ai on YouTube shows how you can improve the relevance of search results on a recipe website by using azure_ai
to deliver semantic search results.
Specifically, the demo shows how you can use this new extension to search for high protein recipes on a recipe website even when the recipes don’t contain the term “high protein” anywhere in the recipe—as compared to other Postgres techniques such as using the LIKE clause or using Postgres full text search.
In addition, the demo shows how azure_ai
integrates Azure Database for PostgreSQL with the Azure AI Language service (for sentiment analysis, language detection, and PII redaction.)
azure_ai
and Postgres
To dive deeper into what azure_ai
can do for you in Azure Database for PostgreSQL – Flexible Server, these links give you a good place to start:
Footnotes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.