boundary

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: 3 Imported by: 0

Documentation

Overview

Package boundary implements semantic boundary detection for memory consolidation. Based on GAM (arxiv:2604.12285): consolidate only at semantic boundaries, not arbitrary session ends, to prevent transient noise contaminating long-term memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Detector

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

Detector detects semantic topic shifts in a stream of memory content.

func New

func New(maxBuffer int, threshold float64) *Detector

New creates a boundary detector. threshold: 0.0-1.0, higher = more sensitive to topic shifts (default 0.3)

func (*Detector) Add

func (d *Detector) Add(content string) bool

Add adds content to the buffer and returns true if a semantic boundary is detected. A boundary means: consolidate the current buffer into a topic node.

func (*Detector) Flush

func (d *Detector) Flush() []string

Flush returns and clears the current buffer.

func (*Detector) Size

func (d *Detector) Size() int

Size returns current buffer size.

Jump to

Keyboard shortcuts

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