Releases: stadiello/ShortTerm-memory
v1.1.3
Release v1.1.3 - Test Coverage & Developer Experience
We’re excited to introduce version 1.2.0 of the shortterm-memory package!
This update brings robust testing infrastructure, better modularity, and improvements aimed at developers contributing to or integrating the library.
Main Updates
-
Unit Test Suite with Pytest
• Added a complete unit test suite using pytest.
• Core methods (update_memory, get_memory, memory_counter, compressed_memory) are now fully covered by tests.
• Heavy operations like summarization with BART are mocked to ensure fast test execution. -
Improved Testability
• The codebase has been refactored to support dependency injection and mocking, enabling easier test maintenance and faster CI pipelines. -
Clean Module Imports
• Package import paths are now standardized using package_dir={'': 'src'} and find_packages('src') in setup.py.
• Developers can install the project in editable mode: -
Better debug
• New logger + logs file
pip install -e .-
Fixes to Mock Behavior in Compression Pipeline
• Correctly mocked tokenizer(...).to(device).input_ids structure to avoid runtime errors in test environments.
• Better simulation of Hugging Face tokenizer and model APIs in test scenarios. -
Test Examples and Fixtures
• Included realistic test data and reusable fixtures to allow for rapid prototyping and behavioral regression testing.
Dev Experience Improvements
• PYTHONPATH=src pytest or editable install ensures all imports work out of the box.
• Improved setup.py configuration to remove placeholder versioning.
• Better structure and naming of test modules under `tests/`.
How to Upgrade
To upgrade to this latest version, run:
pip install --upgrade shortterm-memoryOr for development:
git clone https://github.com/stadiello/ShortTerm-memory.git
cd ShortTerm-memory
pip install -e .Usage Example
import torch
from transformers import pipeline
import logging
from shortterm_memory.ChatbotMemory import ChatbotMemory
# Initialize Chatbot Memory
chat_memory = ChatbotMemory()
# Example of updating the memory with user input and bot response
user_input = "Hello, how are you?"
bot_response = "I'm fine, thank you! How about you?"
chat_memory.update_memory(user_input, bot_response)
# Retrieve the updated conversation history
history = chat_memory.get_memory()
print(history)Coming Soon in v1.3.0
• Memory persistence (save/load to disk)
• Long-term memory plugin integration
• Coverage reports and CI pipeline
v1.1.2
Release v1.1.2 - Performance Optimization and Memory Efficiency
We are thrilled to announce the release of version 1.1.2 of the shortterm-memory package. This update focuses on optimizing performance, enhancing memory management, and improving overall efficiency.
Main Updates
1. Advanced Memory Management Enhancements
-
GPU Acceleration:
Added automatic GPU support using PyTorch, significantly improving summarization performance when a CUDA device is available. -
Batch Processing for Memory Compression:
Introduced batch processing (default batch size: 5) for more efficient handling of conversation history during summarization, reducing latency. -
Optimized Memory Counter:
Enhanced the memory counter to use token-based counting instead of word-based, improving accuracy and performance.
2. Efficient Conversation History Handling
-
Optimized Update Memory Method:
Theupdate_memorymethod has been refactored for better performance, including dynamic compression and automatic trimming of older conversations. -
Dynamic Compression Threshold:
Compression is now triggered based on the token count rather than word count, providing more precise control over memory usage.
3. Integration with Transformers
-
Enhanced Summarization:
Improved summarization using BART with optimized parameters for faster and more concise summaries. -
Efficient Tokenization:
Direct use of tokenization for both counting and summarization, reducing redundant operations.
4. Error Handling and Logging
-
Improved Logging:
Enhanced logging features to provide detailed insights into memory operations, including compression and trimming events. -
Error Handling:
Added robust error handling to manage issues during summarization and memory updates gracefully.
Usage Example
import torch
from transformers import pipeline
import logging
from shortterm_memory.ChatbotMemory import ChatbotMemory
# Initialize Chatbot Memory
chat_memory = ChatbotMemory()
# Example of updating the memory with user input and bot response
user_input = "Hello, how are you?"
bot_response = "I'm fine, thank you! How about you?"
chat_memory.update_memory(user_input, bot_response)
# Retrieve the updated conversation history
history = chat_memory.get_memory()
print(history)How to Upgrade
To upgrade to this latest version, run the following command:
pip install --upgrade shortterm-memoryv1.1.1
Release v1.1.1 - Dependencies Update
For transformers>=4.44,<5.0
Usage Example:
import torch
from transformers import pipeline
import logging
from shortterm_memory.ChatbotMemory import ChatbotMemory
# Initialize Chatbot Memory
chat_memory = ChatbotMemory()
# Example of updating the memory with user input and bot response
user_input = "Hello, how are you?"
bot_response = "I'm fine, thank you! How about you?"
chat_memory.update_memory(user_input, bot_response)
# Retrieve the updated conversation history
history = chat_memory.get_memory()
print(history)How to Upgrade:
To upgrade to this latest version, run the following command:
pip install --upgrade shortterm-memoryWe hope these improvements will enhance your experience with the shortterm-memory package. Please feel free to report any issues or provide feedback to help us continue improving.
v1.0.9
Release v1.0.9 - Dependencies Update
For transformers>=4.44,<5.0
Usage Example:
import torch
from transformers import pipeline
import logging
from shortterm_memory.ChatbotMemory import ChatbotMemory
# Initialize Chatbot Memory
chat_memory = ChatbotMemory()
# Example of updating the memory with user input and bot response
user_input = "Hello, how are you?"
bot_response = "I'm fine, thank you! How about you?"
chat_memory.update_memory(user_input, bot_response)
# Retrieve the updated conversation history
history = chat_memory.get_memory()
print(history)How to Upgrade:
To upgrade to this latest version, run the following command:
pip install --upgrade shortterm-memoryWe hope these improvements will enhance your experience with the shortterm-memory package. Please feel free to report any issues or provide feedback to help us continue improving.
v1.0.8
Release v1.0.8 - Dependencies Update
For transformers>=4.44,<5.0
Usage Example:
import torch
from transformers import pipeline
import logging
from shortterm_memory.ChatbotMemory import ChatbotMemory
# Initialize Chatbot Memory
chat_memory = ChatbotMemory()
# Example of updating the memory with user input and bot response
user_input = "Hello, how are you?"
bot_response = "I'm fine, thank you! How about you?"
chat_memory.update_memory(user_input, bot_response)
# Retrieve the updated conversation history
history = chat_memory.get_memory()
print(history)How to Upgrade:
To upgrade to this latest version, run the following command:
pip install --upgrade shortterm-memoryWe hope these improvements will enhance your experience with the shortterm-memory package. Please feel free to report any issues or provide feedback to help us continue improving.
v1.0.7
Release v1.0.7 - Dependencies Update
For transformers>=4.44,<5.0
Usage Example:
import torch
from transformers import pipeline
import logging
from shortterm_memory.ChatbotMemory import ChatbotMemory
# Initialize Chatbot Memory
chat_memory = ChatbotMemory()
# Example of updating the memory with user input and bot response
user_input = "Hello, how are you?"
bot_response = "I'm fine, thank you! How about you?"
chat_memory.update_memory(user_input, bot_response)
# Retrieve the updated conversation history
history = chat_memory.get_memory()
print(history)How to Upgrade:
To upgrade to this latest version, run the following command:
pip install --upgrade shortterm-memoryWe hope these improvements will enhance your experience with the shortterm-memory package. Please feel free to report any issues or provide feedback to help us continue improving.
v1.0.6
Release v1.0.5 - Bug fixes
Usage Example:
import torch
from transformers import pipeline
import logging
from shortterm_memory.ChatbotMemory import ChatbotMemory
# Initialize Chatbot Memory
chat_memory = ChatbotMemory()
# Example of updating the memory with user input and bot response
user_input = "Hello, how are you?"
bot_response = "I'm fine, thank you! How about you?"
chat_memory.update_memory(user_input, bot_response)
# Retrieve the updated conversation history
history = chat_memory.get_memory()
print(history)How to Upgrade:
To upgrade to this latest version, run the following command:
pip install --upgrade shortterm-memoryWe hope these improvements will enhance your experience with the shortterm-memory package. Please feel free to report any issues or provide feedback to help us continue improving.
v1.0.5
Release v1.0.5 - Bug fixes
Usage Example:
import torch
from transformers import pipeline
import logging
from shortterm_memory.ChatbotMemory import ChatbotMemory
# Initialize Chatbot Memory
chat_memory = ChatbotMemory()
# Example of updating the memory with user input and bot response
user_input = "Hello, how are you?"
bot_response = "I'm fine, thank you! How about you?"
chat_memory.update_memory(user_input, bot_response)
# Retrieve the updated conversation history
history = chat_memory.get_memory()
print(history)How to Upgrade:
To upgrade to this latest version, run the following command:
pip install --upgrade shortterm-memoryWe hope these improvements will enhance your experience with the shortterm-memory package. Please feel free to report any issues or provide feedback to help us continue improving.
v1.0.4
Release v1.0.4 - Enhancements and New Features
We are excited to announce the release of version 1.0.4 of the shortterm-memory package. This update brings several important improvements and new features aimed at enhancing the functionality and efficiency of the package.
Key Updates:
-
Memory Management Enhancements:
- Memory Compression: Introduced a memory compression feature using the BART summarization model. When the conversation memory exceeds a certain word count threshold, it is automatically compressed, preserving the essential context while reducing memory usage.
- Dynamic Memory Trimming: Implemented a trimming mechanism that automatically removes the oldest entries in the conversation history when the memory size exceeds the predefined limit (
MAX_MEMORY_SIZE).
-
Improved Conversation History Handling:
- Update Memory Method: The
update_memorymethod has been optimized to efficiently manage conversation history by appending new user-bot exchanges, compressing when necessary, and trimming excess history. - Memory Counter: Added a new utility to count the total number of words in the conversation history, ensuring that the memory stays within the optimal size for performance.
- Update Memory Method: The
-
Integration with Transformers:
- Summarization Pipeline: The package now leverages the
transformerslibrary, specifically thepipelinefeature, to perform summarization tasks within the memory compression process.
- Summarization Pipeline: The package now leverages the
-
Error Handling and Logging:
- Logging Improvements: Enhanced logging to provide better insights into memory compression and trimming events, ensuring users can track how memory is managed during runtime.
Usage Example:
import torch
from transformers import pipeline
import logging
from shortterm_memory.ChatbotMemory import ChatbotMemory
# Initialize Chatbot Memory
chat_memory = ChatbotMemory()
# Example of updating the memory with user input and bot response
user_input = "Hello, how are you?"
bot_response = "I'm fine, thank you! How about you?"
chat_memory.update_memory(user_input, bot_response)
# Retrieve the updated conversation history
history = chat_memory.get_memory()
print(history)How to Upgrade:
To upgrade to this latest version, run the following command:
pip install --upgrade shortterm-memoryWe hope these improvements will enhance your experience with the shortterm-memory package. Please feel free to report any issues or provide feedback to help us continue improving.