Choosing a memory strategy
A model forgets everything between calls, so something must carry the conversation into the next turn. Compare the four ways the SDK offers and see who holds the history in each one.
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: Sessions and memory
- Choosing a memory strategyManual history, sessions or server managed conversations.Pro
- SessionsRemembering the conversation between runs.Pro
- Session backendsSQLite, Redis, SQLAlchemy, MongoDB, Dapr or your own class.Pro
- OpenAI hosted and compaction sessionsStore history on OpenAI and shrink long conversations.Pro
- Advanced SQLite and encrypted sessionsBranch a conversation, track usage and encrypt stored history.Pro