withMemory
Extension function to perform memory operations within a AIAgentStageContext.
This provides a convenient way to use memory operations within agent nodes with a more concise syntax using the withMemory
block.
Example usage:
val loadUserPreferences by node {
// Use memory operations in a block
stageContext.withMemory {
loadFactsToAgent(
concept = Concept("preferred-language", "User's preferred programming language"),
subjects = listOf(MemorySubjects.User)
)
}
}
Content copied to clipboard
Return
The result of the action
Parameters
action
The memory operations to perform