Conversation
This commit refines the vector storage process in the VectorStore class by consolidating the storage logic into a dedicated function for better maintainability and error handling. It also introduces a new logging utility to set up logging configurations, ensuring consistent logging practices across the application. The changes enhance the clarity and robustness of vector storage operations.
This commit refines the `store_vector` function within the VectorStore class by improving its structure and adding detailed docstrings for better clarity. It also enhances logging for vector storage operations, providing more informative debug messages for different tiers (STM, IM, LTM). Additionally, the logging utility is updated to allow for customizable log directory paths, ensuring more flexible logging configurations.
Similarity search validation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors how memory vectors are stored and adds a new logging utility for configurable console/file logging.
- Introduces
store_vectorhelper to centralize vector storage logic invector_store.py. - Updates STM/IM/LTM storage calls to use the new helper and adds detailed debug logs.
- Adds
setup_logginginmemory/utils/logging.pyto create log directories, configure handlers, and filter messages.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| memory/utils/logging.py | New setup_logging utility with directory creation, handlers, and filters |
| memory/embeddings/vector_store.py | Refactored storage paths using store_vector and enhanced tier-specific logs |
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 refactored approach to storing memory vectors and implements a new logging utility for better log management. The changes improve code modularity, logging configuration, and error handling.
Refactoring and Improvements to Memory Vector Storage:
store_vectorto encapsulate the logic for storing vectors in the appropriate index, improving code readability and reducing redundancy inmemory/embeddings/vector_store.py.store_vectorfunction. This also includes enhanced logging for better traceability.Logging Utility Implementation:
memory/utils/logging.pywith asetup_loggingfunction to configure logging to both console and file. This includes: