Skip to content

feat: expand automatic recall context - #51

Open
Tomauskasz wants to merge 2 commits into
supermemoryai:mainfrom
Tomauskasz:feat/expanded-auto-recall
Open

feat: expand automatic recall context#51
Tomauskasz wants to merge 2 commits into
supermemoryai:mainfrom
Tomauskasz:feat/expanded-auto-recall

Conversation

@Tomauskasz

Copy link
Copy Markdown

Summary

  • Add opt-in automatic recall for every tag in customContainers, including tags added later.
  • Apply maxMemories as one global, relevance-ranked, deduplicated cap across all searched containers.
  • Preserve the existing substantive-prompt filter and 500-character query cap.
  • Add whole-context budgets for prompt recall and session-start profiles while preserving complete wrappers and caching only emitted facts.
  • Set additionalContextLimit: 0 on the two bounded Supermemory hook handlers so Codex does not replace their context with spill previews.

Configuration

  • autoRecallContainers defaults to false.
  • customContainers defaults to [].
  • maxRecallTokens defaults to 2500.
  • maxPromptRecallTokens defaults to maxRecallTokens.
  • Existing maxMemories: 5 and maxProfileItems: 5 defaults remain unchanged.

Token budgets use the existing four-characters-per-token approximation. The change does not add a tokenizer dependency or per-container quotas.

Validation

  • npm run typecheck
  • npm test — 75 tests passed
  • git diff --staged --check

Context:
Add configurable whole-context recall budgets and opt-in custom-container searches so direct recall can return the configured global result count without exceeding hook context limits.

Changes:
- Add customContainers, autoRecallContainers, maxRecallTokens, and maxPromptRecallTokens configuration with backward-compatible defaults.
- Merge enabled custom tags into the existing read set and remove the independent five-result and 300-character recall caps.
- Format prompt and session context within complete wrapper-aware budgets, and return only emitted facts for session deduplication.
- Disable Codex additional-context spilling for the two bounded Supermemory hooks while preserving unrelated hook fields.
- Document the configuration and cover ranking, deduplication, tag selection, budgets, truncation, prompt policy, and installer output.

Impact:
Default installs retain five memories, five facts per profile section, a 2,500-token approximation, and custom-container recall disabled. Configured searches apply one global maxMemories limit across all read containers. Prompt and session output retain complete closing markup within their configured budgets.

Validation:
- npm run typecheck passed.
- npm test passed all 75 tests.
- git diff --staged --check passed.

Notes:
Token budgets use the existing four-characters-per-token approximation. No tokenizer dependency or package-version bump was added.

Signed-off-by: Tomas <180413002+Tomauskasz@users.noreply.github.com>
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.

1 participant