compact

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package compact implements memory compaction — auto-summarize when the graph exceeds a token budget. Based on Engram and Letta approaches.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compactor

type Compactor struct {
	// contains filtered or unexported fields
}

Compactor summarizes old, low-confidence memories to keep the graph lean.

func New

func New(store *storage.Store, maxTokens int) *Compactor

func (*Compactor) Compact

func (c *Compactor) Compact(project string) (int, error)

Compact merges low-confidence, old memories of the same type into summary nodes. Returns the number of nodes compacted.

func (*Compactor) NeedsCompaction

func (c *Compactor) NeedsCompaction(project string) (bool, int)

NeedsCompaction returns true if total content exceeds the token budget.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL