mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
Merge pull request #179 from FlowiseAI/feature/MultiRetrievalChain
Feature/MultiRetrievalQAChain
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
import { BaseLanguageModel } from 'langchain/base_language'
|
||||
import { INode, INodeData, INodeParams, VectorStoreRetriever } from '../../../src/Interface'
|
||||
import { getBaseClasses } from '../../../src/utils'
|
||||
import { MultiRetrievalQAChain } from 'langchain/chains'
|
||||
|
||||
class MultiRetrievalQAChain_Chains implements INode {
|
||||
label: string
|
||||
name: string
|
||||
type: string
|
||||
icon: string
|
||||
category: string
|
||||
baseClasses: string[]
|
||||
description: string
|
||||
inputs: INodeParams[]
|
||||
|
||||
constructor() {
|
||||
this.label = 'Multi Retrieval QA Chain'
|
||||
this.name = 'multiRetrievalQAChain'
|
||||
this.type = 'MultiRetrievalQAChain'
|
||||
this.icon = 'chain.svg'
|
||||
this.category = 'Chains'
|
||||
this.description = 'QA Chain that automatically picks an appropriate vector store from multiple retrievers'
|
||||
this.baseClasses = [this.type, ...getBaseClasses(MultiRetrievalQAChain)]
|
||||
this.inputs = [
|
||||
{
|
||||
label: 'Language Model',
|
||||
name: 'model',
|
||||
type: 'BaseLanguageModel'
|
||||
},
|
||||
{
|
||||
label: 'Vector Store Retriever',
|
||||
name: 'vectorStoreRetriever',
|
||||
type: 'VectorStoreRetriever',
|
||||
list: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData): Promise<any> {
|
||||
const model = nodeData.inputs?.model as BaseLanguageModel
|
||||
const vectorStoreRetriever = nodeData.inputs?.vectorStoreRetriever as VectorStoreRetriever[]
|
||||
const retrieverNames = []
|
||||
const retrieverDescriptions = []
|
||||
const retrievers = []
|
||||
|
||||
for (const vs of vectorStoreRetriever) {
|
||||
retrieverNames.push(vs.name)
|
||||
retrieverDescriptions.push(vs.description)
|
||||
retrievers.push(vs.vectorStore.asRetriever())
|
||||
}
|
||||
|
||||
const chain = MultiRetrievalQAChain.fromRetrievers(model, retrieverNames, retrieverDescriptions, retrievers, undefined, {
|
||||
verbose: process.env.DEBUG === 'true' ? true : false
|
||||
} as any)
|
||||
|
||||
return chain
|
||||
}
|
||||
|
||||
async run(nodeData: INodeData, input: string): Promise<string> {
|
||||
const chain = nodeData.instance as MultiRetrievalQAChain
|
||||
|
||||
const res = await chain.call({ input })
|
||||
|
||||
return res?.text
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { nodeClass: MultiRetrievalQAChain_Chains }
|
||||
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-dna" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||
<path d="M14.828 14.828a4 4 0 1 0 -5.656 -5.656a4 4 0 0 0 5.656 5.656z"></path>
|
||||
<path d="M9.172 20.485a4 4 0 1 0 -5.657 -5.657"></path>
|
||||
<path d="M14.828 3.515a4 4 0 0 0 5.657 5.657"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 489 B |
@@ -0,0 +1,61 @@
|
||||
import { VectorStore } from 'langchain/vectorstores/base'
|
||||
import { INode, INodeData, INodeParams, VectorStoreRetriever, VectorStoreRetrieverInput } from '../../../src/Interface'
|
||||
|
||||
class VectorStoreRetriever_Retrievers implements INode {
|
||||
label: string
|
||||
name: string
|
||||
description: string
|
||||
type: string
|
||||
icon: string
|
||||
category: string
|
||||
baseClasses: string[]
|
||||
inputs: INodeParams[]
|
||||
|
||||
constructor() {
|
||||
this.label = 'Vector Store Retriever'
|
||||
this.name = 'vectorStoreRetriever'
|
||||
this.type = 'VectorStoreRetriever'
|
||||
this.icon = 'vectorretriever.svg'
|
||||
this.category = 'Retrievers'
|
||||
this.description = 'Store vector store as retriever to be later queried by MultiRetrievalQAChain'
|
||||
this.baseClasses = [this.type]
|
||||
this.inputs = [
|
||||
{
|
||||
label: 'Vector Store',
|
||||
name: 'vectorStore',
|
||||
type: 'VectorStore'
|
||||
},
|
||||
{
|
||||
label: 'Retriever Name',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
placeholder: 'netflix movies'
|
||||
},
|
||||
{
|
||||
label: 'Retriever Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
rows: 3,
|
||||
description: 'Description of when to use the vector store retriever',
|
||||
placeholder: 'Good for answering questions about netflix movies'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData): Promise<any> {
|
||||
const name = nodeData.inputs?.name as string
|
||||
const description = nodeData.inputs?.description as string
|
||||
const vectorStore = nodeData.inputs?.vectorStore as VectorStore
|
||||
|
||||
const obj = {
|
||||
name,
|
||||
description,
|
||||
vectorStore
|
||||
} as VectorStoreRetrieverInput
|
||||
|
||||
const retriever = new VectorStoreRetriever(obj)
|
||||
return retriever
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { nodeClass: VectorStoreRetriever_Retrievers }
|
||||
@@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-database-export" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||
<path d="M4 6c0 1.657 3.582 3 8 3s8 -1.343 8 -3s-3.582 -3 -8 -3s-8 1.343 -8 3"></path>
|
||||
<path d="M4 6v6c0 1.657 3.582 3 8 3c1.118 0 2.183 -.086 3.15 -.241"></path>
|
||||
<path d="M20 12v-6"></path>
|
||||
<path d="M4 12v6c0 1.657 3.582 3 8 3c.157 0 .312 -.002 .466 -.005"></path>
|
||||
<path d="M16 19h6"></path>
|
||||
<path d="M19 16l3 3l-3 3"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 647 B |
@@ -95,6 +95,7 @@ export interface IMessage {
|
||||
*/
|
||||
|
||||
import { PromptTemplate as LangchainPromptTemplate, PromptTemplateInput } from 'langchain/prompts'
|
||||
import { VectorStore } from 'langchain/vectorstores/base'
|
||||
|
||||
export class PromptTemplate extends LangchainPromptTemplate {
|
||||
promptValues: ICommonObject
|
||||
@@ -124,3 +125,21 @@ export class PromptRetriever {
|
||||
this.systemMessage = `${fields.systemMessage}\n${fixedTemplate}`
|
||||
}
|
||||
}
|
||||
|
||||
export interface VectorStoreRetrieverInput {
|
||||
name: string
|
||||
description: string
|
||||
vectorStore: VectorStore
|
||||
}
|
||||
|
||||
export class VectorStoreRetriever {
|
||||
name: string
|
||||
description: string
|
||||
vectorStore: VectorStore
|
||||
|
||||
constructor(fields: VectorStoreRetrieverInput) {
|
||||
this.name = fields.name
|
||||
this.description = fields.description
|
||||
this.vectorStore = fields.vectorStore
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,859 @@
|
||||
{
|
||||
"description": "A chain that automatically picks an appropriate retriever from multiple different vector databases",
|
||||
"nodes": [
|
||||
{
|
||||
"width": 300,
|
||||
"height": 505,
|
||||
"id": "vectorStoreRetriever_0",
|
||||
"position": {
|
||||
"x": 712.9322670298264,
|
||||
"y": 860.5462810572917
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "vectorStoreRetriever_0",
|
||||
"label": "Vector Store Retriever",
|
||||
"name": "vectorStoreRetriever",
|
||||
"type": "VectorStoreRetriever",
|
||||
"baseClasses": ["VectorStoreRetriever"],
|
||||
"category": "Retrievers",
|
||||
"description": "Store vector store as retriever. Used with MultiRetrievalQAChain",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Retriever Name",
|
||||
"name": "name",
|
||||
"type": "string",
|
||||
"placeholder": "netflix movies",
|
||||
"id": "vectorStoreRetriever_0-input-name-string"
|
||||
},
|
||||
{
|
||||
"label": "Retriever Description",
|
||||
"name": "description",
|
||||
"type": "string",
|
||||
"rows": 3,
|
||||
"description": "Description of when to use the vector store retriever",
|
||||
"placeholder": "Good for answering questions about netflix movies",
|
||||
"id": "vectorStoreRetriever_0-input-description-string"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Vector Store",
|
||||
"name": "vectorStore",
|
||||
"type": "VectorStore",
|
||||
"id": "vectorStoreRetriever_0-input-vectorStore-VectorStore"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"vectorStore": "{{supabaseExistingIndex_0.data.instance}}",
|
||||
"name": "aqua teen",
|
||||
"description": "Good for answering questions about Aqua Teen Hunger Force theme song"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "vectorStoreRetriever_0-output-vectorStoreRetriever-VectorStoreRetriever",
|
||||
"name": "vectorStoreRetriever",
|
||||
"label": "VectorStoreRetriever",
|
||||
"type": "VectorStoreRetriever"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 712.9322670298264,
|
||||
"y": 860.5462810572917
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 280,
|
||||
"id": "multiRetrievalQAChain_0",
|
||||
"position": {
|
||||
"x": 1563.0150452201099,
|
||||
"y": 460.78375893303934
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "multiRetrievalQAChain_0",
|
||||
"label": "Multi Retrieval QA Chain",
|
||||
"name": "multiRetrievalQAChain",
|
||||
"type": "MultiRetrievalQAChain",
|
||||
"baseClasses": ["MultiRetrievalQAChain", "MultiRouteChain", "BaseChain", "BaseLangChain"],
|
||||
"category": "Chains",
|
||||
"description": "QA Chain that automatically picks an appropriate vector store from multiple retrievers",
|
||||
"inputParams": [],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Language Model",
|
||||
"name": "model",
|
||||
"type": "BaseLanguageModel",
|
||||
"id": "multiRetrievalQAChain_0-input-model-BaseLanguageModel"
|
||||
},
|
||||
{
|
||||
"label": "Vector Store Retriever",
|
||||
"name": "vectorStoreRetriever",
|
||||
"type": "VectorStoreRetriever",
|
||||
"list": true,
|
||||
"id": "multiRetrievalQAChain_0-input-vectorStoreRetriever-VectorStoreRetriever"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{chatOpenAI_0.data.instance}}",
|
||||
"vectorStoreRetriever": [
|
||||
"{{vectorStoreRetriever_0.data.instance}}",
|
||||
"{{vectorStoreRetriever_1.data.instance}}",
|
||||
"{{vectorStoreRetriever_2.data.instance}}"
|
||||
]
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "multiRetrievalQAChain_0-output-multiRetrievalQAChain-MultiRetrievalQAChain|MultiRouteChain|BaseChain|BaseLangChain",
|
||||
"name": "multiRetrievalQAChain",
|
||||
"label": "MultiRetrievalQAChain",
|
||||
"type": "MultiRetrievalQAChain | MultiRouteChain | BaseChain | BaseLangChain"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 1563.0150452201099,
|
||||
"y": 460.78375893303934
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 505,
|
||||
"id": "vectorStoreRetriever_1",
|
||||
"position": {
|
||||
"x": 711.4902931206071,
|
||||
"y": 315.2414600651632
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "vectorStoreRetriever_1",
|
||||
"label": "Vector Store Retriever",
|
||||
"name": "vectorStoreRetriever",
|
||||
"type": "VectorStoreRetriever",
|
||||
"baseClasses": ["VectorStoreRetriever"],
|
||||
"category": "Retrievers",
|
||||
"description": "Store vector store as retriever. Used with MultiRetrievalQAChain",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Retriever Name",
|
||||
"name": "name",
|
||||
"type": "string",
|
||||
"placeholder": "netflix movies",
|
||||
"id": "vectorStoreRetriever_1-input-name-string"
|
||||
},
|
||||
{
|
||||
"label": "Retriever Description",
|
||||
"name": "description",
|
||||
"type": "string",
|
||||
"rows": 3,
|
||||
"description": "Description of when to use the vector store retriever",
|
||||
"placeholder": "Good for answering questions about netflix movies",
|
||||
"id": "vectorStoreRetriever_1-input-description-string"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Vector Store",
|
||||
"name": "vectorStore",
|
||||
"type": "VectorStore",
|
||||
"id": "vectorStoreRetriever_1-input-vectorStore-VectorStore"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"vectorStore": "{{chromaExistingIndex_0.data.instance}}",
|
||||
"name": "mst3k",
|
||||
"description": "Good for answering questions about Mystery Science Theater 3000 theme song"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "vectorStoreRetriever_1-output-vectorStoreRetriever-VectorStoreRetriever",
|
||||
"name": "vectorStoreRetriever",
|
||||
"label": "VectorStoreRetriever",
|
||||
"type": "VectorStoreRetriever"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 711.4902931206071,
|
||||
"y": 315.2414600651632
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 505,
|
||||
"id": "vectorStoreRetriever_2",
|
||||
"position": {
|
||||
"x": 706.0716220151372,
|
||||
"y": -217.51566869136752
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "vectorStoreRetriever_2",
|
||||
"label": "Vector Store Retriever",
|
||||
"name": "vectorStoreRetriever",
|
||||
"type": "VectorStoreRetriever",
|
||||
"baseClasses": ["VectorStoreRetriever"],
|
||||
"category": "Retrievers",
|
||||
"description": "Store vector store as retriever. Used with MultiRetrievalQAChain",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Retriever Name",
|
||||
"name": "name",
|
||||
"type": "string",
|
||||
"placeholder": "netflix movies",
|
||||
"id": "vectorStoreRetriever_2-input-name-string"
|
||||
},
|
||||
{
|
||||
"label": "Retriever Description",
|
||||
"name": "description",
|
||||
"type": "string",
|
||||
"rows": 3,
|
||||
"description": "Description of when to use the vector store retriever",
|
||||
"placeholder": "Good for answering questions about netflix movies",
|
||||
"id": "vectorStoreRetriever_2-input-description-string"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Vector Store",
|
||||
"name": "vectorStore",
|
||||
"type": "VectorStore",
|
||||
"id": "vectorStoreRetriever_2-input-vectorStore-VectorStore"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"vectorStore": "{{pineconeExistingIndex_0.data.instance}}",
|
||||
"name": "animaniacs",
|
||||
"description": "Good for answering questions about Animaniacs theme song"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "vectorStoreRetriever_2-output-vectorStoreRetriever-VectorStoreRetriever",
|
||||
"name": "vectorStoreRetriever",
|
||||
"label": "VectorStoreRetriever",
|
||||
"type": "VectorStoreRetriever"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 706.0716220151372,
|
||||
"y": -217.51566869136752
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 524,
|
||||
"id": "chatOpenAI_0",
|
||||
"position": {
|
||||
"x": 1206.027762600755,
|
||||
"y": -212.35338654620222
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "BaseLangChain"],
|
||||
"category": "Chat Models",
|
||||
"description": "Wrapper around OpenAI large language models that use the Chat endpoint",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "OpenAI Api Key",
|
||||
"name": "openAIApiKey",
|
||||
"type": "password",
|
||||
"id": "chatOpenAI_0-input-openAIApiKey-password"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0314",
|
||||
"name": "gpt-4-0314"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-32k-0314",
|
||||
"name": "gpt-4-32k-0314"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0301",
|
||||
"name": "gpt-3.5-turbo-0301"
|
||||
}
|
||||
],
|
||||
"default": "gpt-3.5-turbo",
|
||||
"optional": true,
|
||||
"id": "chatOpenAI_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Temperature",
|
||||
"name": "temperature",
|
||||
"type": "number",
|
||||
"default": 0.9,
|
||||
"optional": true,
|
||||
"id": "chatOpenAI_0-input-temperature-number"
|
||||
},
|
||||
{
|
||||
"label": "Max Tokens",
|
||||
"name": "maxTokens",
|
||||
"type": "number",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-maxTokens-number"
|
||||
},
|
||||
{
|
||||
"label": "Top Probability",
|
||||
"name": "topP",
|
||||
"type": "number",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-topP-number"
|
||||
},
|
||||
{
|
||||
"label": "Frequency Penalty",
|
||||
"name": "frequencyPenalty",
|
||||
"type": "number",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-frequencyPenalty-number"
|
||||
},
|
||||
{
|
||||
"label": "Presence Penalty",
|
||||
"name": "presencePenalty",
|
||||
"type": "number",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-presencePenalty-number"
|
||||
},
|
||||
{
|
||||
"label": "Timeout",
|
||||
"name": "timeout",
|
||||
"type": "number",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-timeout-number"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [],
|
||||
"inputs": {
|
||||
"modelName": "gpt-3.5-turbo",
|
||||
"temperature": 0.9,
|
||||
"maxTokens": "",
|
||||
"topP": "",
|
||||
"frequencyPenalty": "",
|
||||
"presencePenalty": "",
|
||||
"timeout": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|BaseLangChain",
|
||||
"name": "chatOpenAI",
|
||||
"label": "ChatOpenAI",
|
||||
"type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | BaseLangChain"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 1206.027762600755,
|
||||
"y": -212.35338654620222
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 330,
|
||||
"id": "openAIEmbeddings_0",
|
||||
"position": {
|
||||
"x": -254.88737984323413,
|
||||
"y": 279.72801937636154
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_0",
|
||||
"label": "OpenAI Embeddings",
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
"category": "Embeddings",
|
||||
"description": "OpenAI API to generate embeddings for a given text",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "OpenAI Api Key",
|
||||
"name": "openAIApiKey",
|
||||
"type": "password",
|
||||
"id": "openAIEmbeddings_0-input-openAIApiKey-password"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
"type": "boolean",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "openAIEmbeddings_0-input-stripNewLines-boolean"
|
||||
},
|
||||
{
|
||||
"label": "Batch Size",
|
||||
"name": "batchSize",
|
||||
"type": "number",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "openAIEmbeddings_0-input-batchSize-number"
|
||||
},
|
||||
{
|
||||
"label": "Timeout",
|
||||
"name": "timeout",
|
||||
"type": "number",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "openAIEmbeddings_0-input-timeout-number"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [],
|
||||
"inputs": {
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings",
|
||||
"name": "openAIEmbeddings",
|
||||
"label": "OpenAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings | Embeddings"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": -254.88737984323413,
|
||||
"y": 279.72801937636154
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 703,
|
||||
"id": "pineconeExistingIndex_0",
|
||||
"position": {
|
||||
"x": 271.2513182410521,
|
||||
"y": -410.32709109501735
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "pineconeExistingIndex_0",
|
||||
"label": "Pinecone Load Existing Index",
|
||||
"name": "pineconeExistingIndex",
|
||||
"type": "Pinecone",
|
||||
"baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"],
|
||||
"category": "Vector Stores",
|
||||
"description": "Load existing index from Pinecone (i.e: Document has been upserted)",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Pinecone Api Key",
|
||||
"name": "pineconeApiKey",
|
||||
"type": "password",
|
||||
"id": "pineconeExistingIndex_0-input-pineconeApiKey-password"
|
||||
},
|
||||
{
|
||||
"label": "Pinecone Environment",
|
||||
"name": "pineconeEnv",
|
||||
"type": "string",
|
||||
"id": "pineconeExistingIndex_0-input-pineconeEnv-string"
|
||||
},
|
||||
{
|
||||
"label": "Pinecone Index",
|
||||
"name": "pineconeIndex",
|
||||
"type": "string",
|
||||
"id": "pineconeExistingIndex_0-input-pineconeIndex-string"
|
||||
},
|
||||
{
|
||||
"label": "Pinecone Namespace",
|
||||
"name": "pineconeNamespace",
|
||||
"type": "string",
|
||||
"placeholder": "my-first-namespace",
|
||||
"optional": true,
|
||||
"id": "pineconeExistingIndex_0-input-pineconeNamespace-string"
|
||||
},
|
||||
{
|
||||
"label": "Pinecone Metadata Filter",
|
||||
"name": "pineconeMetadataFilter",
|
||||
"type": "json",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "pineconeExistingIndex_0-input-pineconeMetadataFilter-json"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Embeddings",
|
||||
"name": "embeddings",
|
||||
"type": "Embeddings",
|
||||
"id": "pineconeExistingIndex_0-input-embeddings-Embeddings"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"embeddings": "{{openAIEmbeddings_0.data.instance}}",
|
||||
"pineconeEnv": "",
|
||||
"pineconeIndex": "",
|
||||
"pineconeNamespace": "",
|
||||
"pineconeMetadataFilter": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"name": "output",
|
||||
"label": "Output",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"id": "pineconeExistingIndex_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever",
|
||||
"name": "retriever",
|
||||
"label": "Pinecone Retriever",
|
||||
"type": "Pinecone | VectorStoreRetriever | BaseRetriever"
|
||||
},
|
||||
{
|
||||
"id": "pineconeExistingIndex_0-output-vectorStore-Pinecone|VectorStore",
|
||||
"name": "vectorStore",
|
||||
"label": "Pinecone Vector Store",
|
||||
"type": "Pinecone | VectorStore"
|
||||
}
|
||||
],
|
||||
"default": "retriever"
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
"output": "vectorStore"
|
||||
},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 271.2513182410521,
|
||||
"y": -410.32709109501735
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 454,
|
||||
"id": "chromaExistingIndex_0",
|
||||
"position": {
|
||||
"x": 274.1430731555137,
|
||||
"y": 335.15344698725556
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "chromaExistingIndex_0",
|
||||
"label": "Chroma Load Existing Index",
|
||||
"name": "chromaExistingIndex",
|
||||
"type": "Chroma",
|
||||
"baseClasses": ["Chroma", "VectorStoreRetriever", "BaseRetriever"],
|
||||
"category": "Vector Stores",
|
||||
"description": "Load existing index from Chroma (i.e: Document has been upserted)",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Collection Name",
|
||||
"name": "collectionName",
|
||||
"type": "string",
|
||||
"id": "chromaExistingIndex_0-input-collectionName-string"
|
||||
},
|
||||
{
|
||||
"label": "Chroma URL",
|
||||
"name": "chromaURL",
|
||||
"type": "string",
|
||||
"optional": true,
|
||||
"id": "chromaExistingIndex_0-input-chromaURL-string"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Embeddings",
|
||||
"name": "embeddings",
|
||||
"type": "Embeddings",
|
||||
"id": "chromaExistingIndex_0-input-embeddings-Embeddings"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"embeddings": "{{openAIEmbeddings_0.data.instance}}",
|
||||
"collectionName": "",
|
||||
"chromaURL": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"name": "output",
|
||||
"label": "Output",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"id": "chromaExistingIndex_0-output-retriever-Chroma|VectorStoreRetriever|BaseRetriever",
|
||||
"name": "retriever",
|
||||
"label": "Chroma Retriever",
|
||||
"type": "Chroma | VectorStoreRetriever | BaseRetriever"
|
||||
},
|
||||
{
|
||||
"id": "chromaExistingIndex_0-output-vectorStore-Chroma|VectorStore",
|
||||
"name": "vectorStore",
|
||||
"label": "Chroma Vector Store",
|
||||
"type": "Chroma | VectorStore"
|
||||
}
|
||||
],
|
||||
"default": "retriever"
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
"output": "vectorStore"
|
||||
},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 274.1430731555137,
|
||||
"y": 335.15344698725556
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 703,
|
||||
"id": "supabaseExistingIndex_0",
|
||||
"position": {
|
||||
"x": 273.7097153973373,
|
||||
"y": 821.872758974335
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "supabaseExistingIndex_0",
|
||||
"label": "Supabase Load Existing Index",
|
||||
"name": "supabaseExistingIndex",
|
||||
"type": "Supabase",
|
||||
"baseClasses": ["Supabase", "VectorStoreRetriever", "BaseRetriever"],
|
||||
"category": "Vector Stores",
|
||||
"description": "Load existing index from Supabase (i.e: Document has been upserted)",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Supabase API Key",
|
||||
"name": "supabaseApiKey",
|
||||
"type": "password",
|
||||
"id": "supabaseExistingIndex_0-input-supabaseApiKey-password"
|
||||
},
|
||||
{
|
||||
"label": "Supabase Project URL",
|
||||
"name": "supabaseProjUrl",
|
||||
"type": "string",
|
||||
"id": "supabaseExistingIndex_0-input-supabaseProjUrl-string"
|
||||
},
|
||||
{
|
||||
"label": "Table Name",
|
||||
"name": "tableName",
|
||||
"type": "string",
|
||||
"id": "supabaseExistingIndex_0-input-tableName-string"
|
||||
},
|
||||
{
|
||||
"label": "Query Name",
|
||||
"name": "queryName",
|
||||
"type": "string",
|
||||
"id": "supabaseExistingIndex_0-input-queryName-string"
|
||||
},
|
||||
{
|
||||
"label": "Supabase Metadata Filter",
|
||||
"name": "supabaseMetadataFilter",
|
||||
"type": "json",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "supabaseExistingIndex_0-input-supabaseMetadataFilter-json"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Embeddings",
|
||||
"name": "embeddings",
|
||||
"type": "Embeddings",
|
||||
"id": "supabaseExistingIndex_0-input-embeddings-Embeddings"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"embeddings": "{{openAIEmbeddings_0.data.instance}}",
|
||||
"supabaseProjUrl": "",
|
||||
"tableName": "",
|
||||
"queryName": "",
|
||||
"supabaseMetadataFilter": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"name": "output",
|
||||
"label": "Output",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"id": "supabaseExistingIndex_0-output-retriever-Supabase|VectorStoreRetriever|BaseRetriever",
|
||||
"name": "retriever",
|
||||
"label": "Supabase Retriever",
|
||||
"type": "Supabase | VectorStoreRetriever | BaseRetriever"
|
||||
},
|
||||
{
|
||||
"id": "supabaseExistingIndex_0-output-vectorStore-Supabase|VectorStore",
|
||||
"name": "vectorStore",
|
||||
"label": "Supabase Vector Store",
|
||||
"type": "Supabase | VectorStore"
|
||||
}
|
||||
],
|
||||
"default": "retriever"
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
"output": "vectorStore"
|
||||
},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 273.7097153973373,
|
||||
"y": 821.872758974335
|
||||
},
|
||||
"dragging": false
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "vectorStoreRetriever_0",
|
||||
"sourceHandle": "vectorStoreRetriever_0-output-vectorStoreRetriever-VectorStoreRetriever",
|
||||
"target": "multiRetrievalQAChain_0",
|
||||
"targetHandle": "multiRetrievalQAChain_0-input-vectorStoreRetriever-VectorStoreRetriever",
|
||||
"type": "buttonedge",
|
||||
"id": "vectorStoreRetriever_0-vectorStoreRetriever_0-output-vectorStoreRetriever-VectorStoreRetriever-multiRetrievalQAChain_0-multiRetrievalQAChain_0-input-vectorStoreRetriever-VectorStoreRetriever",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "vectorStoreRetriever_1",
|
||||
"sourceHandle": "vectorStoreRetriever_1-output-vectorStoreRetriever-VectorStoreRetriever",
|
||||
"target": "multiRetrievalQAChain_0",
|
||||
"targetHandle": "multiRetrievalQAChain_0-input-vectorStoreRetriever-VectorStoreRetriever",
|
||||
"type": "buttonedge",
|
||||
"id": "vectorStoreRetriever_1-vectorStoreRetriever_1-output-vectorStoreRetriever-VectorStoreRetriever-multiRetrievalQAChain_0-multiRetrievalQAChain_0-input-vectorStoreRetriever-VectorStoreRetriever",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "vectorStoreRetriever_2",
|
||||
"sourceHandle": "vectorStoreRetriever_2-output-vectorStoreRetriever-VectorStoreRetriever",
|
||||
"target": "multiRetrievalQAChain_0",
|
||||
"targetHandle": "multiRetrievalQAChain_0-input-vectorStoreRetriever-VectorStoreRetriever",
|
||||
"type": "buttonedge",
|
||||
"id": "vectorStoreRetriever_2-vectorStoreRetriever_2-output-vectorStoreRetriever-VectorStoreRetriever-multiRetrievalQAChain_0-multiRetrievalQAChain_0-input-vectorStoreRetriever-VectorStoreRetriever",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "chatOpenAI_0",
|
||||
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|BaseLangChain",
|
||||
"target": "multiRetrievalQAChain_0",
|
||||
"targetHandle": "multiRetrievalQAChain_0-input-model-BaseLanguageModel",
|
||||
"type": "buttonedge",
|
||||
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|BaseLangChain-multiRetrievalQAChain_0-multiRetrievalQAChain_0-input-model-BaseLanguageModel",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "pineconeExistingIndex_0",
|
||||
"sourceHandle": "pineconeExistingIndex_0-output-vectorStore-Pinecone|VectorStore",
|
||||
"target": "vectorStoreRetriever_2",
|
||||
"targetHandle": "vectorStoreRetriever_2-input-vectorStore-VectorStore",
|
||||
"type": "buttonedge",
|
||||
"id": "pineconeExistingIndex_0-pineconeExistingIndex_0-output-vectorStore-Pinecone|VectorStore-vectorStoreRetriever_2-vectorStoreRetriever_2-input-vectorStore-VectorStore",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "openAIEmbeddings_0",
|
||||
"sourceHandle": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings",
|
||||
"target": "pineconeExistingIndex_0",
|
||||
"targetHandle": "pineconeExistingIndex_0-input-embeddings-Embeddings",
|
||||
"type": "buttonedge",
|
||||
"id": "openAIEmbeddings_0-openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings-pineconeExistingIndex_0-pineconeExistingIndex_0-input-embeddings-Embeddings",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "chromaExistingIndex_0",
|
||||
"sourceHandle": "chromaExistingIndex_0-output-vectorStore-Chroma|VectorStore",
|
||||
"target": "vectorStoreRetriever_1",
|
||||
"targetHandle": "vectorStoreRetriever_1-input-vectorStore-VectorStore",
|
||||
"type": "buttonedge",
|
||||
"id": "chromaExistingIndex_0-chromaExistingIndex_0-output-vectorStore-Chroma|VectorStore-vectorStoreRetriever_1-vectorStoreRetriever_1-input-vectorStore-VectorStore",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "openAIEmbeddings_0",
|
||||
"sourceHandle": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings",
|
||||
"target": "chromaExistingIndex_0",
|
||||
"targetHandle": "chromaExistingIndex_0-input-embeddings-Embeddings",
|
||||
"type": "buttonedge",
|
||||
"id": "openAIEmbeddings_0-openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings-chromaExistingIndex_0-chromaExistingIndex_0-input-embeddings-Embeddings",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "openAIEmbeddings_0",
|
||||
"sourceHandle": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings",
|
||||
"target": "supabaseExistingIndex_0",
|
||||
"targetHandle": "supabaseExistingIndex_0-input-embeddings-Embeddings",
|
||||
"type": "buttonedge",
|
||||
"id": "openAIEmbeddings_0-openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings-supabaseExistingIndex_0-supabaseExistingIndex_0-input-embeddings-Embeddings",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "supabaseExistingIndex_0",
|
||||
"sourceHandle": "supabaseExistingIndex_0-output-vectorStore-Supabase|VectorStore",
|
||||
"target": "vectorStoreRetriever_0",
|
||||
"targetHandle": "vectorStoreRetriever_0-input-vectorStore-VectorStore",
|
||||
"type": "buttonedge",
|
||||
"id": "supabaseExistingIndex_0-supabaseExistingIndex_0-output-vectorStore-Supabase|VectorStore-vectorStoreRetriever_0-vectorStoreRetriever_0-input-vectorStore-VectorStore",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"description": "Use the agent to choose between multiple different vector databases",
|
||||
"description": "Use the agent to choose between multiple different vector databases, with the ability to use other tools",
|
||||
"nodes": [
|
||||
{
|
||||
"width": 300,
|
||||
|
||||
Reference in New Issue
Block a user