feat: speed up memory batch indexing

This commit is contained in:
Peter Steinberger
2026-01-18 01:24:16 +00:00
parent f73dbdbaea
commit 8b1bec11d0
11 changed files with 103 additions and 5 deletions

View File

@@ -81,6 +81,7 @@ describe("memory search config", () => {
expect(resolved?.remote?.batch).toEqual({
enabled: true,
wait: true,
concurrency: 2,
pollIntervalMs: 5000,
timeoutMinutes: 60,
});
@@ -133,6 +134,7 @@ describe("memory search config", () => {
batch: {
enabled: true,
wait: true,
concurrency: 2,
pollIntervalMs: 5000,
timeoutMinutes: 60,
},

View File

@@ -17,6 +17,7 @@ export type ResolvedMemorySearchConfig = {
batch?: {
enabled: boolean;
wait: boolean;
concurrency: number;
pollIntervalMs: number;
timeoutMinutes: number;
};
@@ -99,6 +100,10 @@ function mergeConfig(
const batch = {
enabled: overrides?.remote?.batch?.enabled ?? defaults?.remote?.batch?.enabled ?? true,
wait: overrides?.remote?.batch?.wait ?? defaults?.remote?.batch?.wait ?? true,
concurrency: Math.max(
1,
overrides?.remote?.batch?.concurrency ?? defaults?.remote?.batch?.concurrency ?? 2,
),
pollIntervalMs:
overrides?.remote?.batch?.pollIntervalMs ?? defaults?.remote?.batch?.pollIntervalMs ?? 5000,
timeoutMinutes: