Skip to main content
PATCH
JavaScript
Move an attached memory layer to a new position in the variation’s cascade. position is the only thing an assignment holds that you can change, so this is a one-field update.
The id in the path is the assignment’s own avml_... value, from the attach response or the variation’s info.memoryLayerAssignments, not the layer’s id. Read info.memoryLayerAssignments back and the new position is reflected there.

Why reposition instead of re-attach

You cannot attach the same layer twice, that is a 409. So when a layer sits in the wrong spot in the cascade, this is how you fix it: change its position rather than detaching and re-adding. Lower positions are more specific and win a shared key, so lowering a layer’s position promotes its version of any key it shares with another layer.

Attach a memory layer

Where the assignment and its position come from.

Remove the assignment

Detach the layer entirely.

Memory layers

How position resolves a key across the cascade.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspaceId
string
required

Workspace ID.

Example:

"workspace_01HXKD2E5NQM3T9AYWCF133E3Q"

agentId
string
required

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

Example:

"agent_01HXKD2E5NQM3T9AYWCFMGWT9Y"

variationId
string
required

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

Example:

"agentvar_01HXKD2E5NQM3T9AYWCF32BSPP"

id
string
required
Example:

"avml_01HXKD2E5NQM3T9AYWCFX8AF59"

Body

application/json

Update an existing memory layer assignment. Only position is mutable. A new position that collides with another assignment on the same variation is rejected with InvalidArgument.

position
integer<int32>

New position. Only field currently updatable on an assignment.

Response

OK

VariationMemoryLayerAssignment attaches a single MemoryLayer to a variation at a given position in the variation's baseline memory cascade. 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
string
read-only

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

Example:

"avml_01HXKD2E5NQM3T9AYWCFX8AF59"

memoryLayer
object

The attached memory layer.

position
integer<int32>

Position in the variation's baseline cascade. Position is specificity, CSS-style: a LOWER position is more specific and is consulted first; the highest-position assignment is the most general fallback. 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.