|
| 1 | +--- |
| 2 | +title: Memory |
| 3 | +description: Add memory store |
| 4 | +--- |
| 5 | + |
| 6 | +import { BlockInfoCard } from '@/components/ui/block-info-card' |
| 7 | + |
| 8 | +<BlockInfoCard |
| 9 | + type="memory" |
| 10 | + color="#F64F9E" |
| 11 | + icon={true} |
| 12 | + iconSvg={`<svg className="block-icon" |
| 13 | + |
| 14 | + xmlns="http://www.w3.org/2000/svg" |
| 15 | + |
| 16 | + |
| 17 | + viewBox="0 0 24 24" |
| 18 | + fill="none" |
| 19 | + stroke="currentColor" |
| 20 | + strokeWidth="2" |
| 21 | + strokeLinecap="round" |
| 22 | + strokeLinejoin="round" |
| 23 | + > |
| 24 | + <path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z" /> |
| 25 | + <path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z" /> |
| 26 | + <path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4" /> |
| 27 | + <path d="M17.599 6.5a3 3 0 0 0 .399-1.375" /> |
| 28 | + <path d="M6.003 5.125A3 3 0 0 0 6.401 6.5" /> |
| 29 | + <path d="M3.477 10.896a4 4 0 0 1 .585-.396" /> |
| 30 | + <path d="M19.938 10.5a4 4 0 0 1 .585.396" /> |
| 31 | + <path d="M6 18a4 4 0 0 1-1.967-.516" /> |
| 32 | + <path d="M19.967 17.484A4 4 0 0 1 18 18" /> |
| 33 | + </svg>`} |
| 34 | +/> |
| 35 | + |
| 36 | +## Usage Instructions |
| 37 | + |
| 38 | +Create persistent storage for data that needs to be accessed across multiple workflow steps. Store and retrieve information throughout your workflow execution to maintain context and state. |
| 39 | + |
| 40 | +## Tools |
| 41 | + |
| 42 | +### `memory_add` |
| 43 | + |
| 44 | +Add a new memory to the database or append to existing memory with the same ID. When appending to existing memory, the memory types must match. |
| 45 | + |
| 46 | +#### Input |
| 47 | + |
| 48 | +| Parameter | Type | Required | Description | |
| 49 | +| --------- | ------ | -------- | -------------------------------------------------------------------------------------------------------- | |
| 50 | +| `id` | string | Yes | Identifier for the memory. If a memory with this ID already exists, the new data will be appended to it. | |
| 51 | +| `type` | string | Yes | Type of memory \(agent or raw\) | |
| 52 | +| `role` | string | No | Role for agent memory \(user, assistant, or system\) | |
| 53 | +| `content` | string | No | Content for agent memory | |
| 54 | +| `rawData` | json | No | Raw data to store \(JSON format\) | |
| 55 | + |
| 56 | +#### Output |
| 57 | + |
| 58 | +| Parameter | Type | |
| 59 | +| ---------- | ------ | |
| 60 | +| `memories` | string | |
| 61 | + |
| 62 | +### `memory_get` |
| 63 | + |
| 64 | +Retrieve a specific memory by its ID |
| 65 | + |
| 66 | +#### Input |
| 67 | + |
| 68 | +| Parameter | Type | Required | Description | |
| 69 | +| --------- | ------ | -------- | ------------------------------------- | |
| 70 | +| `id` | string | Yes | Identifier for the memory to retrieve | |
| 71 | + |
| 72 | +#### Output |
| 73 | + |
| 74 | +| Parameter | Type | |
| 75 | +| ---------- | ------ | |
| 76 | +| `memories` | string | |
| 77 | +| `message` | string | |
| 78 | + |
| 79 | +### `memory_get_all` |
| 80 | + |
| 81 | +Retrieve all memories from the database |
| 82 | + |
| 83 | +#### Input |
| 84 | + |
| 85 | +| Parameter | Type | Required | Description | |
| 86 | +| --------- | ---- | -------- | ----------- | |
| 87 | + |
| 88 | +#### Output |
| 89 | + |
| 90 | +| Parameter | Type | |
| 91 | +| ---------- | ------ | |
| 92 | +| `message` | string | |
| 93 | +| `memories` | string | |
| 94 | + |
| 95 | +### `memory_delete` |
| 96 | + |
| 97 | +Delete a specific memory by its ID |
| 98 | + |
| 99 | +#### Input |
| 100 | + |
| 101 | +| Parameter | Type | Required | Description | |
| 102 | +| --------- | ------ | -------- | ----------------------------------- | |
| 103 | +| `id` | string | Yes | Identifier for the memory to delete | |
| 104 | + |
| 105 | +#### Output |
| 106 | + |
| 107 | +| Parameter | Type | |
| 108 | +| --------- | ------ | |
| 109 | +| `message` | string | |
| 110 | + |
| 111 | +## Block Configuration |
| 112 | + |
| 113 | +### Input |
| 114 | + |
| 115 | +| Parameter | Type | Required | Description | |
| 116 | +| ----------- | ------ | -------- | ----------- | |
| 117 | +| `operation` | string | Yes | Operation | |
| 118 | + |
| 119 | +### Outputs |
| 120 | + |
| 121 | +| Output | Type | Description | |
| 122 | +| ------------ | ------ | ------------------------ | |
| 123 | +| `response` | object | Output from response | |
| 124 | +| ↳ `memories` | any | memories of the response | |
| 125 | +| ↳ `id` | string | id of the response | |
| 126 | + |
| 127 | +## Notes |
| 128 | + |
| 129 | +- Category: `blocks` |
| 130 | +- Type: `memory` |
0 commit comments