Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:FlowiseAI Flowise InsertIntoVectorStore

From Leeroopedia
Attribute Value
Sources packages/ui/src/api/documentstore.js:L22
Domains Document_Store_Ingestion
Last Updated 2026-02-12 14:00 GMT

Overview

InsertIntoVectorStore is the API client function that triggers the upsert of processed document chunks into a configured vector store. It sends the complete embedding, vector store, and optional record manager configuration to the server, which handles embedding generation, vector storage, and deduplication.

Code Reference

Source Location

Signature

const insertIntoVectorStore = (body) => client.post(`/document-store/vectorstore/insert`, body)

This function sends a POST request to the /api/v1/document-store/vectorstore/insert endpoint via the configured axios client instance.

Import

import documentStoreApi from '@/api/documentstore'

The function is accessed as documentStoreApi.insertIntoVectorStore(body) after importing the default export from the documentstore API module.

I/O Contract

Inputs

Parameter Type Required Description
body object Yes The complete upsert configuration
body.storeId string Yes The document store identifier containing the chunks to upsert
body.docId string No Specific document/loader ID to upsert (omit to upsert all chunks in the store)
body.isStrictSave boolean Yes Whether to persist the vector store configuration alongside the upsert
body.embeddingName string Yes The embedding provider component name (e.g., openAIEmbeddings)
body.embeddingConfig object Yes Embedding provider configuration (model name, credentials, parameters)
body.vectorStoreName string Yes The vector store provider component name (e.g., pinecone, chroma)
body.vectorStoreConfig object Yes Vector store provider configuration (index, namespace, connection details)
body.recordManagerName string No The record manager component name (e.g., postgresRecordManager)
body.recordManagerConfig object No Record manager configuration (table name, cleanup mode, connection details)

Outputs

Field Type Description
data object The upsert result summary
data.numAdded number Number of new vectors added to the store
data.numUpdated number Number of existing vectors updated
data.numSkipped number Number of unchanged vectors skipped (when using record manager)
data.numDeleted number Number of vectors deleted (when record manager cleanup removes stale entries)

The function returns a Promise<{data: {numAdded: number, numUpdated: number, numSkipped: number, numDeleted: number}}>.

Usage Examples

Basic Upsert with OpenAI and Pinecone

import documentStoreApi from '@/api/documentstore'

const upsertToPinecone = async (storeId) => {
    const body = {
        storeId,
        isStrictSave: true,
        embeddingName: 'openAIEmbeddings',
        embeddingConfig: {
            modelName: 'text-embedding-ada-002',
            credential: 'openai-api-key-id'
        },
        vectorStoreName: 'pinecone',
        vectorStoreConfig: {
            pineconeIndex: 'my-index',
            pineconeNamespace: 'product-docs'
        }
    }

    const response = await documentStoreApi.insertIntoVectorStore(body)
    const { numAdded, numUpdated, numSkipped, numDeleted } = response.data

    console.log(`Upsert complete:`)
    console.log(`  Added: ${numAdded}`)
    console.log(`  Updated: ${numUpdated}`)
    console.log(`  Skipped: ${numSkipped}`)
    console.log(`  Deleted: ${numDeleted}`)

    return response.data
}

Upsert with Record Manager for Incremental Updates

import documentStoreApi from '@/api/documentstore'

const incrementalUpsert = async (storeId) => {
    const body = {
        storeId,
        isStrictSave: true,
        embeddingName: 'openAIEmbeddings',
        embeddingConfig: {
            modelName: 'text-embedding-ada-002',
            credential: 'openai-key'
        },
        vectorStoreName: 'chroma',
        vectorStoreConfig: {
            collectionName: 'my-collection',
            chromaURL: 'http://localhost:8000'
        },
        recordManagerName: 'postgresRecordManager',
        recordManagerConfig: {
            tableName: 'doc_records',
            cleanup: 'incremental',
            credential: 'postgres-conn'
        }
    }

    const response = await documentStoreApi.insertIntoVectorStore(body)
    console.log(`Incremental upsert: ${response.data.numAdded} new, ${response.data.numSkipped} unchanged`)
    return response.data
}

Upsert a Single Document

import documentStoreApi from '@/api/documentstore'

const upsertSingleDoc = async (storeId, docId, embeddingConfig, vectorStoreConfig) => {
    const body = {
        storeId,
        docId,  // Only upsert chunks from this specific document
        isStrictSave: false,
        embeddingName: 'openAIEmbeddings',
        embeddingConfig,
        vectorStoreName: 'pinecone',
        vectorStoreConfig
    }

    const response = await documentStoreApi.insertIntoVectorStore(body)
    console.log(`Document ${docId}: ${response.data.numAdded} added, ${response.data.numUpdated} updated`)
    return response.data
}

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment