Search the writing
Semantic — finds chunks about cost even if exact phrase isn't there
Lexical — exact-keyword matches via Postgres tsvector
Hybrid — best of both, fused with RRF
Single-term — fast keyword scan
Every article gets chunked by markdown section, embedded with
gemini-embedding-001 at 512 dimensions,
and stored in Postgres via pgvector with an HNSW index.
The same chunks also carry a tsvector column for
classic full-text search with English stemming.
Each query runs both rankers in parallel (one SQL roundtrip — two CTEs) and fuses the results with Reciprocal Rank Fusion:
rrf(d) = Σ over rankers r: 1 / (k + rank_r(d))
Result: semantic matches that don't share keywords still surface, but a query with exact technical terms (an API name, a CLI flag) still nails the right page.