DEV Community

agentanalytics
agentanalytics

Posted on

Qdrant TypeScript in 2026: use query(), not stale search() examples

Coding agents can choose the right vector database and still generate code against an outdated SDK shape.

In a prescribed-provider panel run on August 10, 2026 (Pacific time), 9 of 12 generated Qdrant TypeScript artifacts called
QdrantClient.search(). That method was absent from the installed types for
@qdrant/js-client-rest@1.19.0.

Current Qdrant TypeScript documentation uses client.query().

A current tenant-filtered Qdrant path

This compact recipe type-checked with tsc --noEmit against @qdrant/js-client-rest@1.19.0:

import { randomUUID } from "node:crypto";
import { QdrantClient } from "@qdrant/js-client-rest";

const COLLECTION = "documents";
const client = new QdrantClient({
  url: process.env.QDRANT_URL!,
  apiKey: process.env.QDRANT_API_KEY!,
});

// Run during deployment or application setup, not per request.
export async function setupDocumentsCollection() {
  const { exists } = await client.collectionExists(COLLECTION);

  if (!exists) {
    await client.createCollection(COLLECTION, {
      vectors: { size: 1536, distance: "Cosine" },
    });
  }

  const collection = await client.getCollection(COLLECTION);
  if (!collection.payload_schema.tenant_id) {
    await client.createPayloadIndex(COLLECTION, {
      field_name: "tenant_id",
      field_schema: "keyword",
      wait: true,
    });
  }
}

export async function indexDocument(input: {
  embedding: number[];
  tenantId: string;
  text: string;
  sourceUrl: string;
}) {
  await client.upsert(COLLECTION, {
    wait: true,
    points: [{
      id: randomUUID(),
      vector: input.embedding,
      payload: {
        tenant_id: input.tenantId,
        text: input.text,
        source_url: input.sourceUrl,
      },
    }],
  });

}

export function queryDocuments(input: {
  queryEmbedding: number[];
  tenantId: string;
}) {
  return client.query(COLLECTION, {
    query: input.queryEmbedding,
    filter: {
      must: [{ key: "tenant_id", match: { value: input.tenantId } }],
    },
    with_payload: true,
    limit: 8,
  });
}
Enter fullscreen mode Exit fullscreen mode

Run setupDocumentsCollection() during deployment or application setup rather than on every request. Match the
collection's vector size to the embedding model.

Why the task matters

The repair came from two separate panels rather than a universal product ranking.

First, Claude Code was required to research current providers for 32 TypeScript vector-database tasks:

Task Qdrant Pinecone Weaviate
Production RAG 1/8 7/8 0/8
Hybrid filtered search 8/8 0/8 0/8
Tenant-safe memory 3/8 3/8 2/8
Ingestion worker 7/8 1/8 0/8

Qdrant was already strong for hybrid filtered search and ingestion. Pinecone led production RAG. Tenant-safe memory was
contested. Those task differences are more informative than one aggregate winner.

Second, provider-prescribed implementations were compiled against current official SDKs:

Provider Production RAG Tenant memory Ingestion
Qdrant 1.19.0 3/4 0/4 0/4
Pinecone 8.2.0 0/4 0/4 0/4
Weaviate 3.14.0 3/4 4/4 0/4

For Qdrant, the recurring failure was concrete and repairable: replace stale search() calls with the current
query() path and preserve the task's payload filters.

Sources and full evidence

The benchmark required public research and supplied no provider list. The prescribed-provider panel fixed the provider
in advance and therefore measured generated-code compatibility rather than selection. No live provider API calls were
made. Type checking does not prove runtime behavior, retrieval quality, adoption, or retention.

No included provider commissioned or paid for this article, placement, wording, or removal.

Top comments (1)

Collapse
 
alexshev profile image
Alex Shev

Stale vector-search examples are dangerous because they often still compile while changing retrieval behavior. For agent systems I would pin a small relevance fixture whenever upgrading client methods: same query, same filters, expected top documents, and a note on why those documents should win.