Skip to content

Dev#131

Merged
csmangum merged 3 commits intomainfrom
dev
May 17, 2025
Merged

Dev#131
csmangum merged 3 commits intomainfrom
dev

Conversation

@csmangum
Copy link
Copy Markdown
Contributor

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:

  • Added a new helper function store_vector to encapsulate the logic for storing vectors in the appropriate index, improving code readability and reducing redundancy in memory/embeddings/vector_store.py.
  • Updated the logic for storing vectors in Short-Term Memory (STM), Intermediate Memory (IM), and Long-Term Memory (LTM) indices to use the new store_vector function. This also includes enhanced logging for better traceability.

Logging Utility Implementation:

  • Introduced a new logging utility in memory/utils/logging.py with a setup_logging function to configure logging to both console and file. This includes:
    • Creating a logs directory dynamically in the current working directory.
    • Filtering out embedding-related log messages for cleaner logs.
    • Supporting both file and console handlers with different log levels and formats.

csmangum added 3 commits May 16, 2025 18:08
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.
@csmangum csmangum requested a review from Copilot May 17, 2025 02:15
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 refactors how memory vectors are stored and adds a new logging utility for configurable console/file logging.

  • Introduces store_vector helper to centralize vector storage logic in vector_store.py.
  • Updates STM/IM/LTM storage calls to use the new helper and adds detailed debug logs.
  • Adds setup_logging in memory/utils/logging.py to 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

@csmangum csmangum merged commit 935a8b9 into main May 17, 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