UNPKG

@n8n/n8n-nodes-langchain

Version:
59 lines (54 loc) 2.23 kB
/** * Pinecone Vector Store Node - Version 1 * Discriminator: mode=insert */ interface Credentials { pineconeApi: CredentialReference; } /** Insert documents into vector store */ export type LcVectorStorePineconeV1InsertParams = { /** * Sits on the main flow — pipe the documents you want to embed into this node. Declare with `vectorStore({...})`. Required subnodes: `embedding` and `documentLoader`. If the goal is letting an LLM query the store, use `mode: 'retrieve-as-tool'` instead. * <patterns> * <pattern title="insert mode — upsert documents (generic, works for any vectorStore* node)"> * // Substitute the type literal and provider-specific parameters (e.g. pineconeIndex, * // qdrantCollection, supabaseTableName) — see the rest of this file for the exact shape. * const store = vectorStore({ * type: '@n8n/n8n-nodes-langchain.vectorStoreXxx', * config: { * name: 'Knowledge Base', * parameters: { * mode: 'insert', * // ...provider-specific parameters * }, * subnodes: { embedding: embeddingsOpenAi, documentLoader: defaultDataLoader } * } * }); * </pattern> * </patterns> */ mode: 'insert'; pineconeIndex?: { __rl: true; mode: 'list' | 'id'; value: string; cachedResultName?: string }; /** * Options * @default {} */ options?: { /** Whether to clear the namespace before inserting new data * @default false */ clearNamespace?: boolean | Expression<boolean>; /** Partition the records in an index into namespaces. Queries and other operations are then limited to one namespace, so different requests can search different subsets of your index. */ pineconeNamespace?: string | Expression<string>; }; }; export interface LcVectorStorePineconeV1InsertSubnodeConfig { embedding: EmbeddingInstance | EmbeddingInstance[]; documentLoader: DocumentLoaderInstance | DocumentLoaderInstance[]; } export type LcVectorStorePineconeV1InsertNode = { type: '@n8n/n8n-nodes-langchain.vectorStorePinecone'; version: 1; config: NodeConfig<LcVectorStorePineconeV1InsertParams> & { credentials?: Credentials } & { subnodes: LcVectorStorePineconeV1InsertSubnodeConfig }; };