fix(db): normalize agent name in memory vector search - #2307
Merged
EItanya merged 4 commits intoJul 21, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes inconsistent agent-name normalization in the Postgres vector-search query so SearchAgentMemory returns memories regardless of whether they were stored under a hyphenated or underscore-normalized agent name. This aligns search behavior with the existing normalization behavior in list/delete paths and adds a regression test.
Changes:
- Update
SearchAgentMemorySQL to match either of two agent-name variants (raw + normalized) while keeping the user scoping intact. - Update the Postgres DB client to pass both the raw agent name and its hyphen→underscore normalized variant into the query.
- Add a new test that stores a memory under the underscore form and verifies searching with the hyphenated form returns it.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| go/core/internal/database/queries/memory.sql | Expands SearchAgentMemory filtering to match either raw or normalized agent name, adjusts parameter ordering. |
| go/core/internal/database/gen/memory.sql.go | Regenerates sqlc output to reflect the updated query signature (additional agent-name parameter). |
| go/core/internal/database/client_postgres.go | Passes both raw and normalized agent name into SearchAgentMemory. |
| go/core/internal/database/client_test.go | Adds regression test for normalized-name search and includes minor comment punctuation tweaks. |
Files not reviewed (1)
- go/core/internal/database/gen/memory.sql.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
mesutoezdil
force-pushed
the
fix/memory-search-agent-name
branch
from
July 21, 2026 09:09
dbe754c to
5682f20
Compare
supreme-gg-gg
approved these changes
Jul 21, 2026
6 tasks
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.
ListAgentMemories and DeleteAgentMemory match both the hyphen and underscore forms of the agent name. SearchAgentMemory only matched the raw form, so a search with one form silently missed memories stored under the other. The same normalization is now applied in the search query. Covered by a new test.