← Back to Docs

Search

Full-text, semantic, and hybrid search

Memex supports three search modes across multiple data levels.


Search Modes

ModeEngineBest for
ftsSQLite FTS5Exact keywords, code snippets
vectorLanceDBSemantic similarity, concepts
hybridBoth combinedGeneral search (default)

Hybrid Ranking

Hybrid mode combines FTS and vector results using Reciprocal Rank Fusion (RRF):

score = Σ 1/(k + rank)

Where k=60 balances precision vs recall. Results from both engines are merged and re-ranked by combined score.


Search Levels

What gets searched depends on the level parameter. See Compact for details.

LevelSearchesBest for
sessionsL3 summariesFinding relevant sessions
talksL2 summariesSpecific solutions
rawL0 messagesExact wording

Fallback: If no results at current level, automatically tries the next level down.


Vector Search Requirements

Vector search requires:

  1. Ollama with bge-m3 embedding model
  2. Compact enabled to generate embeddings

Without these, only FTS mode is available.