Skip to main content
Perform actions on an agent node’s context memory. Supports summarize, trim, clear, and export.

Actions Overview

ActionDescription
summarizeCompress older messages into an LLM-generated summary, keeping recent messages intact.
trimDrop the oldest messages to bring the count under a limit.
clearRemove all messages from the memory instance.
exportReturn all messages without modifying them.

Summarize

Replaces older messages with a concise LLM-generated summary. The agent node’s configured LLM provider and model are used for summarization.
curl -X POST "https://app.splox.io/api/v1/chat-memory/AGENT_NODE_ID/actions" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "summarize",
    "context_memory_id": "SESSION_ID",
    "workflow_version_id": "VERSION_ID",
    "keep_last_n": 5
  }'

Summarize Parameters

ParameterTypeRequiredDescription
actionstringMust be "summarize".
context_memory_idstringThe context memory ID (resolved chat/session ID).
workflow_version_idstring (uuid)The workflow version ID.
keep_last_nintegerKeep this many recent messages; summarize the rest. Defaults to keeping the last 2.
summarize_promptstringCustom summarization prompt. Falls back to the agent’s configured prompt.

Trim

Removes the oldest messages to bring the total count under the specified limit.
result = client.memory.trim(
    "AGENT_NODE_ID",
    context_memory_id="SESSION_ID",
    workflow_version_id="VERSION_ID",
    max_messages=20,
)
print(f"Trimmed {result.deleted_count}, {result.remaining_count} remaining")

Trim Parameters

ParameterTypeRequiredDescription
actionstringMust be "trim".
context_memory_idstringThe context memory ID.
workflow_version_idstring (uuid)The workflow version ID.
max_messagesintegerMaximum messages to keep (default 10).

Clear

Removes all messages from the memory instance and resets the context window size to 0.
result = client.memory.clear(
    "AGENT_NODE_ID",
    context_memory_id="SESSION_ID",
    workflow_version_id="VERSION_ID",
)
print(f"Cleared {result.deleted_count} messages")

Export

Returns all memory messages without modifying them.
result = client.memory.export(
    "AGENT_NODE_ID",
    context_memory_id="SESSION_ID",
    workflow_version_id="VERSION_ID",
)
for msg in result.messages:
    print(f"[{msg.role}] {msg.content}")

Response

All actions return the same response shape:
{
  "action": "summarize",
  "message": "Memory summarized successfully",
  "deleted_count": 18,
  "summary": "[Previous Conversation Summary]\nThe user asked about...",
  "remaining_count": 6,
  "messages": null
}
FieldTypeDescription
actionstringThe action that was performed.
messagestringHuman-readable status message.
deleted_countintegerNumber of messages removed.
summarystringThe generated summary text (only for summarize).
messagesarrayFull message list (only for export).
remaining_countintegerMessages remaining after the action.