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

Add Postgres vector store using pgvector #782

Merged

Conversation

fabiovalencio
Copy link
Contributor

Add a component to vectorstore to allow saving vectors in a Postgres database with pgvector

@CLAassistant
Copy link

CLAassistant commented Aug 16, 2023

CLA assistant check
All committers have signed the CLA.

@HenryHengZJ
Copy link
Contributor

you might have accidentally removed the .env.example files

@fabiovalencio
Copy link
Contributor Author

you might have accidentally removed the .env.example files

Sorry about that, I just renamed them to use, putting back.

@HenryHengZJ
Copy link
Contributor

@fabiovalencio were you abel to get this running? I have a docker compose file running like this:

services:
  db:
    image: ankane/pgvector
    ports:
      - 5432:5432
    volumes:
      - ./data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=mypassword
      - POSTGRES_USER=myuser
      - POSTGRES_DB=api

And I created postgres credential in Flowise with the above user and password. However, when running the chatflow got this error: password authentication failed for user "myuser"

@fabiovalencio
Copy link
Contributor Author

Hi @HenryHengZJ this probably happened because I hadn't set the default table name, I've just fixed it.

@HenryHengZJ
Copy link
Contributor

HenryHengZJ commented Aug 17, 2023

Hi @HenryHengZJ this probably happened because I hadn't set the default table name, I've just fixed it.

still the same:
image

were you able to get it working on Flowise following the guide here

@fabiovalencio
Copy link
Contributor Author

I redid it from the beginning and didn't find any errors.

I started by creating Postgres with Docker
Screenshot 2023-08-18 at 10 17 30

Then I tried accessing the database
Screenshot 2023-08-18 at 10 35 04

I didn't use Flowise from Docker because it doesn't have the Postgres vector store yet. So I started another application with Flowise and I saved the Postgres access credentials.
Screenshot 2023-08-18 at 10 48 40

I tried to create a chat just like yours
Screenshot 2023-08-18 at 10 55 19

Screenshot 2023-08-18 at 11 13 34

Screenshot 2023-08-18 at 10 55 52

I haven't really had any problems. Just wondering, can you access the database via psql?

@HenryHengZJ
Copy link
Contributor

HenryHengZJ commented Aug 18, 2023

hmm pretty sure its my connection to postgres..

In the docker compose file I have set

- POSTGRES_USER=myuser
- POSTGRES_PASSWORD=mypassword
- POSTGRES_DB=api

Then using cli:

psql postgresql://abc:123@localhost:5432/api

I was still able to get into psql, even though the user and password are clearly not the one in docker compose.
I'm using Windows, mayb thats a Windows thingy

@HenryHengZJ
Copy link
Contributor

thank you @fabiovalencio !

@HenryHengZJ HenryHengZJ merged commit 260b13b into FlowiseAI:main Aug 18, 2023
2 checks passed
@rkeshwani
Copy link
Contributor

rkeshwani commented Aug 25, 2023

This is returning a Error: Error: Credentials could not be decrypted on a windows machine running docker version of the database.
Note, I'm starting this based on the basic instructions without any configurations.
I updated my version of flowise and was able to see the new vectore store.

Console errors show:
Error: Malformed UTF-8 data

This is a different issue. Readding credentials for the language model solved this error.

@raymatos
Copy link

would it be possible to have flowise create the database and enable the vector extension when adding a database name that doesnt exist

hemati pushed a commit to hemati/Flowise that referenced this pull request Dec 27, 2023
…Vector-Store

Add Postgres vector store using pgvector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants