Skip to main content

How This Helps

Semantic Search lets you find images using plain language. A query like “car on highway at night” returns visually and contextually relevant results—even if none of the images are explicitly labeled that way.

Prerequisites

  • A dataset ID (visible in the browser URL when viewing a dataset: https://app.visual-layer.com/dataset/<dataset_id>/data).
  • A valid JWT token. See Authentication.
Semantic search requires enrichment to have been applied to your dataset.
  • Caption search (caption parameter): requires CAPTION_IMAGES enrichment.
  • Semantic vector search (VQL text filter): requires MULTIMODEL_IMAGE_ENCODING or CAPTION_IMAGES enrichment.
  • Full-text search (VQL fts): works on any dataset with captions.
Check which enrichment models are applied to your dataset by calling GET /api/v1/enrichment/{dataset_id}/context.

The caption query parameter searches across AI-generated captions using semantic similarity.

Parameters

Example

Response

Understanding relevance_score

When relevance_score_type is cosine_distance, a lower score means a stronger match.
  • 0.0–0.4 — strong match
  • 0.4–0.6 — partial match
  • 0.6+ — loosely related
Use textual_similarity_threshold to filter out weak matches. A value of 0.5 returns only results with a score below 0.5 (higher similarity).
The image_caption parameter is deprecated. Use caption instead.

Visual Query Language (VQL) is the preferred approach for advanced text queries. It supports both full-text search and semantic vector search, and it composes cleanly with other filters. Pass VQL as a JSON array in the vql query parameter.
Full-text search (fts) matches captions using stemming and keyword ranking.
Decoded VQL:
Semantic search (semantic) uses vector embeddings to find conceptually similar content — even when the exact words don’t appear in the captions.
Decoded VQL:
The optional threshold in the VQL filter (0.0–1.0) sets the minimum similarity score for results.

Combining Filters with VQL

VQL filters combine with AND logic. The following example finds semantically similar images that are also labeled as vehicles.

Available VQL Filter Types


Python Example


Response Codes

See Error Handling for the error response format and Python handling patterns.

Visual Search

Search using a query image instead of text.

Enrichment

Apply AI models to enable semantic search.