Menu

1 / 2

How we built hybrid search in Postgres: pgvector, full text, and reciprocal rank fusion

DEV Community: postgres·Infrenic Team·about 2 hours ago
#6kY7KKEF
#devtopostgresql#devto#dev#search#answer
Reading 0:00
15s threshold

A question comes in: "What is our notice period for contractors?"

Two searches run at once. One looks for meaning, so "contractors leaving" finds "notice period". One looks for exact words, so a product code or an invoice number is not blurred. The two ranked lists are merged, the best passages go to the model, and the answer comes back with a source next to every claim.

This post is the implementation. We built it inside Keel, our agentic AI platform, and it runs on a single Postgres database with the pgvector extension. No separate vector database, no third party embedding API.

The pipeline

Five steps from a document to a cited answer.

Parse: text from PDF, Word, HTML, markdown, plain text.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.