pgvector flow: from question to grounded answer

Scroll or pinch to zoom, drag to move, double-click to zoom in 100% SVG PNG Back to the post
pgvector flow in five steps: the user question is embedded with the same model as the documents; the query vector goes into a SQL query that filters by tenant and orders by distance; PostgreSQL scans the HNSW index; the nearest rows with text, source and metadata are returned; and they are passed as context to the model, which answers with sources.