← Learning

pggraph

A linear, one-concept-per-lesson path through pggraph, the Postgres extension that compiles graph traversal and GQL/Cypher pattern matching on top of ordinary Postgres tables, from registering your first table as a node to a relationship-aware context API for AI agents. 29 lessons · 3 tiers.

Prerequisites: Comfortable writing basic Python. Pairs naturally with pgvector (same 'add a superpower to Postgres' pattern) but doesn't depend on it, either order works.

No AI model calls in this course, it's pure Postgres and Python. Setup needs a local Postgres with the pggraph extension, run via `docker compose up -d` from the project root (a separate container from pgvector's, if you've also done that course), exposed on localhost:5434, database name fixed to `graph` (pggraph's own image requires it).

Built on pggraph, the Postgres extension this course teaches.

Course source

Every lesson's README and lesson.py for this course live in the ai-agent-engineering repo.

View on GitHub →
pggraph

Beginner

Registering tables, building a graph, and basic queries.

  1. 01What Is pggraph?GitHub
  2. 02Installing and ConnectingGitHub
  3. 03Registering Tables as NodesGitHub
  4. 04Registering EdgesGitHub
  5. 05Building the GraphGitHub
  6. 06Getting a Single NodeGitHub
  7. 07Single-Hop NeighborsGitHub
  8. 08Searching NodesGitHub
  9. 09Checkpoint: Company Directory ExplorerGitHub

Intermediate

Multi-hop traversal, paths, filters, and staying in sync.

  1. 10Multi-Hop TraversalGitHub
  2. 11Filtering TraversalsGitHub
  3. 12Shortest PathGitHub
  4. 13Weighted Shortest PathGitHub
  5. 14Find and ExpandGitHub
  6. 15Find Related and ConnectionGitHub
  7. 16Neighborhood SamplingGitHub
  8. 17Auto-DiscoveryGitHub
  9. 18Incremental SyncGitHub
  10. 19Checkpoint: Reporting Chain FinderGitHub

Advanced

GQL/Cypher, components, maintenance, and the capstone.

  1. 20Connected ComponentsGitHub
  2. 21GQL QueriesGitHub
  3. 22GQL Writes and the Mutable OverlayGitHub
  4. 23Cypher CompatibilityGitHub
  5. 24Async Builds and MaintenanceGitHub
  6. 25Sync Policies and Scheduled JobsGitHub
  7. 26Multi-Graph and TenancyGitHub
  8. 27Access Control and QuotasGitHub
  9. 28Monitoring Graph HealthGitHub
  10. 29Capstone: A Relationship-Aware Context APIGitHub
Start at Lesson 1

Contact

Book a Call