Conversation
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.
Agent memory explorer
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 significant changes to the
main_demo.pyfile 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, introducingMemorySpacefor memory interactions, and enhancing the memory configuration for better performance and usability.Refactoring the agent architecture:
BaseAgentand memory hooks inSimpleAgent, simplifying the agent's design. (main_demo.py, main_demo.pyL109-R125)MemoryEnhancedAgentto useMemorySpacedirectly instead of relying onAgentMemorySystemand hooks. (main_demo.py, [1] [2]Memory system updates:
memory_systemcalls withmemory_spacefor storing and retrieving states, actions, and interactions. (main_demo.py, [1] [2] [3]all-MiniLM-L6-v2) and disabled compression for improved similarity search. (main_demo.py, [1] [2]Code simplifications and fixes:
ActionResultwith direct integer actions for simplicity in theactmethod. (main_demo.py, [1] [2]contentkey instead ofcontents. (main_demo.py, [1] [2]Other improvements:
MemorySpaceto useNonefor mock setups, aligning with the new memory configuration. (memory/space.py, memory/space.pyL103-R103)hsetwithhset_dictinvector_store.pyto simplify Redis operations. (memory/embeddings/vector_store.py, memory/embeddings/vector_store.pyL307-R309)