Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

pgvector Embeddings

Learning Path 3: PostgreSQL Vector Search

Overview

This module covers storing and querying vector embeddings with the pgvector extension on Azure Database for PostgreSQL Flexible Server. You must understand how to enable pgvector via the azure.extensions allowlist, create vector columns with appropriate dimensions, generate embeddings using Azure OpenAI, perform similarity search with distance operators, and build vector indexes for production workloads.

Learning Objectives

After completing this module, you should be able to:

  • Enable the pgvector extension on Azure Database for PostgreSQL Flexible Server
  • Create tables with vector columns and choose appropriate dimensions
  • Generate embeddings using Azure OpenAI embedding models
  • Store embeddings using psycopg with the pgvector adapter
  • Perform similarity search using cosine, L2, and inner product distance operators
  • Understand dimension limits, storage costs, and float32 conversion
  • Build batch embedding pipelines with rate limiting and retry logic

Exam Relevance

This topic falls under "Implement vector search solutions" within the AI-200 data tier. Expect 3-4 questions covering:

  • pgvector extension installation and azure.extensions allowlist
  • Distance operator selection (cosine vs L2 vs inner product)
  • Embedding model choices and dimension tradeoffs
  • Vector storage calculations and dimension limits
  • IVFFlat vs HNSW index selection
  • Batch embedding patterns and rate limiting

Microsoft Learn Resources

Resource Link
Use pgvector on Azure Database for PostgreSQL https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-use-pgvector
Generate embeddings with Azure OpenAI https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/embeddings
pgvector extension overview https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-extensions#pgvector
Azure OpenAI embeddings models https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#embeddings

Study Materials in This Module

File Description
notes.md Comprehensive study notes for pgvector embeddings
cheat-sheet.md SQL commands, distance operators, index types, gotchas
practice-questions.md 10 exam-style practice questions with explanations
hands-on-lab.md Step-by-step labs: enable pgvector, store embeddings, search
code-examples/ Python pgvector examples with Azure OpenAI