Package ai.acolite.agentsdk.core.sessions
package ai.acolite.agentsdk.core.sessions
Session management for multi-turn agent conversations.
This package provides interfaces and implementations for managing conversation state across multiple agent interactions:
-
- Interface for session storage
invalid reference
ai.acolite.agentsdk.core.sessions.Session -
- In-memory session storage (for development)
invalid reference
ai.acolite.agentsdk.core.sessions.MemorySession -
- Persistent SQLite session storage (for production)
invalid reference
ai.acolite.agentsdk.core.sessions.SQLiteSession
Example: Using Sessions
// Create a session
Session session = new MemorySession();
// Create an agent
Agent<UnknownContext, TextOutput> agent = Agent.<UnknownContext, TextOutput>builder()
.model("gpt-4.1")
.instructions("You are a helpful assistant.")
.build();
// Run multiple turns with memory
Runner.run(agent, "My name is Alice", RunConfig.builder().session(session).build());
Runner.run(agent, "What's my name?", RunConfig.builder().session(session).build());
- See Also: