anthropicmemory

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package anthropicmemory exposes Traceary's local backend for Anthropic's native beta memory tool.

Index

Constants

This section is empty.

Variables

View Source
var ToolName = string(anthropic.BetaMemoryTool20250818Param{}.Name.Default())

ToolName is the Anthropic built-in memory tool name.

View Source
var ToolVersion = string(anthropic.BetaMemoryTool20250818Param{}.Type.Default())

ToolVersion is the Anthropic memory-tool version Traceary implements.

Do not auto-bump this value when Anthropic ships a newer beta version. Review the command schema, return strings, and storage semantics manually before adding another handler version. The value is read from the SDK's generated constant type default so compile-time drift is visible when the SDK changes.

Functions

func DecodeInput

DecodeInput decodes a raw tool_use input payload into the pinned SDK command union. It is useful because response tool_use blocks expose Input as raw JSON.

func Tool

Tool returns the pinned Anthropic beta memory-tool definition.

Types

type Handler

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

Handler executes Anthropic memory-tool commands against Traceary storage.

func NewHandler

func NewHandler(memoryTool usecase.MemoryToolUsecase) (*Handler, error)

NewHandler wraps an existing MemoryToolUsecase.

func NewHandlerWithRepository

func NewHandlerWithRepository(repository model.MemoryToolFileRepository, clock types.Clock) (*Handler, error)

NewHandlerWithRepository creates a Handler from a memory-tool repository.

func NewSQLiteHandler

func NewSQLiteHandler(ctx context.Context, db *sqlite.Database) (*Handler, error)

NewSQLiteHandler creates a Handler backed by Traceary's SQLite store.

The caller owns Database construction, including the migration filesystem and DB path policy. This constructor initializes the store before wrapping the memory-tool datasource so fresh database files have the memory_tool_files table before the first command executes.

func (*Handler) Handle

Handle executes a BetaMemoryTool20250818 command and returns tool_result content suitable for anthropic.NewBetaToolResultTextBlockParam or BetaToolResultBlockParam.Content.

func (*Handler) HandleText

HandleText executes a BetaMemoryTool20250818 command and returns the raw text that should be sent back in a tool_result block.

func (*Handler) HandleToolUse

HandleToolUse executes a command and wraps its output as a complete tool_result block for the supplied tool_use ID.

Jump to

Keyboard shortcuts

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