Skip to content

feat: context re-injection with periodic and keyword triggers#3

Merged
kandotrun merged 1 commit intomainfrom
feat/context-reinjection
Mar 19, 2026
Merged

feat: context re-injection with periodic and keyword triggers#3
kandotrun merged 1 commit intomainfrom
feat/context-reinjection

Conversation

@kandotrun
Copy link
Owner

Problem

Previously, supermemory context was only injected on the first message of a session. Topic changes mid-session lost relevant memory context.

Changes

Periodic re-injection

New config option reinjectEveryN (default: 0 = first only). Set to e.g. 10 to re-inject context every 10 messages.

Recall keyword triggers

New keyword patterns that trigger immediate context re-injection:

English: recall, what do you remember, check memory, search memory
Japanese: 思い出して, 記憶を検索, メモリ確認, 何か覚えてる

Configurable via recallKeywordPatterns in supermemory.jsonc.

Implementation

  • Replace boolean injectedSessions Set with per-session message counter
  • Inject context when: first message OR recall keyword OR periodic interval
  • Clean up session state on session.deleted

Config example

// ~/.config/opencode/supermemory.jsonc
{
  "reinjectEveryN": 10,
  "recallKeywordPatterns": ["my custom pattern"]
}

Dependencies

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

Warning

Rate limit exceeded

@kandotrun has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 48 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dc001fab-c900-4e95-837d-34f41a7f5c07

📥 Commits

Reviewing files that changed from the base of the PR and between db96f73 and 3c7ee45.

📒 Files selected for processing (2)
  • src/config.ts
  • src/index.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/context-reinjection
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Previously, supermemory context was only injected on the first message
of a session. This meant topic changes mid-session lost relevant
memory context.

Changes:
- Add reinjectEveryN config (default 0 = first only)
  Set to e.g. 10 to re-inject context every 10 messages
- Add recall keyword patterns (English + Japanese)
  'recall', '思い出して', 'メモリ確認' etc. trigger immediate
  context re-injection on that message
- Clean up session state on session.deleted
- Track per-session message counts instead of boolean set

Config example (supermemory.jsonc):
  { "reinjectEveryN": 10 }
@kandotrun kandotrun self-assigned this Mar 19, 2026
@kandotrun kandotrun force-pushed the feat/context-reinjection branch from 07e3d24 to 3c7ee45 Compare March 19, 2026 02:23
@kandotrun kandotrun merged commit e860c45 into main Mar 19, 2026
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