Zenler Player
Your course is loading. Hang tight.
Using AI Features in PostgreSQL (In development - coming soon)
Back to curriculum
0% Complete
0% Complete
Who is this course for?
Who is Greg?
What will I learn in this course?
Module introduction
AI features in PostgreSQL
What the database is responsible for
What the database is not responsible for
What the model service is responsible for
Extensions vs PostgreSQL core
Misconceptions to avoid
Positioning PostgreSQL correctly
Quiz 1
Module introduction
What is an AI model?
What embeddings are and why they exist
How vector similarity differs from relational comparison
Typical AI scenarios that involve vectors
Why vectors work well for these scenarios
When vectors are inappropriate
Where embeddings models are hosted
Common embeddings models
Quiz 2
Module introduction
Vector data type basics
pgvector extension basics
Declaring vector columns and variables
How vector values are represented
Practical table pattern for embeddings
Dimensionality is enforced
Dimensionality changes are migration events
Storage characteristics and limitations of pgvector
Quiz 3
Module introduction
What similarity search means in PostgreSQL
Writing similarity queries in SQL
Exact similarity (KNN) vs approximate search (ANN)
Combining vector similarity with relational predicates
Common query mistakes and inefficiencies
Quiz 4
Module introduction
Why vector indexing exists
HNSW vector indexes
IVFFlat vector indexes
Accuracy versus performance trade-offs
CPU and memory impact of vector queries
Monitoring and diagnosing vector query performance
Quiz 5
Module introduction
Why PostgreSQL might need an external AI service
What REST means in practice
HTTP requests, responses, headers, and status codes
JSON request and response payloads
Endpoints, hosts, ports, and network reachability
Authentication and secrets
Timeouts, throtting, quotas, and cost
Error handling, retries, and idempotency
Operational risks of outbound calls from the database
Quiz 6
Module introduction
Where should AI model calls be made ?
Synchronous vs asynchronous model calls
Introducing pg_net
Understanding the pg_net request lifecycle
Running AI models locally with Ollama
Calling Ollama from PostgreSQL with pg_net
Processing responses and storing embeddings
Invoking generative and chat models
Handling failed requests and retries
Tracking embedding model and version information
Calling online models from PostgreSQL with pg_net
Quiz 7
Module introduction
Why AI enrichment is usually background work
Identifying rows that require processing
Tracking embedding state and model versions
Efficiently finding pending work
Scheduling background processing with pg_cron
Dispatching batches asynchronously with pg_net
Tracking requests and processing responses
Handling retries, concurrency, and idempotency
Re-embedding when content or models change
Monitoring backlog, failures, and throughput
Where using pg_durable might be appropriate
Quiz 8
Module introduction
What RAG means in practical terms
Executing similarity search in an AI workflow
In-database re-ranking
Passing retrieved data back to the app tier or to LLMs
Quiz 9
Module introduction
Protecting sensitive data used in AI workflows
Applying PostgreSQL RLS to vector searches
Auditing AI-related queries
Governance boundaries in AI-enabled systems
Quiz 10
Module introduction
Why it matters to say no
Scenarios where PostgreSQL is the wrong tool
When a specialized vector database makes more sense
Cost, complexity, and mainteance trade-offs
Decision checklist for architects and DBAs
Quiz 11
Module introduction
Data API Builder and PostgreSQL
Architecture and configuration for PostgreSQL
Exposing tables and other objects via REST and GraphQL
Authentication and security
Quiz 12
Module introduction
AI agents and external tools
SQL Server MCP vs PostgreSQL MCP implementation
MCP architecture for PostgreSQL
Example agent workflow querying pgvector data
Quiz 13
Summary and further steps
Module 0: Getting started
Who is this course for?
Preview
Who is Greg?
Preview
What will I learn in this course?
Preview
Module 1: AI in the context of PostgreSQL
Module introduction
AI features in PostgreSQL
What the database is responsible for
What the database is not responsible for
What the model service is responsible for
Extensions vs PostgreSQL core
Misconceptions to avoid
Positioning PostgreSQL correctly
Quiz 1
Module 2: Vector data and embeddings fundamentals
Module introduction
What is an AI model?
What embeddings are and why they exist
How vector similarity differs from relational comparison
Typical AI scenarios that involve vectors
Why vectors work well for these scenarios
When vectors are inappropriate
Where embeddings models are hosted
Common embeddings models
Quiz 2
Module 3: Vector data types in PostgreSQL
Module introduction
Vector data type basics
pgvector extension basics
Declaring vector columns and variables
How vector values are represented
Practical table pattern for embeddings
Dimensionality is enforced
Dimensionality changes are migration events
Storage characteristics and limitations of pgvector
Quiz 3
Module 4: Querying vector data
Module introduction
What similarity search means in PostgreSQL
Writing similarity queries in SQL
Exact similarity (KNN) vs approximate search (ANN)
Combining vector similarity with relational predicates
Common query mistakes and inefficiencies
Quiz 4
Module 5: Vector indexing and performance
Module introduction
Why vector indexing exists
HNSW vector indexes
IVFFlat vector indexes
Accuracy versus performance trade-offs
CPU and memory impact of vector queries
Monitoring and diagnosing vector query performance
Quiz 5
Module 6: Integrating External AI Services
Module introduction
Why PostgreSQL might need an external AI service
What REST means in practice
HTTP requests, responses, headers, and status codes
JSON request and response payloads
Endpoints, hosts, ports, and network reachability
Authentication and secrets
Timeouts, throtting, quotas, and cost
Error handling, retries, and idempotency
Operational risks of outbound calls from the database
Quiz 6
Module 7: Calling AI services from PostgreSQL
Module introduction
Where should AI model calls be made ?
Synchronous vs asynchronous model calls
Introducing pg_net
Understanding the pg_net request lifecycle
Running AI models locally with Ollama
Calling Ollama from PostgreSQL with pg_net
Processing responses and storing embeddings
Invoking generative and chat models
Handling failed requests and retries
Tracking embedding model and version information
Calling online models from PostgreSQL with pg_net
Quiz 7
Module 8: Creating AI Pipelines
Module introduction
Why AI enrichment is usually background work
Identifying rows that require processing
Tracking embedding state and model versions
Efficiently finding pending work
Scheduling background processing with pg_cron
Dispatching batches asynchronously with pg_net
Tracking requests and processing responses
Handling retries, concurrency, and idempotency
Re-embedding when content or models change
Monitoring backlog, failures, and throughput
Where using pg_durable might be appropriate
Quiz 8
Module 9: Retrieval-augmented query patterns
Module introduction
What RAG means in practical terms
Executing similarity search in an AI workflow
In-database re-ranking
Passing retrieved data back to the app tier or to LLMs
Quiz 9
Module 10: Security, governance, and operational concerns
Module introduction
Protecting sensitive data used in AI workflows
Applying PostgreSQL RLS to vector searches
Auditing AI-related queries
Governance boundaries in AI-enabled systems
Quiz 10
Module 11: When NOT to use AI features in PostgreSQL
Module introduction
Why it matters to say no
Scenarios where PostgreSQL is the wrong tool
When a specialized vector database makes more sense
Cost, complexity, and mainteance trade-offs
Decision checklist for architects and DBAs
Quiz 11
Module 12: Using Data API Builder with PostgreSQL
Module introduction
Data API Builder and PostgreSQL
Architecture and configuration for PostgreSQL
Exposing tables and other objects via REST and GraphQL
Authentication and security
Quiz 12
Module 13: Using PostgreSQL with AI Agents via MCP
Module introduction
AI agents and external tools
SQL Server MCP vs PostgreSQL MCP implementation
MCP architecture for PostgreSQL
Example agent workflow querying pgvector data
Quiz 13
Module 14: Next steps
Summary and further steps
×
This is an unpublished lesson. This lesson will not be shown for students unless you set it as Public.
Back to Dashboard
No contents are available in this lesson!
No lessons available !
Back to Dashboard
Lesson contents locked
Enroll to unlock this lesson.
Enroll to unlock
Next Lesson