Skip to content

RetrievalMode

RetrievalMode = "semantic" | "lexical"

Defined in: packages/memory-ltm/src/types.ts:130

How a set of recall hits was actually produced.

semantic is the normal path: the query was embedded and matched against the pgvector index. lexical means the semantic path was unavailable — no vector store, no embeddings service, or the provider returned no query vector — and the results came from a case-insensitive keyword scan instead.

A lexical mode is a statement about retrieval quality, not about the corpus: matches are term-overlap, not meaning, so a caller that finds nothing should not conclude the memory does not exist.