You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -10,100 +10,94 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
10
10
color="#F64F9E"
11
11
/>
12
12
13
-
## Usage Instructions
14
-
15
-
Integrate Memory into the workflow. Can add, get a memory, get all memories, and delete memories.
13
+
## Overview
16
14
15
+
The Memory block stores conversation history for agents. Each memory is identified by a `conversationId` that you provide. Multiple agents can share the same memory by using the same `conversationId`.
17
16
17
+
Memory stores only user and assistant messages. System messages are not stored—they are configured in the Agent block and prefixed at runtime.
18
18
19
19
## Tools
20
20
21
21
### `memory_add`
22
22
23
-
Add a new memory to the database or append to existing memory with the same ID.
23
+
Add a message to memory. Creates a new memory if the `conversationId` doesn't exist, or appends to existing memory.
24
24
25
25
#### Input
26
26
27
27
| Parameter | Type | Required | Description |
28
28
| --------- | ---- | -------- | ----------- |
29
-
|`conversationId`| string | No | Conversation identifier \(e.g., user-123, session-abc\). If a memory with this conversationId already exists for this block, the new message will be appended to it. |
30
-
|`id`| string | No | Legacy parameter for conversation identifier. Use conversationId instead. Provided for backwards compatibility. |
31
-
|`role`| string | Yes | Role for agent memory \(user, assistant, or system\)|
32
-
|`content`| string | Yes | Content for agent memory |
33
-
|`blockId`| string | No | Optional block ID. If not provided, uses the current block ID from execution context, or defaults to "default". |
29
+
|`conversationId`| string | Yes | Unique identifier for the conversation (e.g., `user-123`, `session-abc`) |
30
+
|`role`| string | Yes | Message role: `user` or `assistant`|
31
+
|`content`| string | Yes | Message content |
34
32
35
33
#### Output
36
34
37
35
| Parameter | Type | Description |
38
36
| --------- | ---- | ----------- |
39
-
|`success`| boolean | Whether the memory was added successfully|
40
-
|`memories`| array |Array of memory objects including the new or updated memory|
41
-
|`error`| string | Error message if operation failed |
37
+
|`success`| boolean | Whether the operation succeeded|
38
+
|`memories`| array |Updated memory array|
39
+
|`error`| string | Error message if failed |
42
40
43
41
### `memory_get`
44
42
45
-
Retrieve memory by conversationId, blockId, blockName, or a combination. Returns all matching memories.
43
+
Retrieve memory by conversation ID.
46
44
47
45
#### Input
48
46
49
47
| Parameter | Type | Required | Description |
50
48
| --------- | ---- | -------- | ----------- |
51
-
|`conversationId`| string | No | Conversation identifier \(e.g., user-123, session-abc\). If provided alone, returns all memories for this conversation across all blocks. |
52
-
|`id`| string | No | Legacy parameter for conversation identifier. Use conversationId instead. Provided for backwards compatibility. |
53
-
|`blockId`| string | No | Block identifier. If provided alone, returns all memories for this block across all conversations. If provided with conversationId, returns memories for that specific conversation in this block. |
54
-
|`blockName`| string | No | Block name. Alternative to blockId. If provided alone, returns all memories for blocks with this name. If provided with conversationId, returns memories for that conversation in blocks with this name. |
|`success`| boolean | Whether the memory was retrieved successfully |
61
-
|`memories`| array | Array of memory objects with conversationId, blockId, blockName, and data fields |
62
-
|`message`| string | Success or error message |
63
-
|`error`| string | Error message if operation failed |
55
+
|`success`| boolean | Whether the operation succeeded |
56
+
|`memories`| array | Array of messages with `role` and `content`|
57
+
|`error`| string | Error message if failed |
64
58
65
59
### `memory_get_all`
66
60
67
-
Retrieve all memories from the database
68
-
69
-
#### Input
70
-
71
-
| Parameter | Type | Required | Description |
72
-
| --------- | ---- | -------- | ----------- |
61
+
Retrieve all memories for the current workspace.
73
62
74
63
#### Output
75
64
76
65
| Parameter | Type | Description |
77
66
| --------- | ---- | ----------- |
78
-
|`success`| boolean | Whether all memories were retrieved successfully |
79
-
|`memories`| array | Array of all memory objects with key, conversationId, blockId, blockName, and data fields |
80
-
|`message`| string | Success or error message |
81
-
|`error`| string | Error message if operation failed |
67
+
|`success`| boolean | Whether the operation succeeded |
68
+
|`memories`| array | All memory objects with `conversationId` and `data` fields |
69
+
|`error`| string | Error message if failed |
82
70
83
71
### `memory_delete`
84
72
85
-
Delete memories by conversationId, blockId, blockName, or a combination. Supports bulk deletion.
73
+
Delete memory by conversation ID.
86
74
87
75
#### Input
88
76
89
77
| Parameter | Type | Required | Description |
90
78
| --------- | ---- | -------- | ----------- |
91
-
|`conversationId`| string | No | Conversation identifier \(e.g., user-123, session-abc\). If provided alone, deletes all memories for this conversation across all blocks. |
92
-
|`id`| string | No | Legacy parameter for conversation identifier. Use conversationId instead. Provided for backwards compatibility. |
93
-
|`blockId`| string | No | Block identifier. If provided alone, deletes all memories for this block across all conversations. If provided with conversationId, deletes memories for that specific conversation in this block. |
94
-
|`blockName`| string | No | Block name. Alternative to blockId. If provided alone, deletes all memories for blocks with this name. If provided with conversationId, deletes memories for that conversation in blocks with this name. |
79
+
|`conversationId`| string | Yes | Conversation identifier to delete |
95
80
96
81
#### Output
97
82
98
83
| Parameter | Type | Description |
99
84
| --------- | ---- | ----------- |
100
-
|`success`| boolean | Whether the memory was deleted successfully |
101
-
|`message`| string | Success or error message |
102
-
|`error`| string | Error message if operation failed |
85
+
|`success`| boolean | Whether the operation succeeded |
86
+
|`message`| string | Confirmation message |
87
+
|`error`| string | Error message if failed |
88
+
89
+
## Agent Memory Types
103
90
91
+
When using memory with an Agent block, you can configure how conversation history is managed:
104
92
93
+
| Type | Description |
94
+
| ---- | ----------- |
95
+
|**Full Conversation**| Stores all messages, limited by model's context window (uses 90% to leave room for response) |
96
+
|**Sliding Window (Messages)**| Keeps the last N messages (default: 10) |
97
+
|**Sliding Window (Tokens)**| Keeps messages that fit within a token limit (default: 4000) |
105
98
106
99
## Notes
107
100
108
-
- Category: `blocks`
109
-
- Type: `memory`
101
+
- Memory is scoped per workspace—workflows in the same workspace share the memory store
102
+
- Use unique `conversationId` values to keep conversations separate (e.g., session IDs, user IDs, or UUIDs)
103
+
- System messages belong in the Agent block configuration, not in memory
0 commit comments