n8n community node for embedded vector database - perform similarity search directly within n8n without external servers
npm install n8n-nodes-minimemoryAn n8n community node for embedded vector database operations - 100% serverless.
Perform vector similarity search directly within n8n without any external server. Perfect for:
- RAG (Retrieval Augmented Generation)
- Semantic search
- Recommendations
- Deduplication
- No server required - Everything runs locally within n8n
- Similarity search - Find the k most similar vectors
- Hybrid search - Combine vector + keyword (BM25) search
- Multiple metrics - Cosine, Euclidean, Dot Product
- Metadata support - Associate additional information with each vector
- Metadata filtering - MongoDB-style query operators
- Persistence - Save/load from JSON files
- Bulk insert - Insert multiple vectors from previous nodes
1. Go to Settings > Community Nodes
2. Search for n8n-nodes-minimemory
3. Click Install
``bash`
cd ~/.n8n/nodes
npm install n8n-nodes-minimemory
Then restart n8n.
| Parameter | Description | Example |
|-----------|-------------|---------|
| Database Name | Unique name for the DB | my_vectors |384
| Dimensions | Number of dimensions | (MiniLM), 1536 (OpenAI) |cosine
| Distance Metric | Similarity metric | , euclidean, dot |flat
| Index Type | Index type | (exact), hnsw (fast) |
| Parameter | Description |
|-----------|-------------|
| Vector ID | Unique identifier |
| Vector | Array of numbers [0.1, 0.2, ...] |{"title": "Doc 1"}
| Metadata | JSON object |
| Parameter | Description | Default |
|-----------|-------------|---------|
| ID Field | Field containing the ID | id |embedding
| Vector Field | Field containing the vector | |
| Metadata Fields | Fields for metadata (empty = all) | |
Example input:
`json`
[
{"id": "doc1", "embedding": [0.1, 0.2, ...], "title": "Document 1"},
{"id": "doc2", "embedding": [0.3, 0.4, ...], "title": "Document 2"}
]
| Parameter | Description | Default |
|-----------|-------------|---------|
| Search Mode | vector, keyword, or hybrid | vector |content,text,title,description
| Query Vector | Vector for similarity search | (required for vector/hybrid) |
| Keywords | Text for BM25 keyword search | (required for keyword/hybrid) |
| Text Fields | Metadata fields to search | |10
| Number of Results (K) | Number of results | |false
| Include Vectors | Include vectors in result | |0
| Minimum Similarity | Filter by minimum similarity | |false
| Use Metadata Filter | Enable metadata filtering | |{}
| Metadata Filter | JSON filter (see below) | |0.5
| Hybrid Alpha | Vector(1) vs Keyword(0) balance | |rrf
| Fusion Method | or weighted | rrf |1.2
| BM25 K1 | Term saturation parameter | |0.75
| BM25 B | Length normalization | |
Output:
`json`
{
"success": true,
"searchMode": "hybrid",
"filterApplied": true,
"results": [
{"id": "doc1", "score": 0.032, "vectorSimilarity": 0.9, "keywordScore": 12.4, "metadata": {...}},
{"id": "doc2", "score": 0.028, "vectorSimilarity": 0.8, "keywordScore": 8.2, "metadata": {...}}
]
}
Filter search results by metadata fields using MongoDB-style operators.
`json
// Exact match
{"category": "tech"}
// Multiple conditions (implicit AND)
{"category": "tech", "author": "John"}
`
| Operator | Description | Example |
|----------|-------------|---------|
| $eq | Equal (implicit) | {"status": "active"} |$ne
| | Not equal | {"status": {"$ne": "deleted"}} |$gt
| | Greater than | {"score": {"$gt": 0.5}} |$gte
| | Greater or equal | {"price": {"$gte": 100}} |$lt
| | Less than | {"age": {"$lt": 30}} |$lte
| | Less or equal | {"count": {"$lte": 10}} |
| Operator | Description | Example |
|----------|-------------|---------|
| $in | In array | {"category": {"$in": ["tech", "science"]}} |$nin
| | Not in array | {"type": {"$nin": ["spam", "ad"]}} |
| Operator | Description | Example |
|----------|-------------|---------|
| $contains | Contains (case-insensitive) | {"title": {"$contains": "AI"}} |$startsWith
| | Starts with | {"name": {"$startsWith": "Dr."}} |$endsWith
| | Ends with | {"file": {"$endsWith": ".pdf"}} |
| Operator | Description | Example |
|----------|-------------|---------|
| $exists | Field exists | {"email": {"$exists": true}} |
`json
// AND - all conditions must match
{
"$and": [
{"category": "tech"},
{"score": {"$gt": 0.8}}
]
}
// OR - any condition matches
{
"$or": [
{"type": "article"},
{"type": "blog"}
]
}
`
Access nested object fields using dot notation:
`json`
{"user.profile.country": "US"}
Find tech articles with high score:
`json`
{
"$and": [
{"category": "tech"},
{"score": {"$gte": 0.8}}
]
}
Find documents from specific authors:
`json`
{"author": {"$in": ["Alice", "Bob", "Charlie"]}}
Find recent documents with keyword:
`json`
{
"timestamp": {"$gt": "2024-01-01"},
"title": {"$contains": "machine learning"}
}
``
[Trigger]
|
[OpenAI Embeddings] -> [Minimemory: Insert Many]
|
[Query Input]
|
[OpenAI Embeddings] -> [Minimemory: Search] -> [OpenAI Chat]
|
[Response]
1. Create DB (run once):
- Operation: Create Databasedocs
- Database Name: 1536
- Dimensions: (OpenAI)cosine
- Distance:
2. Index documents:
- Connect node that generates embeddings
- Operation: Insert Manyid
- ID Field: embedding
- Vector Field:
3. Search:
- Connect query with embedding
- Operation: Search{{ $json.embedding }}
- Query Vector: 5
- K:
Databases live in memory while n8n is running. To persist:
``
[Startup Trigger] -> [Minimemory: Load from File]
|
(DB available for use)
|
[Before shutdown] -> [Minimemory: Save to File]
| Model | Dimensions | Notes |
|-------|------------|-------|
| all-MiniLM-L6-v2 | 384 | Fast, good for short text |
| all-mpnet-base-v2 | 768 | Better quality |
| text-embedding-ada-002 | 1536 | OpenAI legacy |
| text-embedding-3-small | 1536 | OpenAI new |
| text-embedding-3-large | 3072 | OpenAI high quality |
| embed-english-v3.0 | 1024 | Cohere |
- Flat Index: O(n) - Exact, ideal for < 10,000 vectors
- HNSW Index: O(log n) - Approximate, for large datasets
or Load from File first.$3
The inserted/searched vector has a different number of dimensions than the DB.$3
1. Verify npm run build completed without errors
2. Check the link with npm ls -g --link`For issues and feature requests, please visit:
https://github.com/MauricioPerera/n8n-nodes-minimemory/issues
MIT