
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
4
Monthly users
2
Runs succeeded
33%
Response time
19 hours
Last modified
3 days ago
You can access the PGVector Integration programmatically from your own applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.
1{
2 "openapi": "3.0.1",
3 "info": {
4 "version": "0.1",
5 "x-build-id": "ivR6n8fZyfAUPdqOp"
6 },
7 "servers": [
8 {
9 "url": "https://api.apify.com/v2"
10 }
11 ],
12 "paths": {
13 "/acts/apify~pgvector-integration/run-sync-get-dataset-items": {
14 "post": {
15 "operationId": "run-sync-get-dataset-items-apify-pgvector-integration",
16 "x-openai-isConsequential": false,
17 "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
18 "tags": [
19 "Run Actor"
20 ],
21 "requestBody": {
22 "required": true,
23 "content": {
24 "application/json": {
25 "schema": {
26 "$ref": "#/components/schemas/inputSchema"
27 }
28 }
29 }
30 },
31 "parameters": [
32 {
33 "name": "token",
34 "in": "query",
35 "required": true,
36 "schema": {
37 "type": "string"
38 },
39 "description": "Enter your Apify token here"
40 }
41 ],
42 "responses": {
43 "200": {
44 "description": "OK"
45 }
46 }
47 }
48 },
49 "/acts/apify~pgvector-integration/runs": {
50 "post": {
51 "operationId": "runs-sync-apify-pgvector-integration",
52 "x-openai-isConsequential": false,
53 "summary": "Executes an Actor and returns information about the initiated run in response.",
54 "tags": [
55 "Run Actor"
56 ],
57 "requestBody": {
58 "required": true,
59 "content": {
60 "application/json": {
61 "schema": {
62 "$ref": "#/components/schemas/inputSchema"
63 }
64 }
65 }
66 },
67 "parameters": [
68 {
69 "name": "token",
70 "in": "query",
71 "required": true,
72 "schema": {
73 "type": "string"
74 },
75 "description": "Enter your Apify token here"
76 }
77 ],
78 "responses": {
79 "200": {
80 "description": "OK",
81 "content": {
82 "application/json": {
83 "schema": {
84 "$ref": "#/components/schemas/runsResponseSchema"
85 }
86 }
87 }
88 }
89 }
90 }
91 },
92 "/acts/apify~pgvector-integration/run-sync": {
93 "post": {
94 "operationId": "run-sync-apify-pgvector-integration",
95 "x-openai-isConsequential": false,
96 "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
97 "tags": [
98 "Run Actor"
99 ],
100 "requestBody": {
101 "required": true,
102 "content": {
103 "application/json": {
104 "schema": {
105 "$ref": "#/components/schemas/inputSchema"
106 }
107 }
108 }
109 },
110 "parameters": [
111 {
112 "name": "token",
113 "in": "query",
114 "required": true,
115 "schema": {
116 "type": "string"
117 },
118 "description": "Enter your Apify token here"
119 }
120 ],
121 "responses": {
122 "200": {
123 "description": "OK"
124 }
125 }
126 }
127 }
128 },
129 "components": {
130 "schemas": {
131 "inputSchema": {
132 "type": "object",
133 "required": [
134 "postgresSqlConnectionStr",
135 "postgresCollectionName",
136 "embeddingsProvider",
137 "embeddingsApiKey",
138 "datasetFields"
139 ],
140 "properties": {
141 "postgresSqlConnectionStr": {
142 "title": "Postgres SQL connection string",
143 "type": "string",
144 "description": "Connection string for the Postgres SQL database in the format `postgresql://user:password@host:port/database`"
145 },
146 "postgresCollectionName": {
147 "title": "Postgres SQL collection name",
148 "type": "string",
149 "description": "The name of the collection to use. NOTE: This is not the name of the table, but the name of the collection"
150 },
151 "embeddingsProvider": {
152 "title": "Embeddings provider (as defined in the langchain API)",
153 "enum": [
154 "OpenAI",
155 "Cohere"
156 ],
157 "type": "string",
158 "description": "Choose the embeddings provider to use for generating embeddings",
159 "default": "OpenAI"
160 },
161 "embeddingsConfig": {
162 "title": "Configuration for embeddings provider",
163 "type": "object",
164 "description": "Configure the parameters for the LangChain embedding class. Key points to consider:\n\n1. Typically, you only need to specify the model name. For example, for OpenAI, set the model name as {\"model\": \"text-embedding-3-small\"}.\n\n2. It's required to ensure that the vector size of your embeddings matches the size of embeddings in the database.\n\n3. Here are examples of embedding models:\n - [OpenAI](https://platform.openai.com/docs/guides/embeddings): `text-embedding-3-small`, `text-embedding-3-large`, etc.\n - [Cohere](https://docs.cohere.com/docs/cohere-embed): `embed-english-v3.0`, `embed-multilingual-light-v3.0`, etc.\n\n4. For more details about other parameters, refer to the [LangChain documentation](https://python.langchain.com/docs/integrations/text_embedding/)."
165 },
166 "embeddingsApiKey": {
167 "title": "Embeddings API KEY (whenever applicable, depends on provider)",
168 "type": "string",
169 "description": "Value of the API KEY for the embeddings provider (if required).\n\n For example for OpenAI it is OPENAI_API_KEY, for Cohere it is COHERE_API_KEY)"
170 },
171 "datasetFields": {
172 "title": "Dataset fields to select from the dataset results and store in the database",
173 "type": "array",
174 "description": "This array specifies the dataset fields to be selected and stored in the vector store. Only the fields listed here will be included in the vector store.\n\nFor instance, when using the Website Content Crawler, you might choose to include fields such as `text`, `url`, and `metadata.title` in the vector store.",
175 "default": [
176 "text"
177 ],
178 "items": {
179 "type": "string"
180 }
181 },
182 "metadataDatasetFields": {
183 "title": "Dataset fields to select from the dataset and store as metadata in the database",
184 "type": "object",
185 "description": "A list of dataset fields which should be selected from the dataset and stored as metadata in the vector stores.\n\nFor example, when using the Website Content Crawler, you might want to store `url` in metadata. In this case, use `metadataDatasetFields parameter as follows {\"url\": \"url\"}`"
186 },
187 "metadataObject": {
188 "title": "Custom object to be stored as metadata in the vector store database",
189 "type": "object",
190 "description": "This object allows you to store custom metadata for every item in the vector store.\n\nFor example, if you want to store the `domain` as metadata, use the `metadataObject` like this: {\"domain\": \"apify.com\"}."
191 },
192 "datasetId": {
193 "title": "Dataset ID",
194 "type": "string",
195 "description": "Dataset ID (when running standalone without integration)"
196 },
197 "dataUpdatesStrategy": {
198 "title": "Update strategy (add, upsert, deltaUpdates (default))",
199 "enum": [
200 "add",
201 "upsert",
202 "deltaUpdates"
203 ],
204 "type": "string",
205 "description": "Choose the update strategy for the integration. The update strategy determines how the integration updates the data in the database.\n\nThe available options are:\n\n- **Add data** (`add`):\n - Always adds new records to the database.\n - No checks for existing records or updates are performed.\n - Useful when appending data without concern for duplicates.\n\n- **Upsert data** (`upsert`):\n - Updates existing records if they match a key or identifier.\n - Inserts new records into the database if they don't already exist.\n - Ideal for ensuring the database contains the most up-to-date data, avoiding duplicates.\n\n- **Update changed data based on deltas** (`deltaUpdates`):\n - Performs incremental updates by identifying differences (deltas) between the new dataset and the existing records.\n - Only adds new records and updates those that have changed.\n - Unchanged records are left untouched.\n - Maximizes efficiency by reducing unnecessary updates.\n\nSelect the strategy that best fits your use case.",
206 "default": "deltaUpdates"
207 },
208 "dataUpdatesPrimaryDatasetFields": {
209 "title": "Dataset fields to uniquely identify dataset items (only relevant when dataUpdatesStrategy is `upsert` or `deltaUpdates`)",
210 "type": "array",
211 "description": "This array contains fields that are used to uniquely identify dataset items, which helps to handle content changes across different runs.\n\nFor instance, in a web content crawling scenario, the `url` field could serve as a unique identifier for each item.",
212 "default": [
213 "url"
214 ],
215 "items": {
216 "type": "string"
217 }
218 },
219 "enableDeltaUpdates": {
220 "title": "Enable incremental updates for objects based on deltas (deprecated)",
221 "type": "boolean",
222 "description": "When set to true, this setting enables incremental updates for objects in the database by comparing the changes (deltas) between the crawled dataset items and the existing objects, uniquely identified by the `datasetKeysToItemId` field.\n\n The integration will only add new objects and update those that have changed, reducing unnecessary updates. The `datasetFields`, `metadataDatasetFields`, and `metadataObject` fields are used to determine the changes.",
223 "default": true
224 },
225 "deleteExpiredObjects": {
226 "title": "Delete expired objects from the database",
227 "type": "boolean",
228 "description": "When set to true, delete objects from the database that have not been crawled for a specified period.",
229 "default": true
230 },
231 "expiredObjectDeletionPeriodDays": {
232 "title": "Delete expired objects from the database after a specified number of days",
233 "minimum": 0,
234 "type": "integer",
235 "description": "This setting allows the integration to manage the deletion of objects from the database that have not been crawled for a specified period. It is typically used in subsequent runs after the initial crawl.\n\nWhen the value is greater than 0, the integration checks if objects have been seen within the last X days (determined by the expiration period). If the objects are expired, they are deleted from the database. The specific value for `deletedExpiredObjectsDays` depends on your use case and how frequently you crawl data.\n\nFor example, if you crawl data daily, you can set `deletedExpiredObjectsDays` to 7 days. If you crawl data weekly, you can set `deletedExpiredObjectsDays` to 30 days.",
236 "default": 30
237 },
238 "performChunking": {
239 "title": "Enable text chunking",
240 "type": "boolean",
241 "description": "When set to true, the text will be divided into smaller chunks based on the settings provided below. Proper chunking helps optimize retrieval and ensures accurate and efficient responses.",
242 "default": true
243 },
244 "chunkSize": {
245 "title": "Maximum chunk size",
246 "minimum": 1,
247 "type": "integer",
248 "description": "Defines the maximum number of characters in each text chunk. Choosing the right size balances between detailed context and system performance. Optimal sizes ensure high relevancy and minimal response time.",
249 "default": 2000
250 },
251 "chunkOverlap": {
252 "title": "Chunk overlap",
253 "minimum": 0,
254 "type": "integer",
255 "description": "Specifies the number of overlapping characters between consecutive text chunks. Adjusting this helps maintain context across chunks, which is crucial for accuracy in retrieval-augmented generation systems.",
256 "default": 0
257 }
258 }
259 },
260 "runsResponseSchema": {
261 "type": "object",
262 "properties": {
263 "data": {
264 "type": "object",
265 "properties": {
266 "id": {
267 "type": "string"
268 },
269 "actId": {
270 "type": "string"
271 },
272 "userId": {
273 "type": "string"
274 },
275 "startedAt": {
276 "type": "string",
277 "format": "date-time",
278 "example": "2025-01-08T00:00:00.000Z"
279 },
280 "finishedAt": {
281 "type": "string",
282 "format": "date-time",
283 "example": "2025-01-08T00:00:00.000Z"
284 },
285 "status": {
286 "type": "string",
287 "example": "READY"
288 },
289 "meta": {
290 "type": "object",
291 "properties": {
292 "origin": {
293 "type": "string",
294 "example": "API"
295 },
296 "userAgent": {
297 "type": "string"
298 }
299 }
300 },
301 "stats": {
302 "type": "object",
303 "properties": {
304 "inputBodyLen": {
305 "type": "integer",
306 "example": 2000
307 },
308 "rebootCount": {
309 "type": "integer",
310 "example": 0
311 },
312 "restartCount": {
313 "type": "integer",
314 "example": 0
315 },
316 "resurrectCount": {
317 "type": "integer",
318 "example": 0
319 },
320 "computeUnits": {
321 "type": "integer",
322 "example": 0
323 }
324 }
325 },
326 "options": {
327 "type": "object",
328 "properties": {
329 "build": {
330 "type": "string",
331 "example": "latest"
332 },
333 "timeoutSecs": {
334 "type": "integer",
335 "example": 300
336 },
337 "memoryMbytes": {
338 "type": "integer",
339 "example": 1024
340 },
341 "diskMbytes": {
342 "type": "integer",
343 "example": 2048
344 }
345 }
346 },
347 "buildId": {
348 "type": "string"
349 },
350 "defaultKeyValueStoreId": {
351 "type": "string"
352 },
353 "defaultDatasetId": {
354 "type": "string"
355 },
356 "defaultRequestQueueId": {
357 "type": "string"
358 },
359 "buildNumber": {
360 "type": "string",
361 "example": "1.0.0"
362 },
363 "containerUrl": {
364 "type": "string"
365 },
366 "usage": {
367 "type": "object",
368 "properties": {
369 "ACTOR_COMPUTE_UNITS": {
370 "type": "integer",
371 "example": 0
372 },
373 "DATASET_READS": {
374 "type": "integer",
375 "example": 0
376 },
377 "DATASET_WRITES": {
378 "type": "integer",
379 "example": 0
380 },
381 "KEY_VALUE_STORE_READS": {
382 "type": "integer",
383 "example": 0
384 },
385 "KEY_VALUE_STORE_WRITES": {
386 "type": "integer",
387 "example": 1
388 },
389 "KEY_VALUE_STORE_LISTS": {
390 "type": "integer",
391 "example": 0
392 },
393 "REQUEST_QUEUE_READS": {
394 "type": "integer",
395 "example": 0
396 },
397 "REQUEST_QUEUE_WRITES": {
398 "type": "integer",
399 "example": 0
400 },
401 "DATA_TRANSFER_INTERNAL_GBYTES": {
402 "type": "integer",
403 "example": 0
404 },
405 "DATA_TRANSFER_EXTERNAL_GBYTES": {
406 "type": "integer",
407 "example": 0
408 },
409 "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
410 "type": "integer",
411 "example": 0
412 },
413 "PROXY_SERPS": {
414 "type": "integer",
415 "example": 0
416 }
417 }
418 },
419 "usageTotalUsd": {
420 "type": "number",
421 "example": 0.00005
422 },
423 "usageUsd": {
424 "type": "object",
425 "properties": {
426 "ACTOR_COMPUTE_UNITS": {
427 "type": "integer",
428 "example": 0
429 },
430 "DATASET_READS": {
431 "type": "integer",
432 "example": 0
433 },
434 "DATASET_WRITES": {
435 "type": "integer",
436 "example": 0
437 },
438 "KEY_VALUE_STORE_READS": {
439 "type": "integer",
440 "example": 0
441 },
442 "KEY_VALUE_STORE_WRITES": {
443 "type": "number",
444 "example": 0.00005
445 },
446 "KEY_VALUE_STORE_LISTS": {
447 "type": "integer",
448 "example": 0
449 },
450 "REQUEST_QUEUE_READS": {
451 "type": "integer",
452 "example": 0
453 },
454 "REQUEST_QUEUE_WRITES": {
455 "type": "integer",
456 "example": 0
457 },
458 "DATA_TRANSFER_INTERNAL_GBYTES": {
459 "type": "integer",
460 "example": 0
461 },
462 "DATA_TRANSFER_EXTERNAL_GBYTES": {
463 "type": "integer",
464 "example": 0
465 },
466 "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
467 "type": "integer",
468 "example": 0
469 },
470 "PROXY_SERPS": {
471 "type": "integer",
472 "example": 0
473 }
474 }
475 }
476 }
477 }
478 }
479 }
480 }
481 }
482}
PGVector Integration OpenAPI definition
OpenAPI is a standard for designing and describing RESTful APIs, allowing developers to define API structure, endpoints, and data formats in a machine-readable way. It simplifies API development, integration, and documentation.
OpenAPI is effective when used with AI agents and GPTs by standardizing how these systems interact with various APIs, for reliable integrations and efficient communication.
By defining machine-readable API specifications, OpenAPI allows AI models like GPTs to understand and use varied data sources, improving accuracy. This accelerates development, reduces errors, and provides context-aware responses, making OpenAPI a core component for AI applications.
You can download the OpenAPI definitions for PGVector Integration from the options below:
If you’d like to learn more about how OpenAPI powers GPTs, read our blog post.
You can also check out our other API clients:
Pricing
Pricing model
Pay per usageThis Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage.