Company
Date Published
Author
Greg Richardson
Word count
1215
Language
English
Hacker News points
None

Summary

The text discusses automatic embeddings, a feature that automates the process of generating and updating vector representations of content in a database. This is achieved through the use of PostgreSQL extensions such as `pgvector`, `pgmq`, `pg_net`, and `pg_cron`. The approach eliminates the need for an external pipeline to manage embedding generation, reducing drift and complexity. Automatic embeddings can be implemented using either generated columns or trigger-based asynchronous pipelines. The latter involves using SQL triggers to enqueue work when rows are inserted or updated, and leveraging extensions like `pgmq` and `pg_net` to send requests to an Edge Function for embedding generation. This approach provides benefits such as no drift, bringing the model itself, and all SQL functionality. It also simplifies use cases like semantic search, recommendations, and retrieval-augmented generation (RAG).