Help us shape the future of Go! Take the 2026 Go Developer Survey

memory

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package memory provides message memory implementations.

Memory is session-scoped. The default Agent pipeline uses memory only when a MemoryProvider is configured and the request includes a SessionID. It loads memory before appending the current user input, loads at most once per run, and saves only after a successful final answer.

WindowMemory is an in-process bounded session store. It is safe for concurrent use, drops older messages past its limit, and does not survive process restart. Summarization, compaction, vector retrieval, and durable storage are extension concerns, not core memory behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider = ports.MemoryProvider

type WindowMemory

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

func NewWindowMemory

func NewWindowMemory(limit int) *WindowMemory

func (*WindowMemory) Load

func (m *WindowMemory) Load(ctx context.Context, sessionID string) ([]ports.MemoryMessage, error)

func (*WindowMemory) Save

func (m *WindowMemory) Save(ctx context.Context, sessionID string, messages []ports.MemoryMessage) error

Jump to

Keyboard shortcuts

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