Skip to content

agentdefinitions

Package github.com/emergent-company/emergent.memory/apps/server/pkg/sdk/agentdefinitions

The agentdefinitions client manages agent definitions — reusable configurations that store system prompts, model settings, and tools. Agent definitions are scoped to a project.

See also: agents for the runtime agents that use these definitions.

func (c *Client) List(ctx context.Context) (*APIResponse[[]AgentDefinitionSummary], error)
func (c *Client) Get(ctx context.Context, definitionID string) (*APIResponse[AgentDefinition], error)
func (c *Client) Create(ctx context.Context, req *CreateAgentDefinitionRequest) (*APIResponse[AgentDefinition], error)
func (c *Client) Update(ctx context.Context, definitionID string, req *UpdateAgentDefinitionRequest) (*APIResponse[AgentDefinition], error)
func (c *Client) Delete(ctx context.Context, definitionID string) error
type AgentDefinition struct {
ID string
ProductID *string
ProjectID string
Name string
Description *string
SystemPrompt *string
Model *ModelConfig
Tools []string
IsDefault bool
MaxSteps *int
DefaultTimeout *int
Visibility string
ACPConfig *ACPConfig
Config map[string]any
CreatedAt time.Time
UpdatedAt time.Time
}

Lightweight representation returned by List.

type AgentDefinitionSummary struct {
ID string
ProjectID string
Name string
Description *string
Visibility string
IsDefault bool
ToolCount int
CreatedAt time.Time
UpdatedAt time.Time
}
type ModelConfig struct {
Name string // Model name, e.g. "gemini-2.0-flash"
Temperature *float32
MaxTokens *int
}

Agent Card Protocol metadata, used when exposing the agent via ACP.

type ACPConfig struct {
DisplayName string
Description string
Capabilities []string
InputModes []string
OutputModes []string
}
type CreateAgentDefinitionRequest struct {
Name string
Description *string
SystemPrompt *string
Model *ModelConfig
Tools []string
IsDefault *bool
MaxSteps *int
DefaultTimeout *int
Visibility string
ACPConfig *ACPConfig
Config map[string]any
}

All fields are optional (pointer or omitempty).

type UpdateAgentDefinitionRequest struct {
Name *string
Description *string
SystemPrompt *string
Model *ModelConfig
Tools []string
IsDefault *bool
MaxSteps *int
DefaultTimeout *int
Visibility *string
ACPConfig *ACPConfig
Config map[string]any
}
type APIResponse[T any] struct {
Success bool
Data T
Error *string
Message *string
}
// Create an agent definition
resp, err := client.AgentDefinitions.Create(ctx, &agentdefinitions.CreateAgentDefinitionRequest{
Name: "Document Summarizer",
Description: strPtr("Summarizes new documents as they are ingested"),
SystemPrompt: strPtr("You are a summarization agent. For each document, produce a concise summary..."),
Model: &agentdefinitions.ModelConfig{
Name: "gemini-2.0-flash",
Temperature: float32Ptr(0.3),
MaxTokens: intPtr(1024),
},
Tools: []string{"read_document", "create_graph_object"},
})
fmt.Printf("Created definition: %s\n", resp.Data.ID)
// List definitions in the project
list, err := client.AgentDefinitions.List(ctx)
for _, def := range list.Data {
fmt.Printf("%s — tools: %d\n", def.Name, def.ToolCount)
}
// Update the system prompt
_, err = client.AgentDefinitions.Update(ctx, resp.Data.ID, &agentdefinitions.UpdateAgentDefinitionRequest{
SystemPrompt: strPtr("Updated prompt..."),
})