]> git.giacomolli.uk - onechat/commit
Build the summary nodes with a model
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 17:56:02 +0000 (14:56 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 17:56:02 +0000 (14:56 -0300)
commit30fbeb13a74942c6d515cc2a51eab7407a78c325
treee1bc7efb487ca27bd4daf16bc6d32bda90b373f7
parent1e0b100b2d3d4af9f65daae7ede647ac9c388157
Build the summary nodes with a model

The compactor is the Summarizer of the memory core. Each build is a call
like a turn, with the same system prompt, tools, and cache key, so it
reads the prompt cache of the turns and never calls a tool. The input is
one user message with the compaction view up to the node and the task:
the leaf or merge text of the reference design with the 512-dash ruler.

A line over 512 bytes gets another try with the same view and task plus
only the newest note, which gives its size and its cut at the limit. The
model's earlier reply and reasoning never go back, so each try has the
same cached prefix and about the same size. After at most five tries the
shortest line is the node. A call that fails before any line fails the
build, and the core tries it again at the next message. The model and
effort come from the compactor settings of config.json.

Issue: b14d537
compactor.go [new file with mode: 0644]
compactor_test.go [new file with mode: 0644]