Core API

forget()

Delete memories by id or filter.

Signature

typescripttypescript
await ctx.forget(options: ForgetOptions): Promise<number>

Returns the number of deleted memories.

Delete by id

typescripttypescript
await ctx.forget({ id: memoryId });

Delete by filter

typescripttypescript
await ctx.forget({
  filter: { agent: "research" },
});