memory

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

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

Memory provides the agentic memory lifecycle: read, recall, and write. It wraps an MCP client that connects to the ogden memory server.

func New

func New(client *mcp.Client) *Memory

New creates a Memory wrapper. If client is nil or doesn't have memory tools, memory is disabled and all methods gracefully degrade.

func (*Memory) Enabled

func (m *Memory) Enabled() bool

Enabled returns whether agentic memory is active.

func (*Memory) ReadMemory

func (m *Memory) ReadMemory(ctx context.Context, sessionID string) string

ReadMemory fetches the session knowledge graph as text via memory_graph. Returns empty string on failure (graceful degradation).

func (*Memory) RecallMemory

func (m *Memory) RecallMemory(ctx context.Context, sessionID, question string) string

RecallMemory performs semantic recall for a specific question via memory_recall. Returns empty string on failure (graceful degradation).

func (*Memory) WriteMemory

func (m *Memory) WriteMemory(ctx context.Context, sessionID, question, response string)

WriteMemory persists a conversation turn via memory_add. Runs in the background — errors are logged but not returned.

Jump to

Keyboard shortcuts

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