Skip to content
Get started

Update a variation's memory layer assignment

$ cadenya agents:variations update-memory-layer
PATCH/v1/workspaces/{workspaceId}/agents/{agentId}/variations/{variationId}/memory_layer_assignments/{id}

Updates the position of a memory layer assignment on a variation.

ParametersExpand Collapse
--workspace-id: string

Workspace ID.

--agent-id: string

Agent ID. Accepts the canonical agent_… form or the external_id:<value> form.

--variation-id: string

Variation ID. Accepts the canonical av_… form or the external_id:<value> form.

--id: string
--position: optional number

New position. Only field currently updatable on an assignment.

ReturnsExpand Collapse
variation_memory_layer_assignment: object { id, memoryLayer, position }

VariationMemoryLayerAssignment attaches a single MemoryLayer to a variation at a given position in the variation’s baseline memory stack. A variation has at most one assignment per memory_layer_id.

Variations only support whole-layer attachments — entry pinning is an objective-level capability.

id: optional string

Assignment row id — handle for removing the assignment. Distinct from the referenced memory layer’s id.

memoryLayer: optional object { id, name }

BareMetadata contains the minimal metadata for a resource: the ID and an optional human-readable name. These are used for reference fields where the full metadata (account scoping, timestamps, labels, external IDs) is not needed — e.g., the tool references inside an agent variation spec or the tools assigned to an objective. Both fields are server-populated; clients provide IDs through sibling fields rather than by constructing a BareMetadata themselves.

id: optional string
name: optional string

Human-readable name of the referenced resource, populated by the server on reads for convenience. Absent on references to resources that do not have a name (e.g., objective tasks).

position: optional number

Position in the variation’s baseline stack. Lower values sit lower; the highest-position assignment is on top of the variation’s baseline. Gaps are fine — only relative position matters. Positions must be unique within a variation; a request that would collide with an existing assignment’s position is rejected with InvalidArgument.

Update a variation's memory layer assignment

cadenya agents:variations update-memory-layer \
  --api-key 'My API Key' \
  --workspace-id workspaceId \
  --agent-id agentId \
  --variation-id variationId \
  --id id
{
  "id": "id",
  "memoryLayer": {
    "id": "id",
    "name": "name"
  },
  "position": 0
}
Returns Examples
{
  "id": "id",
  "memoryLayer": {
    "id": "id",
    "name": "name"
  },
  "position": 0
}