narrowed By
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") }Content copied to clipboard
Example (Java):
.narrowedBy(query -> query.withEntityId("alice-123"))Content copied to clipboard
Return
New Memory with the scope narrowed
Parameters
narrowed By
Function to narrow the base query