UNPKG

@n8n/n8n-nodes-langchain

Version:
83 lines (78 loc) • 3.31 kB
/** * Databricks Vector Store Node - Version 1 * Discriminator: mode=retrieve */ interface Credentials { databricksOAuth2Api: CredentialReference; } /** Retrieve documents from vector store to be used as vector store with AI nodes */ export type LcVectorStoreDatabricksV1RetrieveParams = { /** * Exposes the store as an `ai_vectorStore` subnode for another node (e.g. `toolVectorStore`). Declare with `vectorStore({...})`. Required subnodes: `embedding`. For RAG with an AI Agent directly, prefer `mode: 'retrieve-as-tool'`. * <patterns> * <pattern title="retrieve mode — feed another node as a subnode (generic)"> * // Substitute the type literal and provider-specific parameters — see the rest of this file. * const store = vectorStore({ * type: '@n8n/n8n-nodes-langchain.vectorStoreXxx', * config: { * name: 'Knowledge Base', * parameters: { mode: 'retrieve' /* + provider-specific parameters *\/ }, * subnodes: { embedding: embeddingsOpenAi } * } * }); * * const retrieverTool = tool({ * type: '@n8n/n8n-nodes-langchain.toolVectorStore', * config: { * name: 'KB Retriever', * parameters: { description: 'Search the product knowledge base' }, * subnodes: { vectorStore: store, model: openAiModel } * } * }); * </pattern> * </patterns> */ mode: 'retrieve'; databricksIndex?: { __rl: true; mode: 'list' | 'id'; value: string; cachedResultName?: string }; /** * Column that becomes the document text. Leave empty on a managed-embedding index to use its embedding source column. Choose from the list, or specify an ID using an &lt;a href="https://docs.n8n.io/code/expressions/"&gt;expression&lt;/a&gt;. * @loadOptionsMethod getIndexColumns */ contentColumn?: string | Expression<string>; /** * Options * @default {} */ options?: { /** Columns to return in document metadata. Defaults to all columns except the key, content and vector columns. Choose from the list, or specify IDs using an &lt;a href="https://docs.n8n.io/code/expressions/"&gt;expression&lt;/a&gt;. * @loadOptionsMethod getIndexColumns * @default [] */ metadataColumns?: string[]; /** Vector ranks purely by semantic similarity. Hybrid adds keyword matching on top, using the search text. Sent as query_type ANN or HYBRID. * @default ANN */ searchMode?: 'ANN' | 'HYBRID' | Expression<string>; /** Restrict results to rows matching this metadata condition, for example {"source": "handbook"}. Sent as filters_json. Works on STANDARD endpoints only. * @default {} */ searchFilterJson?: IDataObject | string | Expression<string>; }; /** * Whether or not to rerank results * @default false */ useReranker?: boolean | Expression<boolean>; }; export interface LcVectorStoreDatabricksV1RetrieveSubnodeConfig { embedding: EmbeddingInstance | EmbeddingInstance[]; /** * @displayOptions.show { useReranker: [true] } */ reranker: RerankerInstance; } export type LcVectorStoreDatabricksV1RetrieveNode = { type: '@n8n/n8n-nodes-langchain.vectorStoreDatabricks'; version: 1; config: NodeConfig<LcVectorStoreDatabricksV1RetrieveParams> & { credentials?: Credentials } & { subnodes: LcVectorStoreDatabricksV1RetrieveSubnodeConfig }; };