Shortterm-memory

Latest version: v1.1.2

Safety actively analyzes 706567 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.1.2

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

python
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:
bash
pip install --upgrade shortterm-memory

1.1.1

For `transformers>=4.44,<5.0`

Usage Example:

python
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:
bash
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.

1.0.9

For `transformers>=4.44,<5.0`

Usage Example:

python
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:
bash
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.

1.0.8

For `transformers>=4.44,<5.0`

Usage Example:

python
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:
bash
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.

1.0.7

For `transformers>=4.44,<5.0`

Usage Example:

python
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:
bash
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.

1.0.6

Page 1 of 2

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.