Annotation Interface ChatMemoryProviderSupplier
Marks a method as a supplier of the
ChatMemoryProvider that an agent can utilize during its operation.
The annotated method must be static on the agent type, takes the memoryId as argument, and return an instance of ChatMemory.
Besides the memoryId, it can declare parameters resolved through a SupplierParameterResolver.
Example:
public interface SupportAgent {
@Agent("A customer support agent")
String assist(@V("customerQuery") String customerQuery);
@ChatMemoryProviderSupplier
static ChatMemory chatMemory(Object memoryId) {
return MessageWindowChatMemory.withMaxMessages(10);
}
}
Like every helper method, it can be an instance method of a helper object of the agent instead of a static method
of the agent type: see the "Helper objects" section of the agentic tutorial and
AgenticServices.AgentConfigurator.