memory

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package memory is an in-process, non-persistent reference implementation of agentkit.HistoryStore. It is intended for tests, development, and persistence-free one-shot runs. All state lives in memory guarded by a single mutex, and every value crossing the boundary is deep-copied via (*gollem.History).Clone so neither side can reach the other's storage.

Versions are immutable, as the port requires: Save always mints a fresh ref and never touches a version it handed out earlier. Discard removes one immediately — there is no reclamation to defer to in an in-memory map.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is the in-memory agentkit.HistoryStore.

func New

func New() *Store

New returns an empty in-memory Store.

func (*Store) Discard

func (s *Store) Discard(ctx context.Context, pid agentkit.ProcessID, ref agentkit.HistoryRef)

Discard drops the version. An unknown or already-discarded ref is not a failure, per the port contract.

func (*Store) Load

Load returns a clone of the version named by ref, or ErrHistoryVersionMissing when it is not there — a referenced version that is gone is data loss, not an empty conversation.

func (*Store) Save

Save stores a clone of h under a fresh ref and returns it. The ref is a UUIDv7 so refs sort by creation time, which the port prefers; nothing depends on it.

Jump to

Keyboard shortcuts

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