Package ai.acolite.agentsdk.core.memory
Class MemorySession
java.lang.Object
ai.acolite.agentsdk.core.memory.MemorySession
- All Implemented Interfaces:
Session,AutoCloseable
MemorySession - In-memory session storage
Stores conversation history in RAM. Data is lost when the JVM exits. Suitable for: - Development and testing - Stateless applications where persistence isn't needed - Short-lived conversations
Thread-safe using CopyOnWriteArrayList.
Ported from TypeScript OpenAI Agents SDK Source: memory/memorySession.ts
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddItems(List<AgentInputItem> newItems) addItemsclearSessionvoidclose()getItemsgetSessionIdpopItem()popItem
-
Constructor Details
-
MemorySession
Create a new MemorySession- Parameters:
sessionId- Unique session identifier
-
-
Method Details
-
getSessionId
Description copied from interface:SessiongetSessionId- Specified by:
getSessionIdin interfaceSession- Returns:
- CompletableFuture
-
getItems
Description copied from interface:SessiongetItems -
addItems
Description copied from interface:SessionaddItems -
popItem
Description copied from interface:SessionpopItem -
clearSession
Description copied from interface:SessionclearSession- Specified by:
clearSessionin interfaceSession- Returns:
- CompletableFuture
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-