Commit 3c7ee45
committed
feat: context re-injection with periodic and keyword triggers
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 }1 parent db96f73 commit 3c7ee45
2 files changed
Lines changed: 46 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
60 | 77 | | |
61 | 78 | | |
62 | 79 | | |
| |||
67 | 84 | | |
68 | 85 | | |
69 | 86 | | |
| 87 | + | |
| 88 | + | |
70 | 89 | | |
71 | 90 | | |
72 | 91 | | |
| |||
127 | 146 | | |
128 | 147 | | |
129 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
130 | 154 | | |
131 | 155 | | |
132 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
43 | | - | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
171 | 177 | | |
172 | 178 | | |
173 | 179 | | |
174 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
175 | 188 | | |
176 | | - | |
177 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
178 | 194 | | |
179 | 195 | | |
180 | 196 | | |
| |||
220 | 236 | | |
221 | 237 | | |
222 | 238 | | |
| 239 | + | |
223 | 240 | | |
224 | 241 | | |
225 | 242 | | |
| |||
540 | 557 | | |
541 | 558 | | |
542 | 559 | | |
| 560 | + | |
543 | 561 | | |
544 | 562 | | |
545 | 563 | | |
| |||
0 commit comments