@vectorstores/qdrant 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -14,8 +14,8 @@ var core = require('@vectorstores/core');
14
14
  * @param apiKey Qdrant API key
15
15
  * @param batchSize Number of vectors to upload in a single batch
16
16
  * @param embedModel Embedding model
17
- */ constructor({ collectionName, client, url, apiKey, batchSize, ...init }){
18
- super(init), this.storesText = true, this.collectionInitialized = false;
17
+ */ constructor({ collectionName, client, url, apiKey, batchSize }){
18
+ super(), this.storesText = true, this.collectionInitialized = false;
19
19
  if (!client && !url) {
20
20
  if (!url) {
21
21
  throw new Error("QdrantVectorStore requires url and collectionName");
@@ -175,9 +175,6 @@ var core = require('@vectorstores/core');
175
175
  const qdrantSearchParams = options && "qdrant_search_params" in options ? options.qdrant_search_params : undefined;
176
176
  let queryFilters;
177
177
  let searchParams;
178
- if (!query.queryEmbedding) {
179
- throw new Error("No query embedding provided");
180
- }
181
178
  if (qdrantFilters) {
182
179
  queryFilters = qdrantFilters;
183
180
  } else {
@@ -188,8 +185,14 @@ var core = require('@vectorstores/core');
188
185
  } else {
189
186
  searchParams = buildSearchParams(query);
190
187
  }
188
+ const queryVector = query.queryEmbedding;
189
+ if (!queryVector) {
190
+ throw new Error("Qdrant vector search requires a dense query embedding, even when falling back from BM25 or HYBRID modes.");
191
+ }
192
+ // For now, Qdrant implementation only supports dense vector search.
193
+ // BM25 and HYBRID will fallback to dense vector search if no sparse vectors are configured.
191
194
  const result = await this.db.query(this.collectionName, {
192
- query: query.queryEmbedding,
195
+ query: queryVector,
193
196
  limit: query.similarityTopK,
194
197
  with_payload: true,
195
198
  with_vector: false,
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { QdrantClient, Schemas } from '@qdrant/js-client-rest';
2
- import { BaseVectorStore, VectorStoreBaseParams, BaseNode, VectorStoreQuery, VectorStoreQueryResult } from '@vectorstores/core';
2
+ import { BaseVectorStore, BaseNode, VectorStoreQuery, VectorStoreQueryResult } from '@vectorstores/core';
3
3
 
4
4
  type QdrantSearchParams = Schemas["SearchParams"];
5
5
  type PointStruct = {
@@ -13,7 +13,7 @@ type QdrantParams = {
13
13
  url?: string;
14
14
  apiKey?: string;
15
15
  batchSize?: number;
16
- } & VectorStoreBaseParams;
16
+ };
17
17
  /**
18
18
  * Qdrant vector store.
19
19
  */
@@ -32,7 +32,7 @@ declare class QdrantVectorStore extends BaseVectorStore {
32
32
  * @param batchSize Number of vectors to upload in a single batch
33
33
  * @param embedModel Embedding model
34
34
  */
35
- constructor({ collectionName, client, url, apiKey, batchSize, ...init }: QdrantParams);
35
+ constructor({ collectionName, client, url, apiKey, batchSize, }: QdrantParams);
36
36
  /**
37
37
  * Returns the Qdrant client.
38
38
  * @returns Qdrant client
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { QdrantClient, Schemas } from '@qdrant/js-client-rest';
2
- import { BaseVectorStore, VectorStoreBaseParams, BaseNode, VectorStoreQuery, VectorStoreQueryResult } from '@vectorstores/core';
2
+ import { BaseVectorStore, BaseNode, VectorStoreQuery, VectorStoreQueryResult } from '@vectorstores/core';
3
3
 
4
4
  type QdrantSearchParams = Schemas["SearchParams"];
5
5
  type PointStruct = {
@@ -13,7 +13,7 @@ type QdrantParams = {
13
13
  url?: string;
14
14
  apiKey?: string;
15
15
  batchSize?: number;
16
- } & VectorStoreBaseParams;
16
+ };
17
17
  /**
18
18
  * Qdrant vector store.
19
19
  */
@@ -32,7 +32,7 @@ declare class QdrantVectorStore extends BaseVectorStore {
32
32
  * @param batchSize Number of vectors to upload in a single batch
33
33
  * @param embedModel Embedding model
34
34
  */
35
- constructor({ collectionName, client, url, apiKey, batchSize, ...init }: QdrantParams);
35
+ constructor({ collectionName, client, url, apiKey, batchSize, }: QdrantParams);
36
36
  /**
37
37
  * Returns the Qdrant client.
38
38
  * @returns Qdrant client
@@ -1,5 +1,5 @@
1
1
  import { QdrantClient, Schemas } from '@qdrant/js-client-rest';
2
- import { BaseVectorStore, VectorStoreBaseParams, BaseNode, VectorStoreQuery, VectorStoreQueryResult } from '@vectorstores/core';
2
+ import { BaseVectorStore, BaseNode, VectorStoreQuery, VectorStoreQueryResult } from '@vectorstores/core';
3
3
 
4
4
  type QdrantSearchParams = Schemas["SearchParams"];
5
5
  type PointStruct = {
@@ -13,7 +13,7 @@ type QdrantParams = {
13
13
  url?: string;
14
14
  apiKey?: string;
15
15
  batchSize?: number;
16
- } & VectorStoreBaseParams;
16
+ };
17
17
  /**
18
18
  * Qdrant vector store.
19
19
  */
@@ -32,7 +32,7 @@ declare class QdrantVectorStore extends BaseVectorStore {
32
32
  * @param batchSize Number of vectors to upload in a single batch
33
33
  * @param embedModel Embedding model
34
34
  */
35
- constructor({ collectionName, client, url, apiKey, batchSize, ...init }: QdrantParams);
35
+ constructor({ collectionName, client, url, apiKey, batchSize, }: QdrantParams);
36
36
  /**
37
37
  * Returns the Qdrant client.
38
38
  * @returns Qdrant client
@@ -12,8 +12,8 @@ import { BaseVectorStore, nodeToMetadata, metadataDictToNode, FilterOperator, Fi
12
12
  * @param apiKey Qdrant API key
13
13
  * @param batchSize Number of vectors to upload in a single batch
14
14
  * @param embedModel Embedding model
15
- */ constructor({ collectionName, client, url, apiKey, batchSize, ...init }){
16
- super(init), this.storesText = true, this.collectionInitialized = false;
15
+ */ constructor({ collectionName, client, url, apiKey, batchSize }){
16
+ super(), this.storesText = true, this.collectionInitialized = false;
17
17
  if (!client && !url) {
18
18
  if (!url) {
19
19
  throw new Error("QdrantVectorStore requires url and collectionName");
@@ -173,9 +173,6 @@ import { BaseVectorStore, nodeToMetadata, metadataDictToNode, FilterOperator, Fi
173
173
  const qdrantSearchParams = options && "qdrant_search_params" in options ? options.qdrant_search_params : undefined;
174
174
  let queryFilters;
175
175
  let searchParams;
176
- if (!query.queryEmbedding) {
177
- throw new Error("No query embedding provided");
178
- }
179
176
  if (qdrantFilters) {
180
177
  queryFilters = qdrantFilters;
181
178
  } else {
@@ -186,8 +183,14 @@ import { BaseVectorStore, nodeToMetadata, metadataDictToNode, FilterOperator, Fi
186
183
  } else {
187
184
  searchParams = buildSearchParams(query);
188
185
  }
186
+ const queryVector = query.queryEmbedding;
187
+ if (!queryVector) {
188
+ throw new Error("Qdrant vector search requires a dense query embedding, even when falling back from BM25 or HYBRID modes.");
189
+ }
190
+ // For now, Qdrant implementation only supports dense vector search.
191
+ // BM25 and HYBRID will fallback to dense vector search if no sparse vectors are configured.
189
192
  const result = await this.db.query(this.collectionName, {
190
- query: query.queryEmbedding,
193
+ query: queryVector,
191
194
  limit: query.similarityTopK,
192
195
  with_payload: true,
193
196
  with_vector: false,
package/dist/index.js CHANGED
@@ -12,8 +12,8 @@ import { BaseVectorStore, nodeToMetadata, metadataDictToNode, FilterOperator, Fi
12
12
  * @param apiKey Qdrant API key
13
13
  * @param batchSize Number of vectors to upload in a single batch
14
14
  * @param embedModel Embedding model
15
- */ constructor({ collectionName, client, url, apiKey, batchSize, ...init }){
16
- super(init), this.storesText = true, this.collectionInitialized = false;
15
+ */ constructor({ collectionName, client, url, apiKey, batchSize }){
16
+ super(), this.storesText = true, this.collectionInitialized = false;
17
17
  if (!client && !url) {
18
18
  if (!url) {
19
19
  throw new Error("QdrantVectorStore requires url and collectionName");
@@ -173,9 +173,6 @@ import { BaseVectorStore, nodeToMetadata, metadataDictToNode, FilterOperator, Fi
173
173
  const qdrantSearchParams = options && "qdrant_search_params" in options ? options.qdrant_search_params : undefined;
174
174
  let queryFilters;
175
175
  let searchParams;
176
- if (!query.queryEmbedding) {
177
- throw new Error("No query embedding provided");
178
- }
179
176
  if (qdrantFilters) {
180
177
  queryFilters = qdrantFilters;
181
178
  } else {
@@ -186,8 +183,14 @@ import { BaseVectorStore, nodeToMetadata, metadataDictToNode, FilterOperator, Fi
186
183
  } else {
187
184
  searchParams = buildSearchParams(query);
188
185
  }
186
+ const queryVector = query.queryEmbedding;
187
+ if (!queryVector) {
188
+ throw new Error("Qdrant vector search requires a dense query embedding, even when falling back from BM25 or HYBRID modes.");
189
+ }
190
+ // For now, Qdrant implementation only supports dense vector search.
191
+ // BM25 and HYBRID will fallback to dense vector search if no sparse vectors are configured.
189
192
  const result = await this.db.query(this.collectionName, {
190
- query: query.queryEmbedding,
193
+ query: queryVector,
191
194
  limit: query.similarityTopK,
192
195
  with_payload: true,
193
196
  with_vector: false,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vectorstores/qdrant",
3
3
  "description": "Qdrant Storage for vectorstores",
4
- "version": "0.1.5",
4
+ "version": "0.1.7",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
@@ -35,11 +35,11 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "vitest": "^2.1.9",
38
- "@vectorstores/core": "0.1.5",
38
+ "@vectorstores/core": "0.1.7",
39
39
  "@vectorstores/env": "0.1.0"
40
40
  },
41
41
  "peerDependencies": {
42
- "@vectorstores/core": "0.1.5",
42
+ "@vectorstores/core": "0.1.7",
43
43
  "@vectorstores/env": "0.1.0"
44
44
  },
45
45
  "dependencies": {