memory

package
v1.87.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package memory provides the memory_manage and memory_capture MCP tools. Recall (reading memory back) is served by the unified search tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RecallChecker added in v1.87.0

type RecallChecker interface {
	ExistingMatch(ctx context.Context, q RecallQuery) (id string, score float64, err error)
}

RecallChecker finds an existing record a new capture restates, so the write path can supersede instead of appending (recall-first, #633). Implemented by the platform over the memory store; declared here so this package does not import pkg/knowledge.

type RecallQuery added in v1.87.0

type RecallQuery struct {
	Embedding   []float32
	EntityURNs  []string
	CallerEmail string
	MinScore    float64
}

RecallQuery is the recall-first lookup: the precomputed embedding of the candidate content, the entities it concerns, and the caller's email, plus the cosine threshold above which a prior record counts as a restatement. Embedding is empty when no embedder is configured; in that case recall is skipped (no reliable similarity, so the capture simply appends).

type ThreadLinker added in v1.87.0

type ThreadLinker interface {
	LinkInsight(ctx context.Context, threadIDs []string, insightID, actorID, actorEmail string) ([]string, error)
}

ThreadLinker bridges a reviewed capture back to the feedback thread(s) it resolves (#602). Satisfied by the portal thread store; a minimal interface so the memory toolkit does not depend on the portal package.

type Toolkit

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

Toolkit implements the memory management toolkit. Recall is handled by the unified search tool (#632); this toolkit owns only the memory_manage write path.

func New

func New(name string, store memstore.Store, embedder embedding.Provider) (*Toolkit, error)

New creates a new memory toolkit.

func (*Toolkit) Close

func (*Toolkit) Close() error

Close releases resources.

func (*Toolkit) Connection

func (*Toolkit) Connection() string

Connection returns the connection name for audit logging.

func (*Toolkit) Kind

func (*Toolkit) Kind() string

Kind returns the toolkit kind.

func (*Toolkit) Name

func (t *Toolkit) Name() string

Name returns the toolkit instance name.

func (*Toolkit) RegisterTools

func (t *Toolkit) RegisterTools(s *mcp.Server)

RegisterTools registers memory_manage with the MCP server. Recall moved to the unified search tool (#632).

func (*Toolkit) SetQueryProvider

func (*Toolkit) SetQueryProvider(_ query.Provider)

SetQueryProvider is a no-op; memory toolkit does not use query execution.

func (*Toolkit) SetRecallChecker added in v1.87.0

func (t *Toolkit) SetRecallChecker(rc RecallChecker)

SetRecallChecker wires the recall-first checker.

func (*Toolkit) SetSemanticProvider

func (*Toolkit) SetSemanticProvider(_ semantic.Provider)

SetSemanticProvider is a no-op: recall (which used lineage) moved to search, so the memory toolkit no longer needs the semantic provider.

func (*Toolkit) SetThreadLinker added in v1.87.0

func (t *Toolkit) SetThreadLinker(tl ThreadLinker)

SetThreadLinker wires the feedback-thread bridge.

func (*Toolkit) Tools

func (*Toolkit) Tools() []string

Tools returns the list of tool names.

Jump to

Keyboard shortcuts

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