Skip to main content
This example shows how to create an agent with persistent memory that stores:
  1. Personalized user memories - facts and preferences learned about specific users
  2. Session summaries - key points and context from conversations
  3. Chat history - stored in SQLite for persistence
Key features:
  • Stores user-specific memories in SQLite database
  • Maintains session summaries for context
  • Continues conversations across sessions with memory
  • References previous context and user information in responses
Examples: User: “My name is John and I live in NYC” Agent: Creates memory about John’s location User: “What do you remember about me?” Agent: Recalls previous memories about John

Code

user_memories.py

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
2

Install libraries

3

Run the agent