Skip to content

feat: add Qdrant vector database client for JavaScript SDK (#273)#467

Open
vedparkasharya wants to merge 1 commit intoarakoodev:tsfrom
vedparkasharya:feat/qdrant-vector-db-client
Open

feat: add Qdrant vector database client for JavaScript SDK (#273)#467
vedparkasharya wants to merge 1 commit intoarakoodev:tsfrom
vedparkasharya:feat/qdrant-vector-db-client

Conversation

@vedparkasharya
Copy link
Copy Markdown

Summary

Adds Qdrant vector database support to the EdgeChains JavaScript SDK using the Qdrant REST API directly (no external SDK package).

Problem

The JavaScript SDK only supported PostgreSQL/Supabase as the vector database. Issue #273 requested adding Qdrant vector database support.

Solution

  • Created QdrantClient class that wraps the Qdrant REST API directly
  • Follows the same pattern as the existing PostgresClient
  • Supports vector search, upsert, delete, collection management
  • Implements multiple distance metrics: Cosine, Euclid, Dot
  • Adds namespace filtering via Qdrant payload filters
  • Implements batch search with result deduplication and ranking
  • Includes 14 comprehensive unit tests using vitest

Changes

  • JS/edgechains/arakoodev/src/db/src/lib/qdrant-client/QdrantClient.ts - New Qdrant client (279 lines)
  • JS/edgechains/arakoodev/src/db/src/tests/qdrant-client/qdrantClient.test.ts - 14 unit tests (371 lines)
  • JS/edgechains/arakoodev/src/db/src/index.ts - Export QdrantClient and QdrantDistanceMetric

Testing

  • All 14 unit tests pass
  • Tests cover: search, batch query, upsert, delete, collection creation, collection info, health check, error handling

Usage

import { QdrantClient, QdrantDistanceMetric } from "@arakoodev/edgechains.js/db";

const client = new QdrantClient(
  "http://localhost:6333",
  [[0.1, 0.2, 0.3]],
  QdrantDistanceMetric.COSINE,
  5,
  "my_collection",
  "my_namespace",
  arkRequest,
  10,
  "optional-api-key"
);

// Search vectors
const results = await client.searchVectors([0.1, 0.2, 0.3]);

// Batch query (dbQuery pattern like PostgresClient)
const results = await client.dbQuery();

// Upsert points
await client.upsertPoints([
  { id: "1", vector: [0.1, 0.2], payload: { text: "hello" } }
]);

/claim #273

…#273)

- Add QdrantClient class using Qdrant REST API directly (no SDK package)
- Support vector search, upsert, delete, collection management
- Implement multiple distance metrics: Cosine, Euclid, Dot
- Add namespace filtering via Qdrant payload filters
- Add batch search with result deduplication and ranking
- Include 14 comprehensive unit tests using vitest
- Export from db module index

Fixes arakoodev#273
@github-actions
Copy link
Copy Markdown

CLA Assistant Lite bot: Thank you for your submission, we really appreciate it. Before we can accept your contribution, we ask that you sign the Arakoo Contributor License Agreement. You can sign the CLA by adding a new comment to this pull request and pasting exactly the following text.


I have read the Arakoo CLA Document and I hereby sign the CLA


Ved Prakash Arya seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant