Repository navigation
[GH-974] Prevent consolidation on small tag groups - #985
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes tag-based feature consolidation by changing the grouping strategy from (tag, feature_name) to just tag, and adds filtering to skip consolidation on groups below the threshold.
Changes:
- Modified
group_features_by_tagto group by tag only instead of(tag, feature_name)tuple - Added threshold filtering in
_consolidate_typeto skip small groups - Updated tests to reflect the new single-tag grouping behavior
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/memmachine/semantic_memory/semantic_model.py | Changed grouping key from tuple to single tag string |
| src/memmachine/semantic_memory/semantic_ingestion.py | Added filtering logic to skip consolidation for groups below threshold |
| tests/memmachine/semantic_memory/test_semantic_model.py | Updated test assertions to expect tag-only grouping |
| tests/memmachine/semantic_memory/test_semantic_ingestion.py | Added new test case and renamed feature values for clarity |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jealous
approved these changes
Jan 27, 2026
malatewang
approved these changes
Jan 27, 2026
SarahScargall
pushed a commit
to SarahScargall/MemMachine
that referenced
this pull request
Jan 29, 2026
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.
Purpose of the change
Fixes consolidation of tags, ensuring that features are properly consolidated based on tags.
Also filters out tags who don't meet the threshold requirement. The storage layer is responsible for ensuring the returned tags meet the consolidation threshold. But there isn't any harm in ensuring this at the application layer as well.
Future changes
While not directly the issue opened in #974 there seems to be a lot of low quality/empty features. Will write a PR to ensure that features generated by the LLM have a minimum quality before writing them to the database.