MCPcopy Create free account
hub / github.com/diillson/chatcli / forgetMemoryFact

Method forgetMemoryFact

cli/memory_command.go:303–317  ·  view source on GitHub ↗

forgetMemoryFact removes facts matching a substring via /memory forget.

(rest string)

Source from the content-addressed store, hash-verified

301
302// forgetMemoryFact removes facts matching a substring via /memory forget.
303func (cli *ChatCLI) forgetMemoryFact(rest string) {
304 if rest == "" {
305 fmt.Println(colorize(" "+i18n.T("mem.cmd.forget.usage"), ColorGray))
306 return
307 }
308 n := cli.memoryStore.ForgetFacts(rest)
309 if cli.contextBuilder != nil {
310 cli.contextBuilder.InvalidateCache()
311 }
312 if n > 0 {
313 fmt.Printf(" %s %s\n", colorize("OK", ColorGreen), i18n.T("mem.cmd.forget.removed", n))
314 } else {
315 fmt.Printf(" %s %s\n", colorize("!", ColorYellow), i18n.T("mem.cmd.forget.none"))
316 }
317}
318
319// setMemoryProfile applies a "key=value" (or "key: value") profile update
320// via /memory profile set.

Callers 1

handleMemoryCommandMethod · 0.95

Calls 4

TFunction · 0.92
colorizeFunction · 0.85
ForgetFactsMethod · 0.45
InvalidateCacheMethod · 0.45

Tested by

no test coverage detected