Skip to content

Conversation

@csmangum
Copy link
Contributor

This pull request introduces significant changes to the main_demo.py file and related modules to refactor the memory system integration, simplify the agent architecture, and improve memory handling. The most notable updates include replacing memory hooks with direct API calls, introducing MemorySpace for memory interactions, and enhancing the memory configuration for better performance and usability.

Refactoring the agent architecture:

  • Removed the dependency on BaseAgent and memory hooks in SimpleAgent, simplifying the agent's design. (main_demo.py, main_demo.pyL109-R125)
  • Updated MemoryEnhancedAgent to use MemorySpace directly instead of relying on AgentMemorySystem and hooks. (main_demo.py, [1] [2]

Memory system updates:

  • Replaced memory_system calls with memory_space for storing and retrieving states, actions, and interactions. (main_demo.py, [1] [2] [3]
  • Enhanced memory configuration to include a text embedding engine (all-MiniLM-L6-v2) and disabled compression for improved similarity search. (main_demo.py, [1] [2]

Code simplifications and fixes:

  • Replaced ActionResult with direct integer actions for simplicity in the act method. (main_demo.py, [1] [2]
  • Fixed inconsistencies in memory entry structures by standardizing the use of the content key instead of contents. (main_demo.py, [1] [2]

Other improvements:

csmangum added 5 commits May 25, 2025 14:51
This commit updates the test suite by adding mock memory space to the `test_add_memory` function in `test_agent_memory_system.py`, improving the test's reliability. In `test_converter.py`, mocks for `SentenceTransformer` are introduced to ensure consistent behavior during tests, and error handling is refined to provide clearer messages. Additionally, minor formatting adjustments are made in `test_redis_stm_integration.py` to enhance code readability and maintainability.
This commit improves the formatting of logging messages in `converter.py` for better readability. It also updates the import order in `core.py` to maintain consistency and clarity. Additionally, the `store_memory_vectors` method in `space.py` is modified to create a memory entry before storing it, enhancing the memory management process. Lastly, a temporary placeholder for the Redis client is added in `vector_store.py` to facilitate future adaptations.
This commit modifies the `MemorySpace` class in `space.py` to initialize the vector store with a `None` Redis client, reflecting a temporary change. In `vector_store.py`, the placeholder for the Redis client is removed. Additionally, the test suite in `test_vector_store.py` is updated to replace calls to `hset` with `hset_dict`, ensuring that the tests accurately reflect the current implementation of the Redis client interactions.
…emory management

This commit removes the dependency on BaseAgent in SimpleAgent, simplifying its structure. The MemoryEnhancedAgent is updated to utilize MemorySpace for storing and retrieving states and actions, enhancing memory management. Additionally, the act method now returns actions as integers instead of ActionResult objects, streamlining the interaction with the environment. Configuration for memory management is also improved, including adjustments to memory limits and cleanup intervals.
@csmangum csmangum merged commit 95c0324 into main May 27, 2025
0 of 2 checks passed
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