AlloyDB: A unified database engine for hybrid search
Achieving high search relevance in modern AI and RAG applications requires combining vector search for semantic context and full-text search (FTS) for keyword precision. AlloyDB for PostgreSQL supports both, but managing and merging their results traditionally involved complex SQL or custom application logic. This often necessitated separate systems for fusion, score normalization, and re-ranking, leading to brittle logic, increased latency, and high operational load. AlloyDB AI's hybrid search simplifies this by consolidating these steps into a single, high-performance SQL function powered by Reciprocal Rank Fusion (RRF). RRF bypasses score normalization by inherently being rank-based, simplifying the process. The ai.hybrid_search() function executes the entire workflow natively, minimizing overhead and ensuring transaction consistency. For FTS optimization, the RUM extension stores word positions directly in the index, enabling low-latency relevance ranking and efficient phrase matching, unlike standard GIN indexes. AlloyDB AI also introduces the BM25 index for superior, out-of-the-box keyword-based scoring. To expand versatility, a new external search Foreign Data Wrapper (FDW) allows querying specialized clusters like Elasticsearch, OpenSearch, and Solr without leaving AlloyDB. This unified architecture simplifies hybrid search, optimizes FTS with options like RUM or BM25, and enhances versatility through external search integration.
ai.hybrid_search()function executes the entire workflow natively, minimizing overhead and ensuring transaction consistency. For FTS optimization, the RUM extension stores word positions directly in the index, enabling low-latency relevance ranking and efficient phrase matching, unlike standard GIN indexes. AlloyDB AI also introduces the BM25 index for superior, out-of-the-box keyword-based scoring. To expand versatility, a new external search Foreign Data Wrapper (FDW) allows querying specialized clusters like Elasticsearch, OpenSearch, and Solr without leaving AlloyDB. This unified architecture simplifies hybrid search, optimizes FTS with options like RUM or BM25, and enhances versatility through external search integration.