refactor: move memory engine into memory plugin

This commit is contained in:
Peter Steinberger
2026-03-26 23:19:18 +00:00
parent 0e182dd3e1
commit cad83db8b2
42 changed files with 302 additions and 179 deletions

View File

@@ -26,3 +26,8 @@ export async function getActiveMemorySearchManager(params: {
export function resolveActiveMemoryBackendConfig(params: { cfg: OpenClawConfig; agentId: string }) {
return ensureMemoryRuntime(params.cfg)?.resolveMemoryBackendConfig(params) ?? null;
}
export async function closeActiveMemorySearchManagers(cfg?: OpenClawConfig): Promise<void> {
const runtime = ensureMemoryRuntime(cfg);
await runtime?.closeAllMemorySearchManagers?.();
}

View File

@@ -56,6 +56,7 @@ export type MemoryPluginRuntime = {
cfg: OpenClawConfig;
agentId: string;
}): MemoryRuntimeBackendConfig;
closeAllMemorySearchManagers?(): Promise<void>;
};
type MemoryPluginState = {