-
Book Overview & Buying
-
Table Of Contents
AI-Ready PostgreSQL 18
By :
This chapter turned embedding generation into a production pipeline rather than a one-off API call. Building on Chapter 18, Step-by-step Approach to Integrating LLMs with PostgreSQL to Create Complete AI Applications, we shifted the core question from "Can we create embeddings?" to "How do we operationalize embeddings without breaking OLTP?"—with clear answers around freshness, failure handling, and scale.
We introduced the two-speeds-of-truth model: operational truth (product.*) must be fast and exact, while semantic truth (embeddings.*) must be reliable and recoverable—but should never hold transactions hostage. From that foundation, we made the key production decision: triggers should enqueue, not embed. Instead of calling the LLM (OpenAI in our example) directly from triggers, we implemented a durable embedding job queue (embeddings.embedding_job), a single-enqueue helper, and lightweight triggers for category, brand, product, and...