Files
openclaw/extensions/memory-core/index.ts
2026-03-17 00:14:12 -07:00

35 lines
951 B
TypeScript

import { definePluginEntry } from "openclaw/plugin-sdk/core";
export default definePluginEntry({
id: "memory-core",
name: "Memory (Core)",
description: "File-backed memory search tools and CLI",
kind: "memory",
register(api) {
api.registerTool(
(ctx) => {
const memorySearchTool = api.runtime.tools.createMemorySearchTool({
config: ctx.config,
agentSessionKey: ctx.sessionKey,
});
const memoryGetTool = api.runtime.tools.createMemoryGetTool({
config: ctx.config,
agentSessionKey: ctx.sessionKey,
});
if (!memorySearchTool || !memoryGetTool) {
return null;
}
return [memorySearchTool, memoryGetTool];
},
{ names: ["memory_search", "memory_get"] },
);
api.registerCli(
({ program }) => {
api.runtime.tools.registerMemoryCli(program);
},
{ commands: ["memory"] },
);
},
});