Phase 6e: Hybrid Ranking (tsvector + vector)
Goal: Unify keyword search (tsvector) and semantic search (pgvector) into a single endpoint with hybrid ranking, so agents get the best of both signals in one query.
Owner: Dev agent
Repo:
forgejo_admin/pal-e-docsDepends on:
phase-postgres-6d-semantic-search (COMPLETED)Scope
- Add
modeparameter toGET /notes/searchendpoint — values:keyword(default, current behavior),semantic,hybrid - Implement hybrid ranking using Reciprocal Rank Fusion (RRF) — combines tsvector
ts_rankand cosine similarity without needing score normalization - Configurable
alphaparameter for weighting between keyword and semantic relevance (default: 0.5) - Results include score metadata so agents can assess relevance
- Backward compatible — omitting
modeor usingmode=keywordreturns identical results to current behavior - The
/notes/semantic-searchendpoint remains for now (deprecation is a separate decision)
Deliverables
- (to be filled after completion)
Related
phase-postgres-6-vector-search— parent phasephase-postgres-6d-semantic-search— prerequisite (semantic search API)phase-postgres-5-fulltext-search— prerequisite (tsvector infrastructure)plan-2026-02-26-tf-modularize-postgres— parent plan