# JavaScript vector database libraries

JavaScript vector database libraries store embeddings and find the stored items closest to a query vector. A client either calls a hosted or self-run vector database over HTTP or gRPC or runs an embedded index inside the application process. These libraries let AI agents and search features retrieve relevant documents by meaning.

## Popularity

| Library | Monthly downloads | Stars | Last release | License |
| --- | --- | --- | --- | --- |
| [Orama](#orama-orama) | 7.9M | 10.6K | Dec 2025 | Apache-2.0 |
| [Pinecone TypeScript SDK](#pinecone) | 4.2M | 279 | Nov 2026 | Apache-2.0 |
| [pgvector-node](#pgvector) | 4.1M | 446 | Nov 2026 | MIT |
| [@qdrant/js-client-rest](#qdrant-rest-client) | 3.7M | 473 | Oct 2026 | Apache-2.0 |
| [LanceDB](#lancedb-lancedb) | 2.4M | 11.9K | Oct 2026 | Apache-2.0 |
| [weaviate-client](#weaviate-client) | 1.9M | 101 | Oct 2026 | BSD-3-Clause |
| [chromadb](#chroma) | 1.1M | 29.7K | Jun 2026 | Apache-2.0 |
| [@zilliz/milvus2-sdk-node](#zilliz-milvustwo-sdk-node) | 866.5K | 199 | Nov 2026 | Apache-2.0 |

Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

[Orama](#orama-orama), whose count also covers full-text search, has the most monthly downloads in this comparison, at 7.9M.

## Capabilities

| Library | In-process database | PostgreSQL type adapter |
| --- | --- | --- |
| [Orama](#orama-orama) | Yes | No |
| [Pinecone TypeScript SDK](#pinecone) | No | No |
| [pgvector-node](#pgvector) | No | Yes |
| [@qdrant/js-client-rest](#qdrant-rest-client) | No | No |
| [LanceDB](#lancedb-lancedb) | Yes | No |
| [weaviate-client](#weaviate-client) | No | No |
| [chromadb](#chroma) | No | No |
| [@zilliz/milvus2-sdk-node](#zilliz-milvustwo-sdk-node) | No | No |

## Libraries

### Orama

[GitHub](https://github.com/oramasearch/orama) · [npm](https://www.npmjs.com/package/@orama/orama) · [Docs](https://raw.githubusercontent.com/oramasearch/docs/main/content/docs/orama-js/search/vector-search.mdx)

Performs vector search natively as an embedded database.

- Downloads / mo: 7.9M
- Stars: 10.6K
- Last release: 3.1.18
- License: Apache-2.0
- Capabilities: [From the Orama docs](https://raw.githubusercontent.com/oramasearch/docs/main/content/docs/orama-js/search/vector-search.mdx)

```sh
npm install @orama/orama@3.1.18
```

**joybro/obsidian-similar-notes** (109 stars)

[joybro/obsidian-similar-notes](https://github.com/joybro/obsidian-similar-notes) 

```typescript
async init(
    vectorSize: number,
    vaultId: string,
    loadExistingData: boolean
): Promise<void> {
    this.vectorSize = vectorSize;
    this.db = null;
    this.pathsWithoutTitleChunk = [];
    this.schema = {
        path: "string",
        pathHash: "string",
        title: "string",
        embedding: `vector[${this.vectorSize}]`,
        lastUpdated: "number",
        content: "string",
        chunkIndex: "number",
        totalChunks: "number",
    } as const;

    try {
        // Initialize IndexedDB storage with vault-specific ID
        this.storage = new IndexedDBChunkStorage();
        await this.storage.init(vaultId);

        if (!loadExistingData) {
            // Reindex scenario: clear IndexedDB to start fresh
            await this.storage.clear();
            log.info("Cleared IndexedDB for reindexing");
        }

        // Create empty Orama database
        const db = create({
            schema: this.schema,
        });
        this.db = db;

        if (loadExistingData) {
            // Load data from IndexedDB in batches
            log.info("Loading chunks from IndexedDB...");
            let loadedCount = 0;
            const bodyPaths = new Set<string>();
            const titledPaths = new Set<string>();
            await this.storage.loadInBatches(
                100,
                async (batch) => {
                    for (const chunk of batch) {
                        (chunk.chunkIndex < 0 ? titledPaths : bodyPaths).add(
                            chunk.path
                        );
                    }
                    await insertMultiple(db, batch as Doc[]);
                },
                (processed, total) => {
                    loadedCount = processed;
                    if (processed % 500 === 0 || processed === total) {
                        log.info(
                            `Loaded ${processed}/${total} chunks from IndexedDB`
                        );
                    }
                }
            );

            log.info(
                `Successfully loaded ${loadedCount} chunks from IndexedDB`
            );
            this.pathsWithoutTitleChunk = [...bodyPaths].filter(
                (path) => !titledPaths.has(path)
            );
        } else {
            log.info("Starting with empty database for reindexing");
        }
    } catch (error) {
        log.error("Failed to initialize database", error);
        throw error;
    }
}

```

[src/adapter/orama/OramaDatabase.ts](https://github.com/joybro/obsidian-similar-notes/blob/78944243e60f69548228c9d7d8e87823e2d52087/src/adapter/orama/OramaDatabase.ts#L45) · [More projects using Orama →](https://dashboard.exa.ai/playground/search?q=%40orama/orama%20GitHub%20projects)

**Quickstart**

```typescript
import { create, insert, search } from "@orama/orama";
const db = create({ schema: { text: "string", embedding: "vector[3]" } });
await insert(db, { id: "doc-1", text: "Example document", embedding: [1, 0, 0] });
const result = await search(db, {
  mode: "vector", vector: { property: "embedding", value: [1, 0, 0] },
});
console.log(result.hits);

```

From [vector-search.mdx](https://raw.githubusercontent.com/oramasearch/docs/main/content/docs/orama-js/search/vector-search.mdx)

### Pinecone TypeScript SDK

[GitHub](https://github.com/pinecone-io/pinecone-ts-client) · [npm](https://www.npmjs.com/package/@pinecone-database/pinecone) · [Docs](https://sdk.pinecone.io/typescript/classes/Pinecone.html)

Provides typed APIs for Pinecone indexes, document records, and vector queries.

- Downloads / mo: 4.2M
- Stars: 279
- Last release: 9.2.0
- License: Apache-2.0
- Capabilities: [From the Pinecone TypeScript SDK docs](https://sdk.pinecone.io/typescript/classes/Pinecone.html)

**Strengths**

- **Scopes data by namespace.** Select a namespace before querying or updating its records.
- **Accepts vectors or hosted embeddings.** Bring numeric vectors or use a supported hosted embedding model.

**Watch out for**

- **Vector metadata excludes nested objects.** Use flat key-value pairs for legacy vector-index metadata.
- **Document searches rank one signal.** Fuse separate ranked lists to combine several ranking signals.

```sh
npm install @pinecone-database/pinecone@9.2.0
```

**langchain-ai/langchainjs** (18.4K stars)

[langchain-ai/langchainjs](https://github.com/langchain-ai/langchainjs) 

```typescript
protected async _runPineconeQuery(
  query: number[],
  k: number,
  filter?: PineconeMetadata,
  options?: { includeValues: boolean }
) {
  if (filter && this.filter) {
    throw new Error("cannot provide both `filter` and `this.filter`");
  }
  let _filter = filter ?? this.filter;

  let optionsNamespace = this.namespace ?? "";
  if (_filter && "namespace" in _filter) {
    optionsNamespace = _filter.namespace;
    delete _filter.namespace;
  }

  if (Object.keys(_filter ?? {}).length === 0) {
    _filter = undefined;
  }

  const namespace = this.pineconeIndex.namespace(optionsNamespace ?? "");

  const results = await namespace.query({
    includeMetadata: true,
    topK: k,
    vector: query,
    filter: _filter,
    ...options,
  });
  return results;
}

```

[libs/providers/langchain-pinecone/src/vectorstores.ts](https://github.com/langchain-ai/langchainjs/blob/20a9abea23ffacf4ae8dc9a7aeec217143bbdeb6/libs/providers/langchain-pinecone/src/vectorstores.ts#L385) · [More projects using Pinecone TypeScript SDK →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20application%20%40pinecone-database/pinecone%20vector%20database%20collection%20index%20metadata%20filtered%20query%20SDK&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
import { Pinecone } from "@pinecone-database/pinecone";
const client = new Pinecone();
console.log(await client.listIndexes());

```

From [README.md](https://sdk.pinecone.io/typescript/classes/Pinecone.html)

### pgvector-node

[GitHub](https://github.com/pgvector/pgvector-node) · [npm](https://www.npmjs.com/package/pgvector) · [Docs](https://github.com/pgvector/pgvector-node/blob/v0.3.1/README.md)

Adds pgvector support to Node.js, Deno, and Bun.

- Downloads / mo: 4.1M
- Stars: 446
- Last release: 0.3.1
- License: MIT
- Capabilities: [From the pgvector-node docs](https://github.com/pgvector/pgvector-node/blob/v0.3.1/README.md)

```sh
npm install pgvector@0.3.1 pg
```

**mdn/yari** (1.3K stars)

[mdn/yari](https://github.com/mdn/yari) 

```typescript
export async function updateEmbeddings(
  directory: string,
  updateFormatting: boolean,
  usePlainHtml: boolean
) {
  if (!OPENAI_KEY || !PG_URI) {
    throw Error("Please set these environment variables: OPENAI_KEY, PG_URI");
  }

  // Postgres.
  const pgClient = new pg.Client({
    connectionString: PG_URI,
  });

  await pgClient.connect();
  await pgClient.query("CREATE EXTENSION IF NOT EXISTS vector");
  await pgvector.registerType(pgClient);

  // Open AI.
  const openai = new OpenAI({
    apiKey: OPENAI_KEY,
  });

  const createEmbedding = async (input: string, model: string) => {
    let embeddingResponse: OpenAI.Embeddings.CreateEmbeddingResponse;
    try {
      embeddingResponse = await openai.embeddings.create({
        model,
        input,
      });
    } catch ({ error: { message, type }, status }: any) {
      console.error(
        `[!] Failed to create embedding (${status}): ${type} - ${message}`
      );
      // Try again with trimmed content.
      embeddingResponse = await openai.embeddings.create({
        model,
        input: input.substring(0, 15000),
      });
    }

    const {
      data: [{ embedding }],
      usage: { total_tokens },
    } = embeddingResponse;

    return {
      total_tokens,
      embedding,
    };
  };

  console.log(`Retrieving all indexed documents...`);
  const existingDocs = await fetchAllExistingDocs(pgClient);
  console.log(`-> Done.`);

  const existingDocByUrl = new Map<string, IndexedDoc>(
    existingDocs.map((doc) => [doc.mdn_url, doc])
  );

  console.log(`Determining changed and deleted documents...`);

  const seenUrls = new Set<string>();
  const updates: Doc[] = [];
  const formattingUpdates: FormattingUpdate[] = [];
  const embeddingUpdates: EmbeddingUpdate[] = [];

  for await (const { mdn_url, title, title_short, markdown, text } of builtDocs(
    directory,
    usePlainHtml
  )) {
    seenUrls.add(mdn_url);

    // Check for existing document in DB and compare checksums.
    const existingDoc = existingDocByUrl.get(mdn_url);

    const text_hash = createHash("sha256").update(text).digest("base64");
    const markdown_hash = createHash("sha256")
      .update(markdown)
      .digest("base64");

    if (existingDoc?.text_hash !== text_hash) {
      // Document added or content changed => (re)generate embeddings.
      updates.push({
        mdn_url,
        title,
        title_short,
        markdown,
        markdown_hash,
        text,
        text_hash,
      });
    } else {
      if (updateFormatting || existingDoc?.markdown_hash !== markdown_hash) {
        // Document formatting changed => update markdown.
        formattingUpdates.push({
          mdn_url,
          title,
          title_short,
          markdown,
          markdown_hash,
        });
      }

      if (
        !existingDoc.has_embedding ||
        !existingDoc.has_embedding_next !== !EMBEDDING_MODEL_NEXT
      ) {
        // Embedding missing => add embeddings.
        const { has_embedding, has_embedding_next } = existingDoc;
        embeddingUpdates.push({
          mdn_url,
          text,
          has_embedding,
          has_embedding_next,
        });
      }
    }
  }

  console.log(
    `-> ${updates.length} (${formattingUpdates.length}) of ${seenUrls.size} documents were changed or added (or formatted).`
  );
  if (embeddingUpdates.length > 0) {
    console.log(
      `-> ${embeddingUpdates.length} documents have outdated embeddings.`
    );
  }

  const deletions: IndexedDoc[] = [...existingDocByUrl.entries()]
    .filter(([key]) => !seenUrls.has(key))
    .map(([, value]) => value);
  console.log(
    `-> ${deletions.length} of ${existingDocs.length} indexed documents were deleted (or moved).`
  );

  if (
    updates.length > 0 ||
    formattingUpdates.length > 0 ||
    embeddingUpdates.length > 0
  ) {
    console.log(`Applying updates...`);
    for (const {
      mdn_url,
      title,
      title_short,
      markdown,
      markdown_hash,
      text,
      text_hash,
    } of updates) {
      try {
        console.log(`-> [${mdn_url}] Updating document...`);

        // Embedding for full document.
        const [{ total_tokens, embedding }, embedding_next] = await Promise.all(
          [
            createEmbedding(text, EMBEDDING_MODEL),
            EMBEDDING_MODEL_NEXT && EMBEDDING_MODEL_NEXT !== EMBEDDING_MODEL
              ? createEmbedding(text, EMBEDDING_MODEL_NEXT).then(
                  ({ embedding }) => embedding
                )
              : null,
          ]
        );

        // Create/update document record.
        const query = {
          name: "upsert-embedding-doc",
          text: `
            INSERT INTO mdn_doc_macro(
                    mdn_url,
                    title,
                    title_short,
                    markdown,
                    markdown_hash,
                    token_count,
                    embedding,
                    embedding_next,
                    text_hash
                )
            VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9) ON CONFLICT (mdn_url) DO
            UPDATE
            SET mdn_url = $1,
                title = $2,
                title_short = $3,
                markdown = $4,
                markdown_hash = $5,
                token_count = $6,
                embedding = $7,
                embedding_next = $8,
                text_hash = $9
          `,
          values: [
            mdn_url,
            title,
            title_short,
            markdown,
            markdown_hash,
            total_tokens,
            pgvector.toSql(embedding),
            pgvector.toSql(embedding_next ?? embedding),
            text_hash,
          ],
          rowMode: "array",
        };

        await pgClient.query(query);
      } catch (err: any) {
        console.error(`!> [${mdn_url}] Failed to update document.`);
        const context = err?.response?.data ?? err?.response ?? err;
        console.error(context);
      }
    }

    for (const {
      mdn_url,
      title,
      title_short,
      markdown,
      markdown_hash,
    } of formattingUpdates) {
      try {
        console.log(
          `-> [${mdn_url}] Updating document without generating new embedding...`
        );

        // Create/update document record.
        const query = {
          name: "upsert-doc",
          text: `
            INSERT INTO mdn_doc_macro(mdn_url, title, title_short, markdown, markdown_hash)
            VALUES($1, $2, $3, $4, $5) ON CONFLICT (mdn_url) DO
            UPDATE
            SET mdn_url = $1,
                title = $2,
                title_short = $3,
                markdown = $4,
                markdown_hash = $5
          `,
          values: [mdn_url, title, title_short, markdown, markdown_hash],
          rowMode: "array",
        };

        await pgClient.query(query);
      } catch (err: any) {
        console.error(`!> [${mdn_url}] Failed to update document.`);
        const context = err?.response?.data ?? err?.response ?? err;
        console.error(context);
      }
    }

    for (const {
      mdn_url,
      text,
      has_embedding,
      has_embedding_next,
    } of embeddingUpdates) {
      try {
        console.log(`-> [${mdn_url}] Updating embeddings...`);

        if (!has_embedding) {
          const { total_tokens, embedding } = await createEmbedding(
            text,
            EMBEDDING_MODEL
          );

          const query = {
            name: "upsert-doc-embedding",
            text: "UPDATE mdn_doc_macro SET total_tokens = $2, embedding = $3 WHERE mdn_url = $1",
            values: [
              mdn_url,
              total_tokens,
              embedding ? pgvector.toSql(embedding) : null,
            ],
            rowMode: "array",
          };

          await pgClient.query(query);
        }

        if (!has_embedding_next) {
          const embedding = EMBEDDING_MODEL_NEXT
            ? (await createEmbedding(text, EMBEDDING_MODEL_NEXT)).embedding
            : null;

          const query = {
            name: "upsert-doc-embedding-next",
            text: "UPDATE mdn_doc_macro SET embedding_next = $2 WHERE mdn_url = $1",
            values: [mdn_url, embedding ? pgvector.toSql(embedding) : null],
            rowMode: "array",
          };

          await pgClient.query(query);
        }
      } catch (err: any) {
        console.error(`!> [${mdn_url}] Failed to add embeddings.`);
        const context = err?.response?.data ?? err?.response ?? err;
        console.error(context);
      }
    }

    console.log(`-> Done.`);
  }

  if (deletions.length > 0) {
    console.log(`Applying deletions...`);
    for (const { id, mdn_url } of deletions) {
      console.log(`-> [${mdn_url}] Deleting indexed document...`);
      const query = {
        name: "delete-doc",
        text: `DELETE from mdn_doc_macro WHERE id = $1`,
        values: [id],
        rowMode: "array",
      };

      await pgClient.query(query);
    }
    console.log(`-> Done.`);
  }
  pgClient.end();
}

```

[scripts/ai-help-macros.ts](https://github.com/mdn/yari/blob/ab93f163ac378bded4c4dafac7a2f79db24b3ec1/scripts/ai-help-macros.ts#L62) · [More projects using pgvector-node →](https://dashboard.exa.ai/playground/search?q=pgvector%20GitHub%20projects)

**Quickstart**

```typescript
import pg from "pg";
import pgvector from "pgvector/pg";
const client = new pg.Client({ connectionString: process.env.DATABASE_URL });
await client.connect();
await pgvector.registerTypes(client);
const result = await client.query("SELECT $1::vector AS embedding", [pgvector.toSql([1, 2, 3])]);
console.log(result.rows[0].embedding);
await client.end();

```

From [README.md](https://github.com/pgvector/pgvector-node/blob/v0.3.1/README.md)

### @qdrant/js-client-rest

[GitHub](https://github.com/qdrant/qdrant-js) · [npm](https://www.npmjs.com/package/@qdrant/js-client-rest) · [Docs](https://raw.githubusercontent.com/qdrant/qdrant-js/v1.20.0/packages/js-client-rest/src/qdrant-client.ts)

Provides a JavaScript REST client for the Qdrant vector search engine.

- Downloads / mo: 3.7M
- Stars: 473
- Last release: 1.20.0
- License: Apache-2.0
- Capabilities: [From the @qdrant/js-client-rest docs](https://raw.githubusercontent.com/qdrant/qdrant-js/v1.20.0/packages/js-client-rest/src/qdrant-client.ts)

**Strengths**

- **Searches vectors with payload filters.** Apply record conditions alongside a vector query.
- **Combines multiple retrieval stages.** Fuse dense and sparse results or rerank prefetched candidates.

**Watch out for**

- **Vector fields need matching dimensions.** Match stored vectors to their configured size and distance metric.

```sh
npm install @qdrant/js-client-rest@1.20.0
```

**langchain-ai/langchainjs** (18.4K stars)

[langchain-ai/langchainjs](https://github.com/langchain-ai/langchainjs) 

```typescript
async ensureCollection() {
  const response = await this.client.getCollections();

  const collectionNames = response.collections.map(
    (collection) => collection.name
  );

  if (!collectionNames.includes(this.collectionName)) {
    const collectionConfig = this.collectionConfig ?? {
      vectors: {
        size: (await this.embeddings.embedQuery("test")).length,
        distance: "Cosine",
      },
    };
    await this.client.createCollection(this.collectionName, collectionConfig);
  }
}

```

[libs/providers/langchain-qdrant/src/vectorstores.ts](https://github.com/langchain-ai/langchainjs/blob/20a9abea23ffacf4ae8dc9a7aeec217143bbdeb6/libs/providers/langchain-qdrant/src/vectorstores.ts#L321) · [More projects using @qdrant/js-client-rest →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20application%20%40qdrant/js-client-rest%20vector%20database%20collection%20index%20metadata%20filtered%20query%20SDK&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
import { QdrantClient } from "@qdrant/js-client-rest";
const client = new QdrantClient({ url: "http://localhost:6333" });
console.log(await client.getCollections());

```

From [qdrant-client.ts](https://raw.githubusercontent.com/qdrant/qdrant-js/v1.20.0/packages/js-client-rest/src/qdrant-client.ts)

### LanceDB

[GitHub](https://github.com/lancedb/lancedb) · [npm](https://www.npmjs.com/package/@lancedb/lancedb) · [Docs](https://lancedb.com/docs/quickstart/)

Stores records in tables inside a LanceDB database.

- Downloads / mo: 2.4M
- Stars: 11.9K
- Last release: 0.41.0
- License: Apache-2.0
- Capabilities: [From the LanceDB docs](https://lancedb.com/docs/quickstart/)

```sh
npm install @lancedb/lancedb@0.41.0
```

**Mintplex-Labs/anything-llm** (68.4K stars)

[Mintplex-Labs/anything-llm](https://github.com/Mintplex-Labs/anything-llm) 

```typescript
async similarityResponse({
  client,
  namespace,
  queryVector,
  similarityThreshold = 0.25,
  topN = 4,
  filterIdentifiers = [],
}) {
  const collection = await client.openTable(namespace);
  const result = {
    contextTexts: [],
    sourceDocuments: [],
    scores: [],
  };

  const response = await collection
    .vectorSearch(queryVector)
    .distanceType("cosine")
    .limit(topN)
    .toArray();

  response.forEach((item) => {
    if (this.distanceToSimilarity(item._distance) < similarityThreshold)
      return;
    const { vector: _, ...rest } = item;
    if (filterIdentifiers.includes(sourceIdentifier(rest))) {
      this.logger(
        "A source was filtered from context as it's parent document is pinned."
      );
      return;
    }

    result.contextTexts.push(rest.text);
    result.sourceDocuments.push({
      ...rest,
      score: this.distanceToSimilarity(item._distance),
    });
    result.scores.push(this.distanceToSimilarity(item._distance));
  });

  return result;
}

```

[server/utils/vectorDbProviders/lance/index.js](https://github.com/Mintplex-Labs/anything-llm/blob/194b8f03c5cf21ab4620a6c991ff3f6688c00a80/server/utils/vectorDbProviders/lance/index.js#L189) · [More projects using LanceDB →](https://dashboard.exa.ai/playground/search?q=%40lancedb/lancedb%20GitHub%20projects)

**Quickstart**

```typescript
import { connect } from "@lancedb/lancedb";
const db = await connect("./library-vectors");
const table = await db.createTable("library_starter", [
  { id: "doc-1", text: "Example document", vector: [1, 0, 0] },
]);
console.log(table.name);

```

From [README.md](https://lancedb.com/docs/quickstart/)

### weaviate-client

[GitHub](https://github.com/weaviate/typescript-client) · [npm](https://www.npmjs.com/package/weaviate-client) · [Docs](https://registry.npmjs.org/weaviate-client/latest)

Provides a JavaScript and TypeScript client for Weaviate.

- Downloads / mo: 1.9M
- Stars: 101
- Last release: 3.15.3
- License: BSD-3-Clause
- Capabilities: [From the weaviate-client docs](https://registry.npmjs.org/weaviate-client/latest)

```sh
npm install weaviate-client@3.15.3
```

**langchain-ai/langchainjs** (18.4K stars)

[langchain-ai/langchainjs](https://github.com/langchain-ai/langchainjs) 

```typescript
async hybridSearch(
  query: string,
  options?: HybridOptions<undefined, undefined, undefined> & {
    filter?: FilterValue;
  }
): Promise<Document[]> {
  const collection = this.client.collections.get(this.indexName);
  let query_vector: number[] | undefined;
  if (!options?.vector) {
    query_vector = await this.embeddings.embedQuery(query);
  }

  const options_with_vector = {
    ...(options ?? {}),
    filters: options?.filters ?? options?.filter,
    vector: options?.vector || query_vector,
    returnMetadata: [
      "score",
      ...((options?.returnMetadata as MetadataKeys) || []),
    ] as MetadataKeys,
  };
  let result;
  if (this.tenant) {
    result = await collection.withTenant(this.tenant).query.hybrid(query, {
      ...options_with_vector,
    });
  } else {
    result = await collection.query.hybrid(query, {
      ...options_with_vector,
    });
  }
  const documents: Document[] = [];

  for (const data of result.objects) {
    const { properties = {}, metadata = {} } = data ?? {};
    const { [this.textKey]: text, ...rest } = properties;

    documents.push(
      new Document({
        pageContent: String(text ?? ""),
        metadata: {
          ...rest,
          ...metadata,
        },
        id: data.uuid,
      })
    );
  }
  return documents;
}

```

[libs/providers/langchain-weaviate/src/vectorstores.ts](https://github.com/langchain-ai/langchainjs/blob/c66870ea8ebf9e3b0794ab8d969b25dfb189f2de/libs/providers/langchain-weaviate/src/vectorstores.ts#L360) · [More projects using weaviate-client →](https://dashboard.exa.ai/playground/search?q=weaviate-client%20GitHub%20projects)

**Quickstart**

```typescript
import { connectToLocal } from "weaviate-client";
const client = await connectToLocal();
try {
  console.log(await client.getMeta());
} finally {
  await client.close();
}

```

From [index.d.ts](https://app.unpkg.com/weaviate-client@3.15.3/files/dist/node/esm/index.d.ts)

### chromadb

[GitHub](https://github.com/chroma-core/chroma) · [npm](https://www.npmjs.com/package/chromadb) · [Docs](https://docs.trychroma.com/reference/js/collection)

Provides a JavaScript interface for Chroma collections.

- Downloads / mo: 1.1M
- Stars: 29.7K
- Last release: 3.5.0
- License: Apache-2.0
- Capabilities: [From the chromadb docs](https://docs.trychroma.com/reference/js/collection)

**Strengths**

- **Stores documents with their embeddings.** Keep IDs, documents, and metadata alongside indexed vectors.
- **Offers reusable embedding functions.** Attach an embedding function or supply embeddings directly.

**Watch out for**

- **Hybrid search requires Chroma Cloud.** Use collection.query for ordinary local vector search.
- **Query vectors must match dimensions.** Use the same embedding dimensions as the collection.

```sh
npm install chromadb@3.5.0
```

**mem0ai/mem0** (69.1K stars)

[mem0ai/mem0](https://github.com/mem0ai/mem0) 

```typescript
async search(
  query: number[],
  topK: number = 5,
  filters?: SearchFilters,
): Promise<VectorStoreResult[]> {
  const collection = await this.getCollection();
  const where = ChromaDB.generateWhereClause(filters);
  const results = await collection.query({
    queryEmbeddings: [query],
    nResults: topK,
    where: where as any,
  });
  return this.parseOutput(results);
}

```

[mem0-ts/src/oss/src/vector_stores/chroma.ts](https://github.com/mem0ai/mem0/blob/f1791daa86d469249c9b002f62644d58a1eb96a0/mem0-ts/src/oss/src/vector_stores/chroma.ts#L163) · [More projects using chromadb →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20application%20chromadb%20vector%20database%20collection%20index%20metadata%20filtered%20query%20SDK&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
import { ChromaClient } from "chromadb";
const client = new ChromaClient({ host: "localhost", port: 8000 });
console.log(await client.heartbeat());

```

From [getting-started.mdx](https://docs.trychroma.com/reference/js/collection)

### @zilliz/milvus2-sdk-node

[GitHub](https://github.com/milvus-io/milvus-sdk-node) · [npm](https://www.npmjs.com/package/@zilliz/milvus2-sdk-node) · [Docs](https://registry.npmjs.org/%40zilliz%2Fmilvus2-sdk-node/latest)

Provides gRPC and HTTP clients for Milvus similarity search, metadata filtering, and collection management.

- Downloads / mo: 866.5K
- Stars: 199
- Last release: 3.0.8
- License: Apache-2.0
- Capabilities: [From the @zilliz/milvus2-sdk-node docs](https://registry.npmjs.org/%40zilliz%2Fmilvus2-sdk-node/latest)

```sh
npm install @zilliz/milvus2-sdk-node@3.0.8
```

**mem0ai/mem0** (69.1K stars)

[mem0ai/mem0](https://github.com/mem0ai/mem0) 

```typescript
async search(
  query: number[],
  topK: number = 5,
  filters?: SearchFilters,
): Promise<VectorStoreResult[]> {
  const filter = this.createFilter(filters);
  const req: Record<string, any> = {
    collection_name: this.collectionName,
    data: [query],
    limit: topK,
    filter,
    output_fields: ["*"],
  };
  // A BM25 collection has both a dense `vectors` and a sparse `sparse` field,
  // so anns_field is ambiguous unless we name the dense one explicitly.
  if (this.hasBm25Schema) req.anns_field = "vectors";
  const res = await this.client.search(req);
  return this.parseHits(res?.results || []);
}

```

[mem0-ts/src/oss/src/vector_stores/milvus.ts](https://github.com/mem0ai/mem0/blob/ca2abca2b884e038d3e525070e79d3057ef2012c/mem0-ts/src/oss/src/vector_stores/milvus.ts#L317) · [More projects using @zilliz/milvus2-sdk-node →](https://dashboard.exa.ai/playground/search?q=%40zilliz/milvus2-sdk-node%20GitHub%20projects)

**Quickstart**

```typescript
import { MilvusClient } from "@zilliz/milvus2-sdk-node";
const client = new MilvusClient({ address: "localhost:19530" });
console.log(await client.showCollections());

```

From [README.md](https://registry.npmjs.org/%40zilliz%2Fmilvus2-sdk-node/latest)

## FAQ

### Which JavaScript vector database library should I use?

[Pinecone](#pinecone) suits teams that want a managed vector service. [pgvector-node](#pgvector) suits apps that already store data in PostgreSQL. [Orama](#orama-orama) and [LanceDB](#lancedb-lancedb) suit embedded search that runs inside the application.

### What is a vector database?

A vector database stores embeddings and returns the stored items nearest to a query embedding. An embedding is a list of numbers that a model produces to represent the meaning of text or images.

### What is Qdrant?

[Qdrant](#qdrant-rest-client) is an open-source vector search engine. Its JavaScript REST client manages collections and runs vector queries with payload filters.

### What is LanceDB?

[LanceDB](#lancedb-lancedb) is an embedded vector database that keeps tables of records on local disk or object storage. Its Node.js package runs inside the application process.

### What is pgvector?

pgvector is a PostgreSQL extension that adds a vector column type and nearest-neighbor search. [pgvector-node](#pgvector) adds support for that type in Node.js, Deno, and Bun.

### Pinecone vs Qdrant: which should I use?

[Pinecone](#pinecone) runs only as a managed cloud service. [Qdrant](#qdrant-rest-client) is open source and runs self-hosted or as a managed cloud.

## How this page was built

Data checked Nov 20, 2026.

Reproduce it with the Exa API:

```json
{
  "endpoint": "/search",
  "body": {
    "query": "Best JavaScript vector database libraries Qdrant Pinecone Weaviate Chroma code examples",
    "numResults": 5
  }
}
```

Docs: https://exa.ai/docs/reference/search
