Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Error: vectorsService.upsertVector - Error: Error: Not implemented. #3004

Closed
BadrLaajali opened this issue Aug 13, 2024 · 9 comments · Fixed by #3180
Closed

[BUG] Error: vectorsService.upsertVector - Error: Error: Not implemented. #3004

BadrLaajali opened this issue Aug 13, 2024 · 9 comments · Fixed by #3180
Labels
bug Something isn't working

Comments

@BadrLaajali
Copy link

Describe the bug
When attempting to upsert data from a Notion database into a Postgres vector database using pgvector, an error occurs during the upsert process after modifying a page in Notion. The error message states "Error: vectorsService.upsertVector - Error: Error: Not implemented." Despite this error, new duplicate records are created in the vector database, indicating that the system is not properly recognizing or updating existing records. This occurs even though a Postgres Record Manager is being used to detect modifications in the flow.

To Reproduce
Steps to reproduce the behavior:

  1. Set up a Flowise flow with Notion Database, Postgres Record Manager, and Postgres Vector Store nodes.
  2. Configure Postgres Record Manager to detect modifications in the flow.
  3. Create 3 pages in a Notion database.
  4. Execute the initial upsert to create vectors in the Postgres database with pgvector.
  5. Modify the title of one of the Notion pages.
  6. Run the upsert process again.
  7. Observe the error: "Error: vectorsService.upsertVector - Error: Error: Not implemented."
  8. Check the Postgres vector database and notice duplicate entries.

Expected behavior
The Postgres Record Manager should detect the modifications in the Notion pages. The upsert process should then recognize existing records based on this information and update them instead of creating duplicates.

Screenshots
CleanShot 2024-08-12 at 21 39 08

Setup

  • Installation : Docker using Railway
  • Flowise Version : flowise@2.0.5
  • OS: macOS
  • Browser : Arc

Additional context
The issue persists even when switching the Record Manager to Supabase.
The error occurs specifically during the upsert process after modifying existing Notion pages.
The log shows successful initialization of components (Recursive Character Text Splitter, Cohere Embeddings, Notion Database, Postgres Record Manager) before encountering the error.
The error seems to be originating from the Postgres_VectorStores.upsert method, suggesting a potential issue with the implementation of the upsert functionality in the Postgres vector store component.
Log details :

2024-08-13 01:31:13 [DEBUG]: [server]: Initializing Recursive Character Text Splitter (recursiveCharacterTextSplitter_0)

2024-08-13 01:31:13 [DEBUG]: [server]: Finished initializing Recursive Character Text Splitter (recursiveCharacterTextSplitter_0)

2024-08-13 01:31:13 [DEBUG]: [server]: Initializing Cohere Embeddings (cohereEmbeddings_0)

2024-08-13 01:31:13 [DEBUG]: [server]: Finished initializing Cohere Embeddings (cohereEmbeddings_0)

2024-08-13 01:31:13 [DEBUG]: [server]: Initializing Notion Database (notionDB_0)

2024-08-13 01:31:16 [DEBUG]: [server]: Finished initializing Notion Database (notionDB_0)

2024-08-13 01:31:16 [DEBUG]: [server]: Initializing Postgres Record Manager (postgresRecordManager_0)

2024-08-13 01:31:16 [DEBUG]: [server]: Finished initializing Postgres Record Manager (postgresRecordManager_0)

2024-08-13 01:31:16 [DEBUG]: [server]: Upserting Postgres (postgres_0)

2024-08-13 01:31:16 [ERROR]: Error: Not implemented.

Error: Error: Not implemented.

at Postgres_VectorStores.upsert (/usr/local/lib/node_modules/flowise/node_modules/flowise-components/dist/nodes/vectorstores/Postgres/Postgres.js:82:27)

at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

at async buildFlow (/usr/local/lib/node_modules/flowise/dist/utils/index.js:408:37)

at async upsertVector (/usr/local/lib/node_modules/flowise/dist/utils/upsertVector.js:115:32)

at async Object.upsertVectorMiddleware (/usr/local/lib/node_modules/flowise/dist/services/vectors/index.js:9:16)

at async createInternalUpsert (/usr/local/lib/node_modules/flowise/dist/controllers/vectors/index.js:28:29)

2024-08-13 01:31:16 [ERROR]: [server]: Error: Error: Error: Not implemented.

Error: Error: Error: Not implemented.

at buildFlow (/usr/local/lib/node_modules/flowise/dist/utils/index.js:483:19)

at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

at async upsertVector (/usr/local/lib/node_modules/flowise/dist/utils/upsertVector.js:115:32)

at async Object.upsertVectorMiddleware (/usr/local/lib/node_modules/flowise/dist/services/vectors/index.js:9:16)

at async createInternalUpsert (/usr/local/lib/node_modules/flowise/dist/controllers/vectors/index.js:28:29)

@Astriel
Copy link

Astriel commented Aug 13, 2024

I'm also having some problems with pgvector. It used to work before, but now, each time I'm trying to make an upsert, I'm receveing a OK response, but nothing into the database while it used to work.

@BadrLaajali
Copy link
Author

It's working fine with Pinecone and Qdrant.
Maybe it's linked to Postgres pgvector database...

@Astriel
Copy link

Astriel commented Aug 14, 2024

I've tried with Pinecone, same problem. Flowise says data are upsert, but still nothing in the vector database.

@Astriel
Copy link

Astriel commented Aug 14, 2024

I'm having the same error if I change my embedding to Bedrock from OpenAI.

@jackborst
Copy link

I'm experiencing a similar problem, possibly related to the same root cause.

When using the PostgreSQL Record Manager (RM) and PostgreSQL Vector Store, changing the "cleanup" parameter in the RM module from "none" to "full" results in a "Not implemented" error.

Steps to reproduce:

  1. Set up Flowise with PostgreSQL Record Manager and PostgreSQL Vector Store
  2. Successfully add new documents to the vector store
  3. Change the "cleanup" parameter in the RM module from "none" to "full"
  4. Attempt to delete a document or run the upsert process again

Error message:
Error: Error: Error: Not implemented.

Additional observations:

  • Adding new documents works fine
  • Deleting documents or running upsert after a document is removed from the source folder causes an error
  • The issue looks isolated to Flowise's PostgreSQL retriever implementation. Supabase-hosted vectorstore and PostgreSQL Record Manager work correctly for the same operations.

@msiwanHahn
Copy link

Hi,
same issue as described above (#3004 (comment) & #3004 (comment)).

Flowise hosted in Azure. Managed PG in Azure, too.
upsert

Flow: upsert API Chatflow.json

Additionally the Record Manager keeps PG connections in IDLE "ClientRead" for an unlimited amount of time.
We are reading PDFs from a file share and using the upsert API, same occurs when using the Flowise UI and Upload File from the PDF Loader Node.
pg_idle

@HenryHengZJ HenryHengZJ added the bug Something isn't working label Aug 31, 2024
@HenryHengZJ
Copy link
Contributor

Here's what I have tried:

OpenAI Embeddings + Postgres Vector Store + Postgres Record Manager

My local Postgres is using Docker, and Flowise is using local git installation

# Compose a postgres database together with the extension pgvector
services:
  db:
    hostname: 127.0.0.1
    image: pgvector/pgvector:pg15
    ports:
     - 5432:5432
    restart: always
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=1234
    volumes:
     - ./init.sql:/docker-entrypoint-initdb.d/init.sql

Start the postgres docker using docker compose up

Then
1.) Have a document store with following upsert config:
image

2.) Upsert data successfully:
image

3.) Change to Full:
image

4.) Works correctly as it is able to skipped upserting same documents:
image

5.) Change to Incremental

6.) See "Not Implemented" error:
image

So I was able to replicate the error only in Incremental, looks like its opposite from what you observed @jackborst

@HenryHengZJ
Copy link
Contributor

Update: this PR #3180 fixes this

@thedaedalusfoundation
Copy link

Hi All, what about this :

Additionally the Record Manager keeps PG connections in IDLE "ClientRead" for an unlimited amount of time.
We are reading PDFs from a file share and using the upsert API, same occurs when using the Flowise UI and Upload File from the PDF Loader Node.

that was reported by @msiwanHahn .Is it fixed ? I found iddle connections from the upsertion_records my postgres DB, its causing connection issues on my end.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants