1
Create a Python file
agent_with_memory.py
2
Set up your virtual environment
3
Install dependencies
4
Export your OpenAI API key
5
Run Agent
Memory vs Storage
Enabling Memory
enable_agentic_memory=True(used above): Adds anupdate_user_memorytool. The model decides whether to call it. Existing memories are added to context.update_memory_on_run=True: Runs the memory manager for each non-empty user input. This adds a model call and does not guarantee that every detail becomes a memory.