Memory Write Component
Use the Memory Write component to save a single key–value pair under a named memory. This allows you to persist information across agent workflows or hold temporary data during execution.
Why this matters
What you need to know
- memory_name is the namespace. Read and delete operations must use the same name.
- key identifies the value.
- value is any JSON serializable data.
- scope controls how long the value lives. Choose Request or TTL.
Important
Step 1: Configure Memory Name
Every memory operation requires a Memory Name. This groups related keys together and prevents clashes between different workflows.
Setting | Required? | Description |
---|---|---|
Memory Name | Yes | The namespace or group under which keys are stored. |
Important
Step 2: Define Key and Value
Provide the key to identify the data and the value you want to store.
You can hard code values or map them dynamically from workflow inputs or previous components.
Field | Required? | Description | Example |
---|---|---|---|
Key | Yes | Identifier for the value. | user-id |
Value | Yes | The content to store. | 12345 |
Example
{{
"key": "user-id",
"value": 12345
}}
Dynamic inputs
Step 3: Choose Scope
Memory writes can be scoped as:
Scope | Lifetime | Accessible from other workflows | Use cases |
---|---|---|---|
Request | Only during the current execution | No | One run secrets, ephemeral session IDs, intermediate calculations |
TTL | Until the selected TTL expires | Yes, as long as you use the same memory_name | Short lived tokens, user preferences, cached lookups |
When you choose TTL, the component shows a TTL picker with preset durations such as 5 minutes, 15 minutes, 1 hour, 1 day, and up to 1 week.
Default behavior
Best Practices
- Always use descriptive keys so values are easy to identify.
- Reuse memory names consistently across related components.
- Avoid overwriting unintentionally: writing with the same key under the same memory name replaces the old value.
Troubleshooting Tips
If your memory write isn’t working...
FAQs
FAQs for Memory Write
What to Try Next
- Retrieve stored values with the Memory Read Component.
- Store multiple keys at once using the Memory Write Multi Component.
- Clean up unused data with the Memory Delete Component.