LokiVector Store
AI-generatedSummary
Insert or load documents in a local LokiVector vector store database to perform vector similarity operations using embedded vectors.
Inputs
- dbPath (required) — Path to the LokiVector database file; uses ~ for home directory and creates directory if missing.
- collectionName (required) — Name of the collection storing vectors, each with its own vector index.
- indexM — Max connections per node in HNSW index, balancing accuracy and memory (default 16).
- efConstruction — Exploration factor during index construction affecting quality and build time (default 200).
- efSearch — Exploration factor during search affecting accuracy and search speed (default 50).
- distanceFunction — Distance metric to compare vectors: 'cosine' (default, for normalized embeddings) or 'euclidean'.
- mode (required) — Operation mode: 'insert' to add documents or 'load' to search documents.
- clearStore — When mode is 'insert', whether to clear the collection before inserting new data (default false).
- query (required) — When mode is 'load', the text query to search for similar documents.
- topK — When mode is 'load', number of most similar documents to return (default 4).
Output shape
a list of documents with their pageContent and metadata on load; input items augmented with an 'inserted' flag on insert
The operation requires an embedding input connection. In 'insert' mode, documents are taken from input items by extracting text from 'text' or 'pageContent' fields and optional metadata. In 'load' mode, the node returns the topK most similar documents to the query text based on vector similarity search. Clearing the collection on insert is optional.
Examples
Example 1: Insert mode
Provides path, collectionName, and optionally clears existing data, then indexes input documents' text with embedding vectors.
Example 2: Load mode
Given a query string, returns up to topK similar documents stored in the specified collection using vector similarity search.