
PGVector Integration
Pricing
Pay per usage

PGVector Integration
This integration transfers data from Apify Actors to a Postgres SQL database (with PGVector extension).
4.6 (5)
Pricing
Pay per usage
5
Total users
9
Monthly users
3
Runs succeeded
44%
Response time
19 hours
Last modified
23 days ago
Unable to connect
Open
I am using neon db and have added the pgvector extension and also shared a connection string that works. I am able to see the following tables in my db i.e. langchain_pg_collection and langchain_pg_embedding I have connected the actor with a dataset i have produced using apify web crawler But I am not able to run the actor

Hi,
Thank you for using the PGVector integration!
I tested it with Neon DB—even though I didn’t have prior experience with it, it looks really good.
I’m not sure what went wrong in your run. I tried it myself and it worked — you can see my run here.
Could you please try again?
Maybe start with a smaller dataset just to test.
Also, please double-check that your Postgres settings are correct. Unfortunately, it’s hard to debug on my end since I can’t reproduce the issue :(
Thank you, Jiri
subadhra-wo
Hi,
I just tried it again. No luck.
Failed to connect/get database. Please ensure the following: 1. Database credentials are correct and the database is configure properly. 2. The vector dimension of your embedding model in the Actor input (Embedding settings -> model) matches the one set up in the database. Database error message: Can't load plugin: sqlalchemy.dialects:postgres
My database credentials are correct. Do I need to do anything to configure the database properly? I was assuming that the actor would create the tables needed etc. If not, are there any instructions here? Since I did not create the table, I do not know what the vector dimensions that I need to set are. Can you provide some guidance here.
Thanks

Hi, I’m really sorry to hear that you're running into this issue.
I haven’t encountered the exact same error myself:
| Database error message: Can't load plugin: sqlalchemy.dialects:postgres
However, I found a relevant Stack Overflow post that explains the issue. According to it:
| "SQLAlchemy 1.4 removed the deprecated postgres dialect name. You must now use postgresql instead."
Could it be that your postgresSqlConnectionStr
starts with postgres://
instead of postgresql://
?
For reference, my connection string looks like this:
postgresql://neondb_owner:npg_****
Let me know if updating the prefix solves it. Jiri
subadhra-wo
Hi,
Thanks for getting back.
After a few attempts (using postgresql and removing the config as suggested in your docs from my embeddings config) I finally got it to work but I don't know what embedding is being used by default and i also do not know what the vector dimensions in the table are. I looked at the docs but was unable to figure it out.
Here is the JSON of my config (which worked) I've snipped the sensitive info
{"dataUpdatesPrimaryDatasetFields": ["url"],"dataUpdatesStrategy": "deltaUpdates","datasetFields": ["text"],"datasetId": "udz1WeiXraNvbrxMq","deleteExpiredObjects": true,"deltaUpdatesPrimaryDatasetFields": ["url"],"embeddingsApiKey": "ENCRYPTED_VALUE:ZjR...snipped","embeddingsProvider": "OpenAI","enableDeltaUpdates": true,"performChunking": true,"postgresCollectionName": "apify-collection","postgresSqlConnectionStr": "ENCRYPTED_VALUE:U5Oy...snipped",}
If you could help me understand the following i.e.
- what embedding model is being used by default (I need this so I can get embeddings of the user query using the same model)
- what are the vector dimensions that were used by default in the table created (I need this so I can recreate this table as needed)
Thanks

Hi,
I’m glad to hear it’s working now! I agree that the configuration could definitely benefit from some simplification.
Based on the information you shared, it looks like you're using OpenAI embeddings without specifying a model.
By default, the model used is text-embedding-3-small
, but you can explicitly set it using the embeddingsConfig
field:
"embeddingsConfig": {"model": "text-embedding-3-small"}
The vector dimension for text-embedding-3-small
is 1536. Jiri