Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 660 Bytes

File metadata and controls

22 lines (18 loc) · 660 Bytes

Memory

Autohand CLI memory is exposed through tool events. The Java SDK does not write memory directly; prompt the agent and observe when it calls memory tools.

sdk.streamPrompt(new PromptParams("Remember that this team uses Java 21."), event -> {
    if (event instanceof Events.ToolStartEvent e && "save_memory".equals(e.toolName())) {
        System.out.println("Saving memory");
    }
});

Ask explicitly when you want memory recalled:

sdk.streamPrompt(new PromptParams("What Java preferences do you remember?"), event -> {
    if (event instanceof Events.MessageUpdateEvent e) {
        System.out.print(e.delta());
    }
});