AlloyDB: A unified database engine for hybrid search
Google Cloud’s AlloyDB AI introduces a native hybrid search function to merge vector and full-text results in a single SQL call, reducing complexity and latency for AI applications.
Modern AI and retrieval-augmented generation (RAG) systems often require combining vector search for semantic context with full-text search (FTS) for keyword precision. AlloyDB for PostgreSQL already supports both capabilities, but merging their results has historically required complex SQL queries, custom application code, or separate systems for score normalization and re-ranking. This fragmented approach increases operational overhead and fragility, particularly as additional search sources are introduced.
AlloyDB AI’s new hybrid search feature simplifies this process by consolidating multi-step workflows into a single SQL function powered by Reciprocal Rank Fusion (RRF). The function accepts search components as a declarative JSON array, executes them in a unified query plan, and returns a single result set with a combined relevance score. This eliminates the need for brittle score normalization, cross-service joins, and application-level orchestration.
The update also introduces performance optimizations for FTS, including the RUM extension for low-latency relevance ranking and phrase matching, and native support for the BM25 index to provide standardized keyword-based scoring. Additionally, a new external search Foreign Data Wrapper (FDW) enables queries against external clusters like Elasticsearch, OpenSearch, and Solr without leaving the AlloyDB environment.
Previously, developers had to manually execute vector and FTS queries, normalize scores across disparate scales, and perform complex joins in application memory to merge results. This decentralized approach led to fragile logic, increased latency, and high operational load. AlloyDB AI’s hybrid search replaces these steps with a single SQL call, reducing latency, simplifying maintenance, and ensuring transaction consistency within the database.