n8n-nodes-js-vector-store
v1.4.0
Published
n8n community node to store, search and manage vectors on the host filesystem via js-vector-store
Readme
n8n-nodes-js-vector-store
An n8n community node to store, search and manage vector embeddings directly from your workflows — backed by js-vector-store, a zero-dependency pure-JS vector store.
No native binary, no external database: vectors persist to a directory on the n8n host. Great for semantic search / RAG over your own data (catalogs, docs, support tickets, spreadsheets migrated to structured data).
This node stores and searches vectors — it does not generate embeddings. Produce embeddings with an embeddings node (OpenAI, Cohere, Workers AI, etc.) and pass the vector in.
This package ships a combo of three nodes, all persisting to the host filesystem, no external DB:
- Vector Store — store / search vectors (this node).
- Vector Store Memory — long-term semantic memory for the AI Agent (see Agent memory).
- Document Store — a MongoDB-style JSON document database, the sister of the vector store (see Document Store).
Installation · Operations · Credentials · AI / tool use · Notes
Installation
Follow the community nodes installation guide and install n8n-nodes-js-vector-store.
Self-hosted only. The node reads/writes a vector store directory on the host filesystem, so it requires a self-hosted / Docker n8n (n8n Cloud has no persistent local filesystem).
Operations
- Upsert — insert or update a vector by id, with optional metadata.
- Search — k-nearest neighbours for a query vector. Metric (cosine/euclidean/dotProduct/manhattan),
limit, optional Mongo-style metadata filter, optionaldimSlice(Matryoshka). - Get — fetch a vector + metadata by id.
- Delete — remove a vector by id.
- Count — number of vectors in a collection.
- Drop Collection — delete a whole collection.
- List Collections — list collection names in the store.
Vectors and metadata are validated (dimension must match the credential; limit >= 1) and writes are flushed to disk automatically.
Credentials
A single credential Vector Store API:
- Store Directory — absolute path on the n8n host where the store persists (e.g.
/data/vectors). - Dimension — vector length (fixed per store; every vector must match it).
Document Store
A second node, Document Store, is a MongoDB-style JSON document database backed by js-doc-store — the sister of the vector store, same zero-dependency, filesystem-persisted design.
- Operations: Insert / Insert Many, Find (filter + sort + skip + limit + projection), Find One, Find by ID, Update / Update Many, Delete / Delete Many / Delete by ID, Count, Create Index (hash / sorted / text, optional unique), Drop Index, List Indexes, Export / Import, List Collections, Drop Collection.
- Query filters are Mongo-style JSON:
$eq/$ne/$gt/$gte/$lt/$lte/$in/$nin/$and/$or/$not/$regex/$text/$size. Update ops:$set/$unset/$inc/$push/$pull/$rename. - Uses its own credential Document Store API (just a store directory).
usableAsTool+ a Read Only toggle for safe agent access.
AI / tool use
The node is enabled as an AI tool (usableAsTool). Turn on Read-only to let an AI agent query the store (Search/Get/Count/List) while write operations (Upsert/Delete/Drop) are rejected — safe for RAG retrieval.
Agent memory (Vector Store Memory)
A second node, Vector Store Memory, plugs into the AI Agent's Memory port and turns the store into long-term memory. Connect an Embeddings model to it; every conversation turn is embedded and persisted per session. On each turn the agent receives the last Context Window Length messages plus the top Semantic Recall older messages that are semantically relevant to the recent thread.
It reuses the same Vector Store API credential — the embeddings model's output dimension must match the credential Dimension.
Limitation: n8n loads the memory port without the current user message, so semantic recall is relative to the most recent stored turn, not the exact live question. For query-exact recall, expose the store as a retriever tool instead. See
examples/06-agent-memory.json.
Ready-to-import example workflows (Index & Search, Filtered Search, RAG retrieval, Hybrid, ANN, Agent Memory) live in examples/.
Notes
- Default search is exact (brute-force): fast up to tens of thousands of vectors. For larger sets, approximate indexing (IVF) and quantization are on the roadmap.
- Metadata filters are applied after scoring; with very selective filters raise
limit.
