LogoLogo
Documentation
Documentation
  • Getting Started
    • Introduction
    • Sign up to Developer Edition
    • Build Your First Agent
    • Developer Support
  • Core Concepts
    • Agent
      • Knowledge
      • Webhook
    • PII Masking
    • Sub-Agent
    • Intent
    • Workflow
      • Node
        • Input
        • Output
        • Loader
        • Display
        • API Node
        • Web Crawler
        • Table Write
        • Table Read
        • Ruleset
        • Upload Document
        • Javascript
        • Workflow
        • Loop
        • Document To Image
        • External Database
        • Storage Write
        • Storage Read
        • Fetch Document
        • Prompt
        • RAG Query
        • Vector Search
        • Emit Event
    • RAG
    • Model Hub
      • Entity Recognizers
    • Data Gateway
    • Rulesets
    • Code Snippets
    • Tables
    • Storage
    • Widget
  • Overview of GenAI
    • Introduction
    • Key concepts
      • Intent Classification
      • Inference
      • Generative AI Models
      • Large Language Models (LLMs)
      • Prompt Engineering
      • AI Agents
      • RAG (Retrieval Augmented Generation)
      • AI Workflow Automation
      • AI Agents vs LLM-based APPs
Powered by GitBook
On this page
  • Overview
  • Configurations
  • Example Use-Cases
  • Key Takeaways for Developers
Export as PDF
  1. Core Concepts
  2. Workflow
  3. Node

Vector Search

Overview

The Similarity Search Node enables AI workflows to retrieve contextually similar items based on vector representations rather than exact keyword matching. This is particularly useful for applications where meaning and semantic similarity matter more than specific words.

Key Use-Cases

✅ Product Recommendations – Suggests similar products based on user searches or past interactions. ✅ Document Retrieval – Finds relevant research papers, legal documents, or articles based on semantic similarity. ✅ Semantic Search – Enhances search accuracy by retrieving results based on meaning, not just keywords. ✅ Chatbots & Virtual Assistants – Helps chatbots retrieve relevant responses from a knowledge base.

How It Works

1️⃣ The node queries a vector store to find items most similar to the input query. 2️⃣ The results are ranked by similarity and returned to the workflow. 3️⃣ Optional metadata filters can further refine the retrieved results.

🔹 Example Use-Case: A shopping assistant AI recommends high-performance laptops similar to a user’s search query based on vector embeddings rather than just text matches.

Configurations

Field
Description

Vector Store

Define the vector store that contains indexed data for similarity search. This store must be properly configured to ensure accurate retrieval results.

Number of Candidates

Set the maximum number of similar items to retrieve. The higher the number, the more options will be returned, but with potential trade-offs in relevance.

Query

The input query (e.g., product name, description, or text snippet) that will be compared against stored vector embeddings to find the most relevant matches.

Filters (Optional)

Apply metadata-based filters to refine search results by restricting retrieval to specific categories, attributes, or tags.


Metadata Filtering & Its Importance

Metadata filtering enhances retrieval accuracy and efficiency by allowing developers to limit search results based on specific attributes stored in the vector database.

How Metadata Filtering Helps in Faster Querying:

✅ Narrows Down Search Scope – Instead of searching across all stored vectors, it retrieves only relevant subsets. ✅ Improves Precision – Ensures only relevant matches are returned by applying contextual constraints. ✅ Optimizes Query Performance – Reduces retrieval latency by limiting search operations to predefined categories.

🔹 Example: If searching for high-performance laptops, metadata filters can restrict results to the “electronics” category, avoiding unrelated results from other domains.


Execution Flow:

1️⃣ The Similarity Search Node queries the vector store for semantically similar items. 2️⃣ If metadata filters are applied, only relevant matches are considered. 3️⃣ The node returns the retrieved documents, ranked by similarity.

Output Format:

Example Output for a Product Recommendation Query

{
  "retrievedDocs": [
    {
      "pageContent": "The Apple MacBook Pro, powered by the new Apple Silicon M3 Pro/Max processors, offers up to 64GB of unified memory. With exceptional build quality, long battery life, and seamless integration within the macOS ecosystem, it’s a standout high-performance choice for creative professionals, developers, and video editors."
    },
    {
      "pageContent": "The Dell XPS 15 comes with powerful processor options, including the Intel Core i9 (14th Gen) and AMD Ryzen 9, alongside up to 64GB of DDR5 RAM. This laptop features an OLED display, a lightweight design, and powerful GPU options, making it an ideal high-performance machine for content creators, software engineers, and those involved in multimedia editing."
    }
  ]
}

🔹 Why use this approach? ✔ Retrieves semantically similar results rather than just keyword matches. ✔ Enhances user experience by delivering more relevant recommendations.

Example Use-Cases

Use-Case 1: AI-Powered Product Recommendation System

A shopping assistant AI suggests products similar to what a user is searching for, based on vector embeddings rather than exact keyword matches.

Configuration:

Field
Value

Vector Store

product_vectors

Number of Candidates

2

Query

"high-performance laptop"

Filters (Optional)

{ "category": "electronics" }

Execution Process:

1️⃣ The Similarity Search Node searches the vector store for products semantically similar to "high-performance laptop". 2️⃣ The system filters results to ensure only electronics are returned. 3️⃣ The most relevant product descriptions are retrieved and recommended to the user.

Generated AI Response:

{
  "retrievedDocs": [
    {
      "pageContent": "The Apple MacBook Pro, powered by the new Apple Silicon M3 Pro/Max processors, offers up to 64GB of unified memory. With exceptional build quality, long battery life, and seamless integration within the macOS ecosystem, it’s a standout high-performance choice for creative professionals, developers, and video editors."
    },
    {
      "pageContent": "The Dell XPS 15 comes with powerful processor options, including the Intel Core i9 (14th Gen) and AMD Ryzen 9, alongside up to 64GB of DDR5 RAM. This laptop features an OLED display, a lightweight design, and powerful GPU options, making it an ideal high-performance machine for content creators, software engineers, and those involved in multimedia editing."
    }
  ]
}

Use-Case 2: AI-Powered Document Retrieval

A research assistant AI helps users retrieve relevant research papers based on the meaning of their query, not just exact word matches.

Configuration:

Field
Value

Vector Store

research_papers

Number of Candidates

3

Query

"latest advancements in quantum computing"

Filters (Optional)

{ "year": { "$gte": 2022 } }

Execution Process:

1️⃣ The Similarity Search Node retrieves the most relevant research papers on quantum computing. 2️⃣ A metadata filter ensures that only papers published after 2022 are considered. 3️⃣ The retrieved papers are summarized and presented to the user.

Generated AI Response:

{
  "retrievedDocs": [
    {
      "pageContent": "A 2023 study on quantum computing breakthroughs in superconducting qubits and error correction techniques."
    },
    {
      "pageContent": "A 2022 paper discussing the impact of quantum entanglement in secure communications and cryptographic algorithms."
    },
    {
      "pageContent": "A research paper exploring new quantum algorithms optimized for solving large-scale mathematical problems."
    }
  ]
}

Use-Case 3: AI-Powered Semantic Search for Customer Support

A customer support AI retrieves knowledge base entries similar to a user's question, improving chatbot response accuracy.

Configuration:

Field
Value

Vector Store

support_knowledge_base

Number of Candidates

2

Query

"How do I reset my password?"

Filters (Optional)

{ "category": "account_management" }

Execution Process:

1️⃣ The Similarity Search Node retrieves knowledge base articles related to password resets. 2️⃣ A metadata filter ensures that only "account management" articles are considered. 3️⃣ The chatbot retrieves the most relevant responses and displays them to the user.

Generated AI Response:

{
  "retrievedDocs": [
    {
      "pageContent": "To reset your password, go to the login page, click 'Forgot Password,' and follow the instructions to receive a reset link."
    },
    {
      "pageContent": "If you're unable to reset your password using the standard method, contact support for further assistance."
    }
  ]
}

Key Takeaways for Developers

✅ Retrieves Contextually Similar Results Using Vectors – The Similarity Search Node matches queries based on meaning rather than exact keywords, making it ideal for recommendations, document retrieval, and semantic search.

✅ Supports a Wide Range of AI-Powered Applications – Can be used for product recommendations, knowledge base retrieval, legal research, customer support automation, and more.

✅ Uses Metadata Filtering for Faster and More Accurate Results – Developers can apply filters to narrow search results, improving precision and query performance.

✅ Enhances User Experience with More Relevant Suggestions – Whether in e-commerce, customer support, or research, the node provides results that closely match the user’s intent, not just keyword matches.

✅ Works with Any Configured Vector Store – The node seamlessly integrates with pre-configured vector stores, ensuring scalability and efficiency.

By leveraging the Similarity Search Node, developers can build intelligent, high-accuracy retrieval systems that improve AI recommendations, enhance search results, and provide more personalized user experiences. 🚀

PreviousRAG QueryNextEmit Event

Last updated 3 months ago