mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
feat(Qdrant Vector Store Node): Qdrant vector store support (#8080)
## Summary This PR intends to add [Qdrant](https://qdrant.tech/) as a supported vectorstore node to load and retrieve documents from in a workflow. ## Review / Merge checklist - [x] PR title and summary are descriptive. - [x] Node/credentials documentation to be updated in https://github.com/n8n-io/n8n-docs/pull/1796. --------- Co-authored-by: oleg <me@olegivaniv.com> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -45,3 +45,26 @@ export const supabaseTableNameRLC: INodeProperties = {
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const qdrantCollectionRLC: INodeProperties = {
|
||||
displayName: 'Qdrant Collection',
|
||||
name: 'qdrantCollection',
|
||||
type: 'resourceLocator',
|
||||
default: { mode: 'list', value: '' },
|
||||
required: true,
|
||||
modes: [
|
||||
{
|
||||
displayName: 'From List',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
typeOptions: {
|
||||
searchListMethod: 'qdrantCollectionsSearch',
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ApplicationError, type IDataObject, type ILoadOptionsFunctions } from 'n8n-workflow';
|
||||
import { Pinecone } from '@pinecone-database/pinecone';
|
||||
import { QdrantClient } from '@qdrant/js-client-rest';
|
||||
|
||||
export async function pineconeIndexSearch(this: ILoadOptionsFunctions) {
|
||||
const credentials = await this.getCredentials('pineconeApi');
|
||||
@@ -49,3 +50,21 @@ export async function supabaseTableNameSearch(this: ILoadOptionsFunctions) {
|
||||
|
||||
return { results };
|
||||
}
|
||||
|
||||
export async function qdrantCollectionsSearch(this: ILoadOptionsFunctions) {
|
||||
const credentials = await this.getCredentials('qdrantApi');
|
||||
|
||||
const client = new QdrantClient({
|
||||
url: credentials.qdrantUrl as string,
|
||||
apiKey: credentials.apiKey as string,
|
||||
});
|
||||
|
||||
const response = await client.getCollections();
|
||||
|
||||
const results = response.collections.map((collection) => ({
|
||||
name: collection.name,
|
||||
value: collection.name,
|
||||
}));
|
||||
|
||||
return { results };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user