narrowedBy

Narrow the scope of all memory queries.

The transformer receives the base query (contextId + minConfidence already applied) and should add further constraints. This scope is enforced on every query — eager loading and all search modes — so the LLM cannot access propositions outside it.

Can be called multiple times; each call replaces the previous narrowing.

Example (Kotlin):

.narrowedBy { it.withEntityId("alice-123") }

Example (Java):

.narrowedBy(query -> query.withEntityId("alice-123"))

Return

New Memory with the scope narrowed

Parameters

narrowedBy

Function to narrow the base query