Repository navigation
feat(memory): control rerank via env var, off by default - #84
Merged
Zhiyue-Wang merged 3 commits intoOct 29, 2026
Merged
Conversation
The search API gained a rerank flag in SDK 0.1.9, enabled by default on the backend. The TS MCP server now always sends it explicitly: off by default (deployment policy), with an operator-only opt-in via AGENTARTS_MEMORY_RERANK. The tool schema is unchanged — the model cannot toggle it. The startup log line reports the rerank state.
The constructor mixed a collaborator (api) with a policy flag (rerank). rerank flows per-call through SearchOptions now, exactly like userId: resolved from env in the tool layer, defaulted in the client. The MemoryClient constructor is back to a single dependency.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #84 +/- ##
==========================================
+ Coverage 59.41% 59.89% +0.47%
==========================================
Files 115 116 +1
Lines 10570 10646 +76
Branches 1695 1707 +12
==========================================
+ Hits 6280 6376 +96
+ Misses 3752 3707 -45
- Partials 538 563 +25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Self-review findings: the rerank default belonged inside the object literal next to top_k/min_score (same value-with-default shape), and the searchMemories docstring claimed all optional fields are omitted when unset — rerank is the deliberate exception and now says so.
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.
Summary
The search API gained a
rerankflag in SDK 0.1.9, enabled by default on the backend. The TS MCP server now sends it explicitly on every search: off by default, with an operator-only opt-in.Design
AGENTARTS_MEMORY_RERANKenv var (truthy:1/true) enables reranking; default is off.user_id, it belongs to the deployment environment, not the caller.rerankvalue instead of relying on the backend default.endpoint=..., rerank=false.Testing
npm test— 9/9: default search body carriesrerank: false; a server started withAGENTARTS_MEMORY_RERANK=1sendsrerank: truethe database system is not yet accepting connections) while preparing this change. The field definition follows SDK 0.1.9 (MemorySearchFilter.rerank).