Examples
This section contains step-by-step examples with code and explanations in interactive Jupyter notebook format.
Available Scenarios
Each scenario is available as both:
- Jupyter Notebook (
.ipynb) - Interactive, runnable examples - Markdown (
.md) - Documentation format
Markdown Documentation
- Scenario 1: Basic Usage
- Scenario 2: Intelligent Memory
- Scenario 3: Multi-Agent
- Scenario 4: Async Operations
- Scenario 5: Custom Integration
- Scenario 6: Sub Stores
- Scenario 7: Multimodal Capability
- Scenario 8: Ebbinghaus Forgetting Curve
- Scenario 9: User Profile Management
Quick Start
Using Jupyter Notebooks
-
Install Jupyter:
pip install jupyter notebook -
Launch Jupyter Notebook:
jupyter notebook -
Open a scenario notebook:
- Start with
scenario_1_basic_usage.ipynbif you're new to powermem - Run each cell sequentially using Shift+Enter
- Modify code and experiment!
- Start with
Using Python Scripts
You can also run the examples as Python scripts by copying code from the markdown files.
Notebook Features
Each notebook includes:
- Step-by-step instructions - Clear explanations for each step
- Runnable code cells - Execute code directly in the notebook
- Markdown documentation - Explanations and context
- Extension exercises - Practice exercises to try on your own
Recommended Learning Path
- Start with Scenario 1 - Learn basic memory operations
- Explore Scenario 2 - Understand intelligent memory features
- Try Scenario 3 - Work with multi-agent scenarios
- Check Scenario 4 - Learn async operations
- Scenario 5 - Custom integrations for advanced users
- Scenario 6 - Sub stores for memory partitioning and optimization
- Scenario 7 - Multimodal capability for image and multimedia processing
- Scenario 8 - Ebbinghaus forgetting curve for time-based memory decay and retention optimization
- Scenario 9 - User profile management for automatic user profile extraction and integration with memory search
Requirements
- Python 3.10+
- powermem installed (
pip install powermem) - Jupyter Notebook (for interactive notebooks)
- LLM provider configured (for intelligent features in Scenario 2+)