Skip to content

fix: recall via /v3/search so self-hosted backends inject matches - #114

Open
Divyansh151005 wants to merge 1 commit into
supermemoryai:mainfrom
Divyansh151005:fix/recall-via-v3-search
Open

Divyansh151005 wants to merge 1 commit into
supermemoryai:mainfrom
Divyansh151005:fix/recall-via-v3-search

Conversation

@Divyansh151005

@Divyansh151005 Divyansh151005 commented Aug 30, 2026

Copy link
Copy Markdown

What

Per-prompt recall (recall-directive.js) only consumed /v4/profile's embedded searchResults. On self-hosted backends that field is always empty even when the same query against /v3/search returns real hits — so the plugin looks connected and healthy but never injects recalled context.

Confirmed in #106 via direct curl (local v0.0.5 and v0.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

Testing

$ npm test
# tests 25
# pass 25
# fail 0

Includes a new regression that stubs the #106 self-hosted response shape (score + nested chunks) and asserts /v3/search is called and the nested texts are injected.

Fixes #106

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/v4/profile's embedded searchResults returns empty against self-hosted backend even when /v3/search finds matching documents

1 participant