agentmemoryep

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentMemorySvcConfig

type AgentMemorySvcConfig struct {
	// AgentClient (required) is the agent-service gRPC client.
	AgentClient pb.AgentServiceClient
}

type CreateMemoryEndpoint

type CreateMemoryEndpoint struct{}

Saves a piece of information for agents to recall on future runs.

func (*CreateMemoryEndpoint) Materialize

type CreateMemoryRequest

type CreateMemoryRequest struct {
	// The kind of information this memory holds, used to group related memories.
	//
	// - `preference`: how someone likes things done, such as a customer who always wants express shipping.
	// - `fact`: a durable detail worth remembering about the account or one of its records, such as a customer's typical order size.
	// - `instruction`: standing guidance for agents to follow, such as always confirming freight before issuing an order.
	Category constants.AgentMemoryCategory `json:"category" validate:"required"`
	// The information to remember, written as plain text for an agent to read.
	Content string `json:"content" validate:"required"`
	// Arbitrary metadata as JSON.
	Metadata json.RawMessage `json:"metadata,omitzero"`
	// Type of platform record this memory is scoped to (e.g. `customer`, `product`).
	//
	// Provide together with `entity_id` to scope the memory to a specific record; omit both for a memory that is not tied to any particular record.
	EntityType field.Optional[string] `json:"entity_type,omitzero" validate:"omitempty,max=255"`
	// ID of the platform record this memory is scoped to.
	//
	// Provide together with `entity_type`.
	EntityID field.Optional[string] `json:"entity_id,omitzero" validate:"omitempty"`
	// Relative importance from `0` to `1` in increments of `0.1`, used to prioritize which memories the agent recalls.
	//
	// An agent takes in only a limited number of memories per run and recalls the highest-importance ones first, so a memory created without an importance is stored at `0` and is the first to be left out.
	Importance field.Optional[float64] `json:"importance,omitzero" validate:"omitempty,min=0,max=1,multiple_of=0.1"`
	// When this memory should stop being used, as an ISO 8601 timestamp (e.g. `2026-01-02T15:04:05Z`).
	//
	// Past this time the memory is no longer recalled by agents and is omitted from list results, but it is not deleted. Omit it for a memory that should be used indefinitely.
	ExpiresAt field.Optional[string] `json:"expires_at,omitzero"`
}

Request to create an agent memory.

func (*CreateMemoryRequest) SchemaExample

func (*CreateMemoryRequest) SchemaExample() any

type DeleteMemoryEndpoint

type DeleteMemoryEndpoint struct{}

Permanently deletes an agent memory so it is no longer recalled.

Deleting a memory that has already been deleted succeeds rather than returning an error.

func (*DeleteMemoryEndpoint) Materialize

type DeleteMemoryRequest

type DeleteMemoryRequest struct {
	// Memory ID.
	ID string `path:"id" validate:"required"`
}

Request to delete an agent memory.

type ListMemoriesEndpoint

type ListMemoriesEndpoint struct{}

Returns a paginated list of agent memories for the current account, newest first.

Memories whose `expires_at` has passed are excluded. The `q` search term matches against a memory's ID, category, content, and the ID of the record it is scoped to.

type ListMemoriesRequest

type ListMemoriesRequest struct {
	apiresource.PaginationRequest
	// Filter to memories with this exact category (e.g. `preference`, `fact`).
	Category *constants.AgentMemoryCategory `query:"category"`
	// Filter to memories scoped to this entity type (e.g. `customer`, `product`).
	EntityType *string `query:"entity_type"`
}

Request to list agent memories.

func (*ListMemoriesRequest) SchemaExample

func (*ListMemoriesRequest) SchemaExample() any

type RetrieveMemoryEndpoint

type RetrieveMemoryEndpoint struct{}

Returns an agent memory by ID.

An expired memory is still returned here, even though it is excluded from list results and no longer recalled by agents.

func (*RetrieveMemoryEndpoint) Materialize

type RetrieveMemoryRequest

type RetrieveMemoryRequest struct {
	// Memory ID.
	ID string `path:"id" validate:"required"`
}

Request to retrieve an agent memory.

type UpdateMemoryEndpoint

type UpdateMemoryEndpoint struct{}

Updates an agent memory.

Only the fields included in the request are changed; everything else keeps its current value.

func (*UpdateMemoryEndpoint) Materialize

type UpdateMemoryRequest

type UpdateMemoryRequest struct {
	// Memory ID.
	ID string `path:"id" validate:"required"`
	// The kind of information this memory holds, used to group related memories.
	//
	// - `preference`: how someone likes things done, such as a customer who always wants express shipping.
	// - `fact`: a durable detail worth remembering about the account or one of its records, such as a customer's typical order size.
	// - `instruction`: standing guidance for agents to follow, such as always confirming freight before issuing an order.
	Category field.Optional[constants.AgentMemoryCategory] `json:"category,omitzero"`
	// The information to remember, written as plain text for an agent to read.
	Content field.Optional[string] `json:"content,omitzero"`
	// Arbitrary metadata as JSON.
	//
	// Replaces the stored metadata outright rather than merging into it.
	Metadata json.RawMessage `json:"metadata,omitzero"`
	// Type of platform record this memory is scoped to (e.g. `customer`, `product`).
	//
	// Provide together with `entity_id` to scope the memory to a specific record; send `null` (on either entity field) to unscope the memory.
	EntityType field.Clearable[string] `json:"entity_type,omitzero" validate:"omitempty,max=255"`
	// ID of the platform record this memory is scoped to.
	//
	// Provide together with `entity_type`; send `null` to unscope the memory.
	EntityID field.Clearable[string] `json:"entity_id,omitzero" validate:"omitempty"`
	// Relative importance from `0` to `1` in increments of `0.1`, used to prioritize which memories the agent recalls.
	//
	// An agent takes in only a limited number of memories per run and recalls the highest-importance ones first.
	Importance field.Optional[float64] `json:"importance,omitzero" validate:"omitempty,min=0,max=1,multiple_of=0.1"`
	// When this memory should stop being used, as an ISO 8601 timestamp (e.g. `2026-01-02T15:04:05Z`).
	//
	// Past this time the memory is no longer recalled by agents and is omitted from list results, but it is not deleted. Send `null` so the memory is used indefinitely.
	ExpiresAt field.Clearable[string] `json:"expires_at,omitzero"`
}

Request to update an agent memory.

func (*UpdateMemoryRequest) SchemaExample

func (*UpdateMemoryRequest) SchemaExample() any

Jump to

Keyboard shortcuts

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