RAG / Vector Store

The RAG / Vector Store node inserts documents into or searches a vector store for Retrieval Augmented Generation (RAG).

The RAG / Vector Store node inserts documents into or searches a vector store for Retrieval Augmented Generation (RAG). Use it to augment LLM context with relevant documents.

The node has a Database dropdown that selects the backend:

  • Qdrant – stores vectors in an external Qdrant server (requires a RAG: Qdrant + OpenAI credential).
  • Postgres (pgvector) – stores vectors inside Heym's own Postgres database, no external service (requires a RAG: Psql + OpenAI credential).

The default is Qdrant for backward compatibility. Changing the Database filters the Vector Store list to stores backed by that database. Both backends support the same operations, metadata filtering, and Cohere reranking.

Either backend can also be reached through a RAG: Custom Embeddings credential, which replaces OpenAI with any OpenAI-compatible embedding endpoint and names its own vector store. A store created from such a credential appears under whichever Database it targets. See Custom Embeddings.

Overview

PropertyValue
Inputs1
Outputs1
Output$nodeLabel.results / $nodeLabel.reranked / $nodeLabel.count (search), $nodeLabel.point_id (insert)

Parameters

ParameterTypeDescription
dbType"qdrant" | "pgvector"Vector store backend (default: "qdrant")
vectorStoreIdUUIDVector store from Vectorstores tab
ragOperation"insert" | "search"Operation type (also operation)
documentContentexpressionDocument text to insert (insert only)
documentMetadataJSON stringMetadata for inserted docs (insert only)
queryTextexpressionSearch query (search only)
searchLimitnumberMax results (default: 5)
metadataFiltersJSON stringMetadata filters for search
enableRerankerbooleanUse Cohere to rerank search results
rerankerCredentialIdUUIDCohere credential for reranking
rerankerTopNnumberNumber of top results to keep after reranking

Operations

Insert

Add documents to the vector store.

FieldRequiredDescription
documentContentyesText to embed and store
documentMetadatanoJSON object, e.g. {"source": "user", "category": "general"}

Output: $nodeLabel.status, $nodeLabel.inserted_ids

Semantic search for similar documents.

FieldRequiredDescription
queryTextyesSearch query
searchLimitnoMax results (default: 5)
metadataFiltersnoFilter by metadata (exact match JSON object)
enableRerankernoEnable Cohere reranking for better relevance
rerankerCredentialIdwhen rerankingCohere credential
rerankerTopNnoFinal number of results after reranking

Output: $nodeLabel.results – array of { id, text, score, metadata }

When reranking is enabled:

  • $nodeLabel.reranked becomes true
  • Each result also includes relevance_score
  • score remains the original vector similarity score
  • relevance_score is the Cohere reranker score

Accessing Results

  • $ragNode.results.first().text – top result content
  • $ragNode.results.first().score – similarity score (0–1)
  • $ragNode.results.first().metadata.source – top result metadata
  • $ragNode.results.map("item.text").join("\n\n") – concatenate for LLM context
  • $ragNode.reranked – whether reranking was applied
  • $ragNode.count – number of returned results
{
  "type": "rag",
  "data": {
    "label": "searchDocs",
    "vectorStoreId": "vector-store-uuid",
    "ragOperation": "search",
    "queryText": "$userInput.body.text",
    "searchLimit": 5,
    "metadataFilters": "{\"category\": \"faq\"}",
    "enableReranker": true,
    "rerankerCredentialId": "cohere-credential-uuid",
    "rerankerTopN": 5
  }
}

Example – Insert

{
  "type": "rag",
  "data": {
    "label": "insertDoc",
    "vectorStoreId": "vector-store-uuid",
    "ragOperation": "insert",
    "documentContent": "$userInput.body.text",
    "documentMetadata": "{\"source\": \"user_input\"}"
  }
}