Repository navigation
Python: Fix VolatileMemoryStore ignoring with_embeddings=False in get_batch and get_nearest_matches - #14524
Open
PRABHU KIRAN VANDRANKI (VANDRANKI) wants to merge 1 commit into
Conversation
…_batch and get_nearest_matches
PRABHU KIRAN VANDRANKI (VANDRANKI)
requested a review
from a team
as a code owner
October 1, 2026 16:57
PRABHU KIRAN VANDRANKI (VANDRANKI)
deployed
to
github-app-auth
October 1, 2026 16:57 — with
GitHub Actions
Active
PRABHU KIRAN VANDRANKI (VANDRANKI)
deployed
to
github-app-auth
October 1, 2026 16:57 — with
GitHub Actions
Active
Copilot started reviewing on behalf of
PRABHU KIRAN VANDRANKI (VANDRANKI)
October 1, 2026 16:58
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix correctly addresses the discarded-copy bug and includes appropriate regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes VolatileMemoryStore to honor with_embeddings=False without mutating stored records.
Changes:
- Deep-copies batch and nearest-match results before removing embeddings.
- Adds unit tests for both embedding modes and storage preservation.
| File | Description |
|---|---|
python/semantic_kernel/memory/volatile_memory_store.py |
Corrects embedding removal on returned copies. |
python/tests/unit/memory/test_volatile_memory_store_embeddings.py |
Tests embedding inclusion, exclusion, and persistence. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
4 tasks done
This branch was successfully deployed
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.
Motivation and Context
VolatileMemoryStore.get_batchandget_nearest_matchesdocumentedwith_embeddings=Falseas "do not include embeddings", but the code rebound a loop variable to adeepcopyand dropped it, so the original records (with embeddings) were returned. Fixes #14522.Description
Build the list of deep copies first and clear the embedding on the copies, so the stored records keep their embeddings. Added
tests/unit/memory/test_volatile_memory_store_embeddings.py(4 tests). Two of them fail on main and all pass with the change.Contribution Checklist