Skip to main content
@tags: vector, search, similarity, embedding, searchV, embed, cosine, euclidean, hnsw

Vector Search using SearchV

Syntax

Note: Currently only supports [F64] to represent the vector. Support for [F32] and binary vectors added in the future.
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Example 2: Vector search with postfiltering

  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Example 3: Using the built in Embed function

  • Built-in Embed function: don’t need to send array of floats, just send the text.
  • Schema:
  • Query:
  • Environment variables (OpenAI example):
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Embedding Vectors using Embed

Syntax

Notes (outdated, will be updated in the future):
  • The text is automatically embedded with an embedding model of your choice (can be defined in your config.hx.json file).
  • The default embedding model is text-embedding-ada-002 from OpenAI.
  • Make sure to set your OPENAI_API_KEY environment variable with your API key in the same location as the queries.hx, schema.hx and config.hx.json files.

Example 1: Creating a vector from text

  • Schema:
  • Query:
  • Environment variables (OpenAI example):
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Example 2: Searching with text embeddings

  • Schema:
  • Query:
  • Environment variables (OpenAI example):
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Example 3: Creating a vector and connecting it to a user

  • Schema:
  • Query:
  • Environment variables (OpenAI example):
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Example 4: Semantic search with postfiltering

  • Schema:
  • Query:
  • Environment variables (OpenAI example):
  • cURL:
  • Python SDK:
  • TypeScript SDK: