/claim #273
Add Qdrant vector database support to the JavaScript SDK using the Qdrant REST API directly (no external qdrant packages), as requested in #273.
Qdrant class (arakoodev/src/vector-db/src/lib/qdrant/qdrant.ts)Wraps the Qdrant REST API with the same retry-based resilience pattern used by the existing Supabase class:
| Method | Qdrant API Endpoint | Description |
|---|---|---|
createCollection() |
PUT /collections/{name} |
Create a collection with vector config |
deleteCollection() |
DELETE /collections/{name} |
Delete a collection |
getCollection() |
GET /collections/{name} |
Get collection info |
upsertPoints() |
PUT /collections/{name}/points |
Insert or update points with vectors + payload |
searchPoints() |
POST /collections/{name}/points/search |
Nearest neighbor search with optional filters |
getPoints() |
POST /collections/{name}/points |
Retrieve points by ID |
deletePoints() |
POST /collections/{name}/points/delete |
Delete points by ID |
fetch + Qdrant REST API directly, as requestedapi-key header for Qdrant CloudQDRANT_URL, QDRANT_API_KEY)arakoodev/src/vector-db/src/lib/qdrant/qdrant.ts — Qdrant client classarakoodev/src/vector-db/src/index.ts — Export Qdrant alongside Supabasearakoodev/src/vector-db/src/tests/qdrant/ — 5 test files (createCollection, upsertPoints, searchPoints, getPoints, deletePoints)examples/chat-with-pdf-qdrant/ — Working example demonstrating all operationsUsage:
import { Qdrant } from "@arakoodev/edgechains.js/vector-db";
const qdrant = new Qdrant("http://localhost:6333", "optional-api-key");
// Create collection
await qdrant.createCollection({
collectionName: "documents",
vectorSize: 1536,
distance: "Cosine",
});
// Upsert vectors
await qdrant.upsertPoints({
collectionName: "documents",
points: [{
id: 1,
vector: embeddings,
payload: { content: "document text", source: "page_1" },
}],
});
// Search
const results = await qdrant.searchPoints({
collectionName: "documents",
vector: queryEmbedding,
limit: 5,
});
ts)maoshuorz
@maoshuorz
Arakoo.ai
@arakoodev