Class: QdrantVectorStore
Qdrant vector store.
Implements
Constructors
constructor
• new QdrantVectorStore(«destructured»
): QdrantVectorStore
Creates a new QdrantVectorStore.
Parameters
Name | Type |
---|---|
«destructured» | QdrantParams |
Returns
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:53
Properties
batchSize
• batchSize: number
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:39
collectionInitialized
• Private
collectionInitialized: boolean
= false
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:43
collectionName
• collectionName: string
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:40
db
• Private
db: QdrantClient
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:42
storesText
• storesText: boolean
= true
Implementation of
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:37
Methods
add
▸ add(embeddingResults
): Promise
<string
[]>
Adds the given nodes to the vector store.
Parameters
Name | Type | Description |
---|---|---|
embeddingResults | BaseNode <Metadata >[] | List of nodes |
Returns
Promise
<string
[]>
List of node IDs
Implementation of
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:180
buildPoints
▸ buildPoints(nodes
): Promise
<{ ids
: string
[] ; points
: PointStruct
[] }>
Builds a list of points from the given nodes.
Parameters
Name | Type |
---|---|
nodes | BaseNode <Metadata >[] |
Returns
Promise
<{ ids
: string
[] ; points
: PointStruct
[] }>
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:132
buildQueryFilter
▸ buildQueryFilter(query
): Promise
<null
| { must
: ({ key
: string
= "doc_id"; match
: { any
: string
[] = query.docIds; gt?
: undefined
= filter.value; lt?
: undefined
= filter.value; value?
: undefined
= filter.value } } | { key
: never
= filter.key; match
: { any?
: undefined
= query.docIds; gt
: string
| number
= filter.value; lt
: string
| number
= filter.value; value?
: undefined
= filter.value } } | { key
: string
= filter.key; match
: { any?
: undefined
= query.docIds; gt?
: undefined
= filter.value; lt?
: undefined
= filter.value; value
: string
| number
= filter.value } })[] = mustConditions }>
Qdrant filter builder
Parameters
Name | Type | Description |
---|---|---|
query | VectorStoreQuery | The VectorStoreQuery to be used |
Returns
Promise
<null
| { must
: ({ key
: string
= "doc_id"; match
: { any
: string
[] = query.docIds; gt?
: undefined
= filter.value; lt?
: undefined
= filter.value; value?
: undefined
= filter.value } } | { key
: never
= filter.key; match
: { any?
: undefined
= query.docIds; gt
: string
| number
= filter.value; lt
: string
| number
= filter.value; value?
: undefined
= filter.value } } | { key
: string
= filter.key; match
: { any?
: undefined
= query.docIds; gt?
: undefined
= filter.value; lt?
: undefined
= filter.value; value
: string
| number
= filter.value } })[] = mustConditions }>
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:291
client
▸ client(): QdrantClient
Returns the Qdrant client.
Returns
QdrantClient
Qdrant client
Implementation of
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:83
collectionExists
▸ collectionExists(collectionName
): Promise
<boolean
>
Checks if the collection exists in Qdrant and creates it if not.
Parameters
Name | Type | Description |
---|---|---|
collectionName | string | Qdrant collection name |
Returns
Promise
<boolean
>
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:106
createCollection
▸ createCollection(collectionName
, vectorSize
): Promise
<void
>
Creates a collection in Qdrant.
Parameters
Name | Type | Description |
---|---|---|
collectionName | string | Qdrant collection name |
vectorSize | number | Dimensionality of the vectors |
Returns
Promise
<void
>
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:92
delete
▸ delete(refDocId
): Promise
<void
>
Deletes the given nodes from the vector store.
Parameters
Name | Type | Description |
---|---|---|
refDocId | string | Node ID |
Returns
Promise
<void
>
Implementation of
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:207
initializeCollection
▸ initializeCollection(vectorSize
): Promise
<void
>
Initializes the collection in Qdrant.
Parameters
Name | Type | Description |
---|---|---|
vectorSize | number | Dimensionality of the vectors |
Returns
Promise
<void
>
Defined in
packages/core/src/storage/vectorStore/QdrantVectorStore.ts:119
parseToQueryResult
▸ parseToQueryResult(response
): VectorStoreQueryResult
Converts the result of a query to a VectorStoreQueryResult.
Parameters
Name | Type | Description |
---|---|---|
response | QuerySearchResult [] | Query response |