Conversation
This commit updates the `test_memory_agent.py` file by removing the unused `AutoencoderConfig` import and adjusting the `text_model_name` to use a specific model. Additionally, the mock patching for the embedding engine and other components is streamlined for clarity and consistency, ensuring the tests accurately reflect the current implementation.
This commit introduces a new `debug_converter.py` script for running the AgentFarm to Memory System converter, including logging setup and configuration management. Additionally, the tiering strategy type is updated to "simple" in the configuration files and related classes, ensuring consistency across the codebase. The memory import logic is also enhanced to ensure unique memory IDs based on model type and step number.
This commit updates the `converter.py` to include a new `RedisSTMConfig` for improved memory management settings. The `MemoryAgent` class is modified to generate unique memory IDs using a UUID prefix, enhancing uniqueness. Additionally, the `AgentMemorySystem` class is updated to handle memory tiers more effectively during storage operations. These changes aim to improve the overall functionality and flexibility of the memory system.
This commit updates the `MemoryAgent` class to generate memory IDs using a combination of agent ID, step number, and timestamp, enhancing clarity and uniqueness. Additionally, the `SimilaritySearchStrategy` class is modified to ensure that each memory entry has an ID assigned, improving data integrity. The test configurations are also adjusted to reflect these changes, ensuring consistency across the codebase.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a “simple” tiering strategy as the default, improves memory ID uniqueness and tier metadata handling, extends the converter configuration with Redis STM settings, and supplies a debug script along with updated tests.
- Introduce
SimpleTieringStrategyand make it the default in config and factory - Update memory ID format and pass tier info through
add_memory - Add Redis STM settings to converter config and include
debug_converter.pyfor validation - Align tests with new tiering defaults and engine imports
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| converter/tiering.py | Added SimpleTieringStrategy, updated factory default to “simple” |
| converter/config.py | Set tiering_strategy_type default to “simple” and updated validation list |
| memory/agent_memory.py | Revised _create_memory_entry to use timestamp-based IDs and imported uuid (unused) |
| memory/core.py | Extended add_memory to pull tier from metadata and pass it to store calls |
| memory/search/strategies/similarity.py | Added handling for AgentMemorySystem and ensure each memory has an “id” |
| converter/converter.py | Imported and configured RedisSTMConfig in converter flow |
| debug_converter.py | New script for running and validating the conversion process |
| tests/converter/test_config.py | Updated assertions to expect simple tiering strategy |
| tests/test_memory_agent.py | Removed deprecated imports and fixed TextEmbeddingEngine patch target |
Comments suppressed due to low confidence (2)
memory/search/strategies/similarity.py:102
- AgentMemorySystem is not imported in this module, which will cause a NameError. Add
from memory.core import AgentMemorySystemat the top of the file.
if isinstance(self.memory_system, AgentMemorySystem):
memory/agent_memory.py:6
- [nitpick] The
uuidmodule is imported but never used; consider removing this import to keep the code clean.
import uuid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new "simple" tiering strategy, updates memory ID generation for uniqueness, enhances memory system configuration with Redis STM settings, and adds a new debugging script. It also includes updates to tests and other minor improvements. Below is a summary of the changes grouped by theme:
Tiering Strategy Enhancements:
SimpleTieringStrategyclass that places all memories in the STM tier. Updated thecreate_tiering_strategyfactory function and configuration defaults to use this new strategy. (converter/tiering.py: [1] [2] [3];converter/config.py: [4] [5] [6]Memory System Improvements:
memory/agent_memory.py: memory/agent_memory.pyL223-R224)add_memoryto include tier information in metadata and pass it to appropriate memory storage methods. (memory/core.py: memory/core.pyR363-R383)Configuration and Debugging:
MemoryConfig, including a memory limit, TTL, and namespace. (converter/converter.py: [1] [2]debug_converter.pyscript for running and validating the AgentFarm to Memory System conversion process. (debug_converter.py: debug_converter.pyR1-R82)Testing Updates:
tests/converter/test_config.py: [1] [2];tests/test_memory_agent.py: [3] [4] [5] [6]Minor Fixes and Enhancements:
idduring similarity searches. (memory/search/strategies/similarity.py: memory/search/strategies/similarity.pyR227-R230)