withEagerQuery

Set an eager query to preload key memories into the description.

When set, the description will include memories fetched using this query, making them immediately available to the LLM without requiring a tool call. The query transformer receives the base query (contextId, minConfidence, and any narrowedBy scope already applied).

Can be combined with withEagerTopicSearch — both sets of memories will be merged (deduplicated) in the description.

Example (Kotlin):

.withEagerQuery { it.orderedByEffectiveConfidence().withLimit(5) }

Example (Java):

.withEagerQuery(query -> query.orderedByEffectiveConfidence().withLimit(5))

Return

New Memory with eager query configured

Parameters

eagerQuery

Function to transform the base query