State
session.state looks like one dictionary, but a key's prefix decides who can see it and for how long. Run one lunch order across two sessions and two users and watch each scope.
10 minPro
Checking your access…
Inside this lesson
- An animation you play, pause and step through, with each part saying what it is doing.
- The real code beside it, with the lines for each step lit up.
- Practice mode, where you route each message yourself, and a short quiz.
- About 10 minutes.
Written from the official documentation
In this module: Context, sessions and memory
- Agent contextWhat each callback and tool can see.Pro
- SessionsOne conversation, its events and its lifecycle.Pro
- StateSession, user, app and temp prefixes.Pro
- MemoryRemembering across sessions.Pro
- ArtifactsFiles and binary data, versioned.Pro
- EventsThe event stream that drives everything.Pro
- Context caching and compressionCutting cost and fitting long histories.Pro
- Rewind and migrate sessionsGoing back in time; moving storage.Pro