java-client: extend LongTermMemoryService to take TagFilters as params#310
java-client: extend LongTermMemoryService to take TagFilters as params#310lygaret wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 457057f. Configure here.
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
currently, `namespace`, `userId`, `sessionId`, `topics`, and `entities` are hard coded into the LongTermMemoryService's search request as strings (for `eq`),or lists-of-strings (for `any`). replace them with a new `TagFilter` class, which mirrors the filter definitions in the server and other client just encodes the query into the JSON the server see: agent-memory-server/agent_memory_server/models.py SearchRequest see: agent-memory-client/agent-memory-client-js/src/models.ts SearchRequestParams
upstream will fail these requests, and the other clients perform this same validation
457057f to
4cb29ce
Compare
|
Hello! I'm sorry I let this get stale, but I've addressed the cursor feedback, and am wondering what I'd need to do to help get this moving forward? I'm building an agent layer on top of the java client right now, and have a handful of (backwards compatible) improvements I'm hoping to help bring upstream: this, #326, and possibly one bringing Re:
I understand the callout, and would agree this would be worth a (minor-)version bump, but imo, the java client is still pre-release versioned, and Anyway, thank you for the project! |

currently,
namespace,userId,sessionId,topics, andentitiesare hard coded into the LongTermMemoryService's search request as strings (foreq),or lists-of-strings (forany).replace them with a new
TagFilterclass, which mirrors the filter definitions in the server and other client just encodes the query into the JSON the serversee: agent-memory-server/agent_memory_server/models.py SearchRequest
see: agent-memory-client/agent-memory-client-js/src/models.ts SearchRequestParams
Note
Medium Risk
Search filter getters now return TagFilter instead of String/List, which can break compile-time callers; runtime search behavior changes only when callers opt into new operators, with string/list paths preserved.
Overview
Adds a
TagFiltermodel aligned with the server API (eq,ne,any,all,startswith) and wires it through long-term memory search instead of hard-codedeq/anymaps in the service layer.SearchRequestnow storesuser_id,session_id,namespace,topics, andentitiesasTagFiltervalues. Builders and string/list setters still accept plainStringandList<String>(mapped toeqandany), and overloads accept fullTagFilterinstances for richer queries (e.g.userId(TagFilter.any(...)),namespace(TagFilter.startsWith(...)),topics(TagFilter.all(...))).LongTermMemoryService.searchLongTermMemoriesputs those objects on the JSON payload directly so Jackson emits the correct operator shapes; default namespace usesTagFilter.eqwhen applied.Unit tests cover
TagFilterserialization/validation and search request bodies for backward-compatible and new filter forms.Reviewed by Cursor Bugbot for commit 4cb29ce. Bugbot is set up for automated code reviews on this repo. Configure here.