Skip to content

Cross-Engine Fusion Queries

Talon's unique multi-engine fusion query capability combines results across different engines in a single operation.

Overview

Cross-engine queries allow combining the strengths of different engines — for example, geographic filtering followed by vector similarity ranking, or graph traversal followed by full-text scoring.

Available Combinations

CombinationFunctionUse Case
GEO + Vectorgeo_vector_searchNearby semantic search
GEO + Vector (Box)geo_box_vector_searchBounding box + vector
Graph + Vectorgraph_vector_searchGraphRAG
Graph + FTSgraph_fts_searchKnowledge graph retrieval
FTS + Vectorhybrid_searchHybrid retrieval (RRF)
Graph + FTS + Vectortriple_searchTriple fusion search

API Reference

Geographic circle filter → vector similarity ranking.

rust
use talon::{geo_vector_search, GeoVectorQuery};

let hits = geo_vector_search(&store, &GeoVectorQuery {
    geo_name: "places",
    vec_name: "embeddings",
    lng: 116.4074,
    lat: 39.9042,
    radius_m: 1000.0,
    query_vec: &embedding,
    k: 10,
})?;

for hit in &hits {
    println!("member={}, distance={}m, similarity={:.3}", hit.member, hit.geo_dist, hit.vec_score);
}

Geographic bounding box filter → vector similarity ranking.

rust
use talon::{geo_box_vector_search, GeoBoxVectorQuery};

let hits = geo_box_vector_search(&store, &GeoBoxVectorQuery {
    geo_name: "places",
    vec_name: "embeddings",
    lng: 116.4074,
    lat: 39.9042,
    width_m: 2000.0,
    height_m: 2000.0,
    query_vec: &embedding,
    k: 10,
})?;

Graph traversal → vector similarity ranking (GraphRAG).

rust
use talon::{graph_vector_search, GraphVectorQuery, Direction};

let hits = graph_vector_search(&store, &GraphVectorQuery {
    graph: "knowledge",
    vec_name: "embeddings",
    start: root_vertex_id,
    max_depth: 3,
    direction: Direction::Out,
    query_vec: &embedding,
    k: 10,
})?;

for hit in &hits {
    println!("vertex={}, depth={}, similarity={:.3}", hit.vertex_id, hit.depth, hit.vec_score);
}

Graph traversal → BM25 full-text ranking.

rust
use talon::{graph_fts_search, GraphFtsQuery, Direction};

let hits = graph_fts_search(&store, &GraphFtsQuery {
    graph: "knowledge",
    fts_name: "articles",
    start: root_vertex_id,
    max_depth: 2,
    direction: Direction::Out,
    query: "AI database",
    k: 10,
})?;

BM25 full-text + vector KNN via Reciprocal Rank Fusion (RRF).

rust
use talon::{hybrid_search, HybridQuery};

let hits = hybrid_search(&store, &HybridQuery {
    fts_index: "articles",
    vec_index: "emb_idx",
    query_text: "AI database",
    query_vec: &embedding,
    limit: 10,
    pre_filter: Some(vec![("namespace", "tenant_a")]),
    ..Default::default()
})?;

Triple fusion: Graph traversal + FTS + Vector combined.

rust
use talon::{triple_search, TripleQuery, Direction};

let hits = triple_search(&store, &TripleQuery {
    graph: "knowledge",
    fts_name: "articles",
    vec_name: "embeddings",
    start: root_vertex_id,
    max_depth: 2,
    direction: Direction::Out,
    text_query: "AI database",
    vec_query: &embedding,
    k: 10,
})?;

AI Application Patterns

RAG Pipeline

User Query → Embedding → hybrid_search(FTS + Vector) → LLM Context

GraphRAG

User Query → Identify Root Node → graph_vector_search(Graph + Vector) → LLM Context

Location-Aware AI

User Location → geo_vector_search(GEO + Vector) → Nearby Semantic Results → LLM

Released under the MIT License.