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 ¶
- type Store
- func (s *Store) Discard(ctx context.Context, pid agentkit.ProcessID, ref agentkit.HistoryRef)
- func (s *Store) Load(ctx context.Context, pid agentkit.ProcessID, ref agentkit.HistoryRef) (*gollem.History, error)
- func (s *Store) Save(ctx context.Context, pid agentkit.ProcessID, h *gollem.History) (agentkit.HistoryRef, error)
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 (*Store) Discard ¶
Discard drops the version. An unknown or already-discarded ref is not a failure, per the port contract.
func (*Store) Load ¶
func (s *Store) Load(ctx context.Context, pid agentkit.ProcessID, ref agentkit.HistoryRef) (*gollem.History, error)
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.