agentmemory

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package agentmemory 提供面向 embedded Go consumer 的 Agent memory runtime facade。

这是 experimental public API(schema v1),让消费方在不直接依赖 internal store 的情况下 编译 context、recall memory、提交 proposal、创建 handoff 和记录 feedback。 所有写操作默认走 proposal → review → approve 流程;不暴露 internal store 细节。

Index

Constants

View Source
const Experimental = "agent memory SDK is experimental (v1); API may evolve before stable-from"

Experimental 标记当前 SDK 为实验性 API。

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client 是 embedded consumer 使用的 Agent memory facade。 它包装 application service,不暴露 internal store。

func NewClient

func NewClient() *Client

NewClient 构造一个新 Client。

func (*Client) AddFeedback

func (c *Client) AddFeedback(ctx context.Context, vaultPath string, principal agentprotocol.Principal, scope agentprotocol.Scope, kind agentprotocol.FeedbackKind, memoryID, comment string) (string, error)

AddFeedback 记录一条 recall feedback。

func (*Client) Approve

func (c *Client) Approve(ctx context.Context, vaultPath, proposalID string, approver agentprotocol.Principal) (app.ApproveFacts, error)

Approve 批准一条 proposal(需要 owner principal)。

func (*Client) Close

func (c *Client) Close() error

Close 释放底层资源。

func (*Client) CompileContext

func (c *Client) CompileContext(ctx context.Context, vaultPath string, principal agentprotocol.Principal, scope agentprotocol.Scope, entities []string, maxItems, maxChars int) (agentprotocol.ContextPack, error)

CompileContext 编译 bounded context pack。

func (*Client) CreateHandoff

func (c *Client) CreateHandoff(ctx context.Context, req HandoffRequest) (string, error)

CreateHandoff 创建一条 cross-agent handoff。

func (*Client) Propose

Propose 提交一条 memory proposal。 Agent 默认只能 propose;返回 review 结论。

func (*Client) Recall

func (c *Client) Recall(ctx context.Context, vaultPath string, scope agentprotocol.Scope, kinds []agentprotocol.MemoryKind) ([]agentprotocol.MemoryRecord, error)

Recall 检索 bounded memories。

func (*Client) Version

func (c *Client) Version() string

Version 返回 SDK schema 版本。

type HandoffRequest

type HandoffRequest struct {
	VaultPath string
	From      agentprotocol.Principal
	To        agentprotocol.Principal
	Scope     agentprotocol.Scope
	Objective string
	Decisions []string
	Blockers  []string
}

HandoffRequest 是 CreateHandoff 的输入。

Jump to

Keyboard shortcuts

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