Skip to content

Releases: stadiello/ShortTerm-memory

v1.1.3

04 Apr 11:15

Choose a tag to compare

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

  1. 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.

  2. Improved Testability
    • The codebase has been refactored to support dependency injection and mocking, enabling easier test maintenance and faster CI pipelines.

  3. 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:

  4. Better debug
    • New logger + logs file

pip install -e .
  1. 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.

  2. 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-memory

Or 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

03 Feb 23:21

Choose a tag to compare

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:
    The update_memory method 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-memory

v1.1.1

20 Jan 13:53
6523e51

Choose a tag to compare

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-memory

We 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

20 Jan 13:41
f2325d0

Choose a tag to compare

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-memory

We 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

20 Jan 13:39
f298632

Choose a tag to compare

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-memory

We 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

20 Jan 13:34
24b91ec

Choose a tag to compare

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-memory

We 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

13 Sep 16:01
1af3409

Choose a tag to compare

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-memory

We 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

13 Sep 15:57

Choose a tag to compare

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-memory

We 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

22 Aug 08:45

Choose a tag to compare

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:

  1. 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).
  2. Improved Conversation History Handling:

    • Update Memory Method: The update_memory method 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.
  3. Integration with Transformers:

    • Summarization Pipeline: The package now leverages the transformers library, specifically the pipeline feature, to perform summarization tasks within the memory compression process.
  4. 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-memory

We 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.3

21 Aug 14:02

Choose a tag to compare

New structuration