Login
Free Sign Up
Docs
/

AI - Vector Context Query

Type identifier: ai:vectorContext:query Category: AI Operations

Description

The AI - Vector Context Query node performs semantic search over stored embeddings in a vector context. It returns the most similar content based on embedding distance, with optional filtering by labels.

Input Handles

Handle

Type

Description

query

string

The text query to search for.

<labelFilter>

string

Dynamic handles for label filter values.

Output Handles

Handle

Type

Description

results

array

Array of matching results with content and scores.

Configuration Options

Option

Type

Default

Description

Top Count

number

3

Maximum number of results to return.

Label Filters

string[]

[]

Label keys to filter results by.

Label Values

string[]

[]

Expected label values (if static).

Behaviour

  1. Receives query text from input handle
  2. Computes embedding for the query
  3. Searches vector context for similar embeddings:

    • Applies label filters if configured
    • Ranks by cosine similarity
    • Limits to top N results
  4. Returns matching content with similarity scores

Similarity Scoring

Results are ranked by cosine similarity:

  • Higher scores indicate more semantic similarity
  • Scores range from 0 to 1
  • Results are returned in descending score order

Label Filtering

When label filters are configured:

  • Only embeddings matching all specified labels are considered
  • Dynamic handles provide label values at runtime
  • Multiple filters create AND conditions

Result Structure

Each result contains:

  • id: The embedding's unique identifier
  • content: The original stored text
  • score: Similarity score (0-1)
  • Labels: All stored label values

Examples

Basic Semantic Search

Configuration:

  • Top Count: 5
  • Label Filters: (none)

Input:

"How do I reset my password?"

Output: Top 5 most semantically similar stored content items.

Filtered Search

Configuration:

  • Top Count: 3
  • Label Filters: ["documentId"]

Use case: Search within a specific document's chunks.

RAG (Retrieval-Augmented Generation)

Flow:

  1. User asks a question
  2. AI - Vector Context Query finds relevant content
  3. Text - Template combines question + context
  4. AI - Chat Message generates informed response

Configuration:

  • Top Count: 5
  • Provides relevant context to the LLM

Multi-Filter Search

Configuration:

  • Label Filters: ["category", "language"]

Use case: Search documentation by topic and language.

Related pages