it’s slow because your memory index is trying to keep *session transcripts* embedded and up to date, and it’s doing it in a way that blocks the tool call.
i pulled your runtime + logs:
- your memory config is currently: `sources: ["memory","sessions"]` with `experimental.sessionMemory: true`
- `sync.onSearch: true` and `sync.watch: true`
- OpenAI *batch embeddings* are enabled with `wait: true`
- logs show it routinely kicking off giant session re-embedding batches, eg `source:"sessions", chunks:925`, then it sits there polling `in_progress; waiting 2000ms` over and over
- while that batch is running, `memory_search` waits for `sync()` to finish (because `onSearch` + dirty), so the tool call stalls, and you feel the lag
so the bottleneck isn’t the “search” query itself. it’s “oh shit, sessions changed, re-index everything, and wait for OpenAI batch to complete”.
how to make it fast (pick your poison):
1) *fastest / simplest:* stop indexing session transcripts
set memorySearch sources to just `["memory"]` and disable `experimental.sessionMemory`. this removes the constant churn.
2) keep sessions, but stop blocking on sync
- set `sync.onSearch: false` (so searches don’t force a sync)
- optionally keep `sync.onSessionStart: true` or set an `intervalMinutes` to refresh in background
3) keep sessions + batch, but don’t wait
set `remote.batch.wait: false` so sync can enqueue batches and return immediately. searches might be slightly stale until the batch finishes, but the tool call won’t hang.
if you tell me which approach you want, i can give you the exact config patch to apply. if you explicitly want me to apply it, i can do that too (but i’m not gonna touch your config without you saying the word).
it’s slow because your memory index is trying to keep *session transcripts* embedded and up to date, and it’s doing it in a way that blocks the tool call.
i pulled your runtime + logs:
- your memory config is currently: `sources: ["memory","sessions"]` with `experimental.sessionMemory: true`
- `sync.onSearch: true` and `sync.watch: true`
- OpenAI *batch embeddings* are enabled with `wait: true`
- logs show it routinely kicking off giant session re-embedding batches, eg `source:"sessions", chunks:925`, then it sits there polling `in_progress; waiting 2000ms` over and over
- while that batch is running, `memory_search` waits for `sync()` to finish (because `onSearch` + dirty), so the tool call stalls, and you feel the lag
so the bottleneck isn’t the “search” query itself. it’s “oh shit, sessions changed, re-index everything, and wait for OpenAI batch to complete”.
how to make it fast (pick your poison):
1) *fastest / simplest:* stop indexing session transcripts
set memorySearch sources to just `["memory"]` and disable `experimental.sessionMemory`. this removes the constant churn.
2) keep sessions, but stop blocking on sync
- set `sync.onSearch: false` (so searches don’t force a sync)
- optionally keep `sync.onSessionStart: true` or set an `intervalMinutes` to refresh in background
3) keep sessions + batch, but don’t wait
set `remote.batch.wait: false` so sync can enqueue batches and return immediately. searches might be slightly stale until the batch finishes, but the tool call won’t hang.
if you tell me which approach you want, i can give you the exact config patch to apply. if you explicitly want me to apply it, i can do that too (but i’m not gonna touch your config without you saying the word).