Vector Store icon

Vector Store

Store, search and manage vectors on the n8n host filesystem via js-vector-store

Hybrid Search

AI-generated

Summary

Searches a vector collection using both semantic similarity and BM25 lexical ranking, then fuses the results using RRF or weighted scoring.

Inputs

  • Collection (required) — Collection to search. It must have a BM25 index created by upserting documents with a non-empty Text value.
  • Query Vector (required) — Array of finite numbers or a JSON string containing one. Its length must match the dimension configured in the vector store credentials.
  • Query Text — Text for BM25 lexical search. Defaults to empty; with an empty query, ranking uses the vector query only.
  • Limit — Maximum results to return; defaults to 50.
  • Metric — Vector similarity metric: cosine (default), dot product, Euclidean, or Manhattan.
  • Mode — Fusion strategy: RRF (default) blends by rank position, or Weighted blends vector and text scores.
  • Vector Weight — In Weighted mode, sets the vector score weight; defaults to 0.5.
  • Text Weight — In Weighted mode, sets the BM25 score weight; defaults to 0.5.
  • RRF K — RRF smoothing constant; defaults to 60 and is used in RRF mode.
  • Fetch K — Number of candidates fetched from vector search before fusion. Defaults to 0, which uses the engine default.

Output shape

A list of result items, each containing id, score, and metadata.

Each hit is a separate n8n item; metadata defaults to an empty object. A missing BM25 index causes an error instructing you to upsert documents with a Text value. Errors can be returned as an error item when Continue On Fail is enabled.

Links

Discussion