Memory

constructor(contextId: <Error class: unknown class>, repository: PropositionRepository, projector: MemoryProjector = DefaultMemoryProjector.DEFAULT, minConfidence: Double = DEFAULT_MIN_CONFIDENCE, defaultLimit: Int = DEFAULT_LIMIT, topic: String = "the user & context", useWhen: String = "whenever you need to recall information about ", narrowedBy: UnaryOperator<PropositionQuery>? = null, eagerQuery: UnaryOperator<PropositionQuery>? = null, eagerTopicSearch: Int? = null, eagerTextSearch: <Error class: unknown class>? = null, provenanceResolver: ProvenanceResolver? = null)

Parameters

contextId

The context to search within

repository

The proposition repository to query

projector

Projector for categorizing memories by knowledge type

minConfidence

Minimum confidence threshold for memories

defaultLimit

Default limit for search results

topic

Description of the memories we can retrieve. Should complete with the form "memories about ".

useWhen

Description of when to use the memory tools.

narrowedBy

Optional query transformer that narrows the scope of all queries. Applied on top of the base query (contextId + minConfidence) before any tool-specific additions. Use this to restrict Memory to a subset of propositions (e.g., by entity, level, or temporal range). Cannot widen the base scope, only narrow it.

eagerQuery

Optional query transformer to eagerly load 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. Applied on top of the narrowed base query.

eagerTopicSearch

Optional limit for eager topic-based similarity search. When set, uses the topic to perform a vector similarity search and preloads matching memories into the description. Can be used alongside or instead of eagerQuery.

eagerTextSearch

Optional similarity search request to eagerly preload memories. When set, performs a vector similarity search using this request and preloads matching memories into the description. Ideal for passing recent conversation content so the LLM sees relevant memories without needing a tool call.