fix: recall via /v3/search so self-hosted backends inject matches - #114
Open
Divyansh151005 wants to merge 1 commit into
Open
Divyansh151005 wants to merge 1 commit into
Divyansh151005 wants to merge 1 commit into
Conversation
Per-prompt recall only read /v4/profile's embedded searchResults, which stays empty on self-hosted even when /v3/search returns real hits — so the hook looked healthy but never injected context. Route recall through a dedicated searchMemory helper, normalize score/nested-chunk shapes, and leave /v4/profile for session-start profile facts. Fixes supermemoryai#106
Tomauskasz
added a commit
to Tomauskasz/claude-supermemory
that referenced
this pull request
Sep 8, 2026
Context: Allow Claude's SessionStart and prompt hooks to consume shared Codex recall settings and apply them across the repository and configured custom containers. Changes: - Load optional shared settings before Claude-specific overrides and expose memory counts, context budgets, and automatic-container configuration. - Fan out profile requests, tolerate partial container failures, globally rank and deduplicate prompt matches, and merge profile facts. - Bound complete prompt and SessionStart contexts, retain prompt filtering and session deduplication, and mark only emitted memories as recalled. - Document the configuration precedence and add multi-container, budget, partial-failure, and profile-merge coverage. Impact: Claude can use the same maxMemories, maxProfileItems, maxRecallTokens, maxPromptRecallTokens, autoRecallContainers, and customContainers values as Codex. Existing defaults remain five memories, five profile items per section, a 2,500-token context budget, and disabled automatic custom-container recall. Validation: - npm test: 27 tests passed. - Node syntax checks passed for all changed hook modules. - git diff --staged --check passed. - npm run lint exited successfully; the repository Biome configuration processed only biome.json and reported a schema-version information message. Notes: Prompt recall still uses /v4/profile. Open PR supermemoryai#114 independently proposes /v3/search and may require conflict resolution before merge. Signed-off-by: Tomas <180413002+Tomauskasz@users.noreply.github.com>
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.
What
Per-prompt recall (
recall-directive.js) only consumed/v4/profile's embeddedsearchResults. On self-hosted backends that field is always empty even when the same query against/v3/searchreturns real hits — so the plugin looks connected and healthy but never injects recalled context.Confirmed in #106 via direct curl (local
v0.0.5andv0.0.8): profile search →total: 0;/v3/search→ matching documents/chunks.Session-start profile facts (
profile.static/profile.dynamic) are a separate concern and stay on/v4/profile.Fix
searchMemory()inplugin/hooks/lib/api.jsthat POSTs/v3/searchwith bothcontainerTagandcontainerTags(cloud uses singular; the/v4/profile's embeddedsearchResultsreturns empty against self-hosted backend even when/v3/searchfinds matching documents #106 repro used plural)score→similarity, flatten nestedchunks[]document hitsrecall-directive.jstosearchMemoryfor recall injectionTesting
Includes a new regression that stubs the #106 self-hosted response shape (
score+ nested chunks) and asserts/v3/searchis called and the nested texts are injected.Fixes #106