sessionId parameter in memory operations. This is an application-level pattern built on top of AG-Kit’s memory APIs.
Core Concept
A session is simply a unique identifier (string) that isolates conversation contexts. All memory operations accept an optionalsessionId parameter to separate data between different users or conversations.
Quick Start
Basic Session Management
Common Session ID Patterns
You can design session IDs based on your application needs:Using Sessions with Agents
Sessions enable isolated conversations for different users or contexts. Learn more: Complete Agent Integration GuideBest Practices
- Use meaningful session IDs - Include user/conversation identifiers for debugging
- Implement session cleanup - Remove old sessions to prevent memory leaks
- Handle session expiration - Implement timeout logic in your application
- Store session metadata separately - Track creation time, last activity, etc.
- Consider privacy - Clear sensitive session data when no longer needed