Skip to content

Agent farm converter#147

Merged
csmangum merged 4 commits intodevfrom
agent-farm-converter
May 23, 2025
Merged

Agent farm converter#147
csmangum merged 4 commits intodevfrom
agent-farm-converter

Conversation

@csmangum
Copy link
Copy Markdown
Contributor

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:

  • Introduced a SimpleTieringStrategy class that places all memories in the STM tier. Updated the create_tiering_strategy factory function and configuration defaults to use this new strategy. (converter/tiering.py: [1] [2] [3]; converter/config.py: [4] [5] [6]

Memory System Improvements:

  • Updated memory ID generation to include agent ID, step number, and timestamp for uniqueness. (memory/agent_memory.py: memory/agent_memory.pyL223-R224)
  • Enhanced add_memory to include tier information in metadata and pass it to appropriate memory storage methods. (memory/core.py: memory/core.pyR363-R383)

Configuration and Debugging:

  • Added Redis STM configuration to MemoryConfig, including a memory limit, TTL, and namespace. (converter/converter.py: [1] [2]
  • Introduced a new debug_converter.py script for running and validating the AgentFarm to Memory System conversion process. (debug_converter.py: debug_converter.pyR1-R82)

Testing Updates:

  • Updated tests to validate the new "simple" tiering strategy and ensure compatibility with the updated configurations. (tests/converter/test_config.py: [1] [2]; tests/test_memory_agent.py: [3] [4] [5] [6]

Minor Fixes and Enhancements:

csmangum added 4 commits May 21, 2025 18:15
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.
@csmangum csmangum requested a review from Copilot May 23, 2025 02:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SimpleTieringStrategy and 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.py for 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 AgentMemorySystem at the top of the file.
if isinstance(self.memory_system, AgentMemorySystem):

memory/agent_memory.py:6

  • [nitpick] The uuid module is imported but never used; consider removing this import to keep the code clean.
import uuid

@csmangum csmangum merged commit ff13424 into dev May 23, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants