Skip to main content
Worlds employs a multi-index retrieval strategy to bridge the gap between high-dimensional semantic similarity and deterministic graph logic. The World Engine combines semantic similarity from vector search with keyword precision through FTS and structural constraints through RDF filters to provide a unified relevance ranking.

Reciprocal rank fusion (RRF)

The system uses Reciprocal Rank Fusion to normalize scores across diverse indices. This ensures that a keyword match and a semantic similarity hit are weighted fairly within a single result set. The fusion algorithm follows the standard RRF formula: score=dD160+rank(d)score = \sum_{d \in D} \frac{1}{60 + rank(d)} The following SQL demonstrates this logic implemented within the SQLite engine:
WITH vec_matches AS (
  SELECT id AS rowid, row_number() OVER (PARTITION BY NULL) AS rank_number
  FROM vector_top_k('idx_chunks_vector', vector32(?), ?)
  WHERE ? != ''
),
fts_matches AS (
  SELECT rowid, row_number() OVER (ORDER BY rank) AS rank_number
  FROM chunks_fts WHERE ? != '' AND chunks_fts MATCH ? LIMIT ?
), final AS (
  SELECT
    chunks.id,
    (COALESCE(1.0 / (60 + fts_matches.rank_number), 0.0) +
     COALESCE(1.0 / (60 + vec_matches.rank_number), 0.0)) AS combined_rank
  FROM chunks
  LEFT JOIN fts_matches ON fts_matches.rowid = chunks.rowid
  LEFT JOIN vec_matches ON vec_matches.rowid = chunks.rowid
  WHERE (? = '' OR fts_matches.rowid IS NOT NULL OR vec_matches.rowid IS NOT NULL)
  ORDER BY combined_rank DESC LIMIT ?
)
SELECT * FROM final;

Structural filtering

You can narrow search results by applying graph-based constraints. This prevents your agent from retrieving conceptually similar but structurally irrelevant data.
  • Subjects: Limit search to specific items.
  • Predicates: Limit search to specific relationship types.
  • Types: Limit search to items of a certain rdf:type.

Disambiguation and verification

When the system identifies low-confidence matches or multiple conflicting items, Worlds allows for structured interventions:
  1. Reranking: Use higher-latency cross-encoders to refine the top-K results before they reach the agent context.
  2. Outcome-Based Determinism: Relationship reification allows the system to detect structural anomalies during traversal and trigger auditable verification steps.