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
- type Client
- func (c *Client) AddFeedback(ctx context.Context, vaultPath string, principal agentprotocol.Principal, ...) (string, error)
- func (c *Client) Approve(ctx context.Context, vaultPath, proposalID string, ...) (app.ApproveFacts, error)
- func (c *Client) Close() error
- func (c *Client) CompileContext(ctx context.Context, vaultPath string, principal agentprotocol.Principal, ...) (agentprotocol.ContextPack, error)
- func (c *Client) CreateHandoff(ctx context.Context, req HandoffRequest) (string, error)
- func (c *Client) Propose(ctx context.Context, vaultPath string, principal agentprotocol.Principal, ...) (app.AgentMemoryFacts, *agentprotocol.ProposalReview, error)
- func (c *Client) Recall(ctx context.Context, vaultPath string, scope agentprotocol.Scope, ...) ([]agentprotocol.MemoryRecord, error)
- func (c *Client) Version() string
- type HandoffRequest
Constants ¶
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 (*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) 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 ¶
CreateHandoff 创建一条 cross-agent handoff。
func (*Client) Propose ¶
func (c *Client) Propose(ctx context.Context, vaultPath string, principal agentprotocol.Principal, scope agentprotocol.Scope, kind agentprotocol.MemoryKind, subject, summary string, sources agentprotocol.SourceRefList) (app.AgentMemoryFacts, *agentprotocol.ProposalReview, error)
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。
type HandoffRequest ¶
type HandoffRequest struct {
VaultPath string
From agentprotocol.Principal
To agentprotocol.Principal
Scope agentprotocol.Scope
Objective string
Decisions []string
Blockers []string
}
HandoffRequest 是 CreateHandoff 的输入。