1. Session Scope (Short-term)
Lifetime: Ephemeral (Session duration) Use Case: The current conversation thread. “Refer to the code I just pasted.” Context stored here is automatically prioritized for the immediate next turn but decays rapidly in relevance for future sessions.2. User Scope (Long-term)
Lifetime: Permanent (until deleted) Use Case: Personalization. “My name is Sarah”, “I prefer Python”. This content follows theuser_id across all agents they interact with in your application.
3. Agent Scope (Knowledge Base)
Lifetime: Permanent Use Case: Specialized knowledge. “Our company return policy is 30 days.” This is read-only context available to specificagent_id instances, regardless of which user they are talking to.