Skip to content

Commit 4ba3a58

Browse files
Add memory management section to simple vector store (#3002)
Co-authored-by: Justin Ellingwood <justin@n8n.io>
1 parent a663e9c commit 4ba3a58

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ The simple vector storage described here is different to the AI memory nodes suc
2020
This node creates a [vector database](/glossary.md#ai-vector-store) in the app memory.
2121
///
2222

23+
24+
/// warning | For development use only
25+
This node stores data in memory only and isn't recommended for production use. All data is lost when n8n restarts and may also be purged in low-memory conditions.
26+
///
27+
2328
## Node usage patterns
2429

2530
You can use the Simple Vector Store node in the following patterns.
@@ -48,6 +53,25 @@ Another pattern uses the [Vector Store Question Answer Tool](/integrations/built
4853

4954
The [connections flow](https://n8n.io/workflows/2465-building-your-first-whatsapp-chatbot/) in this case would look like this: AI agent (tools connector) -> Vector Store Question Answer Tool (Vector Store connector) -> Simple Vector store.
5055

56+
## Memory Management
57+
58+
The Simple Vector Store implements memory management to prevent excessive memory usage:
59+
60+
- Automatically cleans up old vector stores when memory pressure increases
61+
- Removes inactive stores that haven't been accessed for a configurable amount of time
62+
- Each workflow gets its own isolated storage space identified by the workflow ID and memory key
63+
64+
### Configuration Options
65+
66+
You can control memory usage with these environment variables:
67+
68+
| Variable | Type | Default | Description |
69+
|-------------------------------|--------|---------|-------------------------------------------------------------------------------------|
70+
| `N8N_VECTOR_STORE_MAX_MEMORY` | Number | -1 | Maximum memory in MB allowed for all vector stores combined (-1 to disable limits). |
71+
| `N8N_VECTOR_STORE_TTL_HOURS` | Number | -1 | Hours of inactivity after which a store gets removed (-1 to disable TTL). |
72+
73+
On n8n Cloud, these values are preset to 100MB (about 8,000 documents, depending on document size and metadata) and 7 days respectively. For self-hosted instances, both values default to -1(no memory limits or time-based cleanup).
74+
5175
## Node parameters
5276

5377
--8<-- "_snippets/integrations/builtin/cluster-nodes/vector-store-mode.md"

0 commit comments

Comments
 (0)