feat: expand automatic recall context - #51
Open
Tomauskasz wants to merge 2 commits into
Open
Conversation
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>
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
customContainers, including tags added later.maxMemoriesas one global, relevance-ranked, deduplicated cap across all searched containers.additionalContextLimit: 0on the two bounded Supermemory hook handlers so Codex does not replace their context with spill previews.Configuration
autoRecallContainersdefaults tofalse.customContainersdefaults to[].maxRecallTokensdefaults to2500.maxPromptRecallTokensdefaults tomaxRecallTokens.maxMemories: 5andmaxProfileItems: 5defaults 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 typechecknpm test— 75 tests passedgit diff --staged --check