You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Describe the Bug
In `@cortexkit/pi-magic-context` (`src/features/magic-context/memory/verify.ts` / `dist/index.js`), the batch size for memory verification is hardcoded to `5`:
```javascriptvarVERIFY_BATCH_SIZE=5;
// ...for (let i =0; i <group.length; i +=VERIFY_BATCH_SIZE) {
batches.push(group.slice(i, i +VERIFY_BATCH_SIZE));
}
Diagnostics
### Impact & Evidence
When a project accumulates dozens or hundreds of memories requiring periodic verification:
1. Slicing candidates into batches of only 5 creates an unnecessarily high number of subagent invocations / LLM verification rounds.
2. The verification lifecycle takes disproportionately long (often 2x–3x the necessary runtime), consuming excessive turn latency and subagent coordination overhead.
In practice, modern models with structured output capabilities easily handle verifying 10–20 memories in a single prompt without quality degradation. Raising the batch size (e.g., to 10 or 15) cuts the number of verification rounds and total dreamer verification wall-clock time in half.
### Suggested Fix
Increase the default `VERIFY_BATCH_SIZE` to `10` (or make it configurable via user settings).
Thanks. This one was also part of #783, and we kept it then for a measured reason.
Verify's cost is mostly the tool calls it makes per memory, such as reading and searching the files a memory points to, not the per-batch prompt. A batch of 10 makes roughly the same file reads as two batches of 5, but in one child session with one time slice. When we measured verify, batches were already running into that slice at size 5. A timed-out batch loses every verdict in it, so a larger batch makes losing work more likely without cutting much total time. That's why 5 is set against the per-batch timeout rather than against model capacity.
If verify is slow on your project, real numbers would help us see where the time goes. Please share the verify lines from ~/.local/share/cortexkit/magic-context/logs/ for one run (duration, number of batches, any timeouts) and roughly how many memories the project has. If batches finish well inside their slice, there may be room to tune. If they time out, a smaller unit or the split-on-timeout approach from #809 is the better fix.
Activity
magic-alfonso commentedon Oct 29, 2026
Thanks. This one was also part of #783, and we kept it then for a measured reason.
Verify's cost is mostly the tool calls it makes per memory, such as reading and searching the files a memory points to, not the per-batch prompt. A batch of 10 makes roughly the same file reads as two batches of 5, but in one child session with one time slice. When we measured verify, batches were already running into that slice at size 5. A timed-out batch loses every verdict in it, so a larger batch makes losing work more likely without cutting much total time. That's why 5 is set against the per-batch timeout rather than against model capacity.
If verify is slow on your project, real numbers would help us see where the time goes. Please share the verify lines from
~/.local/share/cortexkit/magic-context/logs/for one run (duration, number of batches, any timeouts) and roughly how many memories the project has. If batches finish well inside their slice, there may be room to tune. If they time out, a smaller unit or the split-on-timeout approach from #809 is the better fix.