🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@qdrant/js-client-rest

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qdrant/js-client-rest

This repository contains the REST client for the [Qdrant](https://github.com/qdrant/qdrant) vector search engine.

1.13.0
Source
npm
Version published
Weekly downloads
190K
6.87%
Maintainers
2
Weekly downloads
 
Created

What is @qdrant/js-client-rest?

@qdrant/js-client-rest is a JavaScript client for interacting with the Qdrant vector search engine via REST API. It allows developers to manage collections, upload and search vectors, and perform various operations related to vector databases.

What are @qdrant/js-client-rest's main functionalities?

Manage Collections

This feature allows you to create and manage collections in the Qdrant database. The code sample demonstrates how to create a new collection with a specified vector size and distance metric.

const { QdrantClient } = require('@qdrant/js-client-rest');

const client = new QdrantClient({ url: 'http://localhost:6333' });

async function createCollection() {
  await client.createCollection('my_collection', {
    vectors: {
      size: 128,
      distance: 'Cosine'
    }
  });
}

createCollection();

Upload Vectors

This feature allows you to upload vectors to a specified collection. The code sample shows how to upload vectors with unique IDs to a collection.

const { QdrantClient } = require('@qdrant/js-client-rest');

const client = new QdrantClient({ url: 'http://localhost:6333' });

async function uploadVectors() {
  await client.uploadVectors('my_collection', [
    { id: '1', vector: [0.1, 0.2, 0.3, ...] },
    { id: '2', vector: [0.4, 0.5, 0.6, ...] }
  ]);
}

uploadVectors();

Search Vectors

This feature allows you to perform a search for similar vectors in a collection. The code sample demonstrates how to search for the top 5 vectors similar to a given query vector.

const { QdrantClient } = require('@qdrant/js-client-rest');

const client = new QdrantClient({ url: 'http://localhost:6333' });

async function searchVectors() {
  const results = await client.search('my_collection', {
    vector: [0.1, 0.2, 0.3, ...],
    top: 5
  });
  console.log(results);
}

searchVectors();

Other packages similar to @qdrant/js-client-rest

FAQs

Package last updated on 17 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts