Skip to content

Conversation

@csmangum
Copy link
Contributor

This pull request introduces several improvements and updates across multiple areas, including enhanced handling of Redis index checks, improved filtering logic for memory metadata, updates to embedding generation and storage workflows, and refinements to similarity search functionality. Additionally, test cases and debugging utilities have been updated to reflect these changes.

Enhancements to Redis and Metadata Handling

  • Improved Redis index check to ensure compatibility by converting both the index name and list items to strings for comparison in _ensure_index (memory/embeddings/vector_store.py).
  • Enhanced filtering logic in find_similar_memories to support nested metadata structures, enabling more flexible and accurate filtering (memory/embeddings/vector_store.py).

Embedding Workflow Updates

  • Updated load_memory_system_from_json to directly create Redis connection parameters instead of relying on a connection_params attribute. Added logic to generate embeddings if missing, ensuring all memories have embeddings stored (memory/utils/serialization.py). [1] [2]

Similarity Search Improvements

  • Refactored the SimilaritySearchStrategy to use the memory_system directly, simplifying the interface and removing redundant dependencies (validation/search/similarity/debug_similarity_scores.py). [1] [2]
  • Added a new debug script (debug_similarity_search.py) for interactive testing of the similarity search strategy (validation/search/similarity/debug_similarity_search.py).

Test Suite Updates

  • Updated test data to include embeddings and adjusted test cases to verify embedding storage and generation logic (tests/utils/test_serialization.py). [1] [2] [3]
  • Lowered the minimum similarity score threshold in the similarity test suite to improve test coverage and flexibility (validation/search/similarity/similarity_test_suite.py). [1] [2]

csmangum added 5 commits May 13, 2025 16:39
… names to strings for accurate comparison. This change ensures compatibility with byte representations in the Redis response, improving the reliability of index checks.
…milarity score analysis

This commit introduces a new debug script for testing the SimilaritySearchStrategy, allowing for interactive testing with predefined queries. Additionally, it refactors the analyze_similarity_scores function to simplify the initialization of the similarity search strategy by passing the memory system directly, improving code clarity and maintainability.
This commit adds '*.ipynb' to the .gitignore file to exclude Jupyter notebook files from version control. Additionally, it improves the filtering logic in the VectorStore class to support matching metadata in nested structures, enhancing the accuracy of metadata filtering during vector storage operations. The serialization module is also updated to create Redis connection parameters directly, streamlining the initialization of the vector store.
This commit enhances the test cases in `test_serialization.py` by adding embeddings to the test data for memory systems. The new embeddings include full vectors for two memory entries, improving the coverage of serialization tests and ensuring that the embeddings are correctly handled during the serialization process.
@csmangum csmangum requested a review from Copilot May 15, 2025 00:10
Copy link
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 pull request refines several memory search and storage functionalities, particularly enhancing Redis index handling, metadata filtering logic, embedding generation workflows, and similarity search debugging.

  • Updated test thresholds and expected memory IDs in the similarity test suite.
  • Introduced a new debug script and refactored the similarity search strategy instantiation.
  • Improved Redis connection handling and embedding generation logic in the serialization workflow, with enhanced handling of nested metadata in the vector store.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
validation/search/similarity/similarity_test_suite.py Adjusted test thresholds and expected memory IDs for improved flexibility.
validation/search/similarity/debug_similarity_search.py Added a new interactive debug script for similarity search strategy testing.
validation/search/similarity/debug_similarity_scores.py Refactored SimilaritySearchStrategy instantiation to use the memory_system directly.
tests/utils/test_serialization.py Updated test data to include embeddings and verified store call counts.
memory/utils/serialization.py Revised Redis connection setup and embedding generation logic with additional logging.
memory/embeddings/vector_store.py Enhanced Redis index checks and extended metadata filtering to support nested fields.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@csmangum csmangum merged commit d50af39 into main May 15, 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