AI agents for PostgreSQL
The production database your reports should come from. AGNT connects to PostgreSQL so agents can read what happens there, reason about it, and act — with a receipt for every run.
Report Assembler is a ready-made agent that works in PostgreSQL — free, and it runs on your machine.
PostgreSQL and AGNT, in brief
| What it does | Lets an AGNT agent read from and act in PostgreSQL. |
|---|---|
| Connects with | Connection string — held in the local vault |
| AGNT node | custom-api, or the zapier-action bridge |
| Runs when | A scheduled query runs |
| Typical build time | Ten minutes |
| Where data goes | Nowhere by default — AGNT runs on your machine and credentials never leave it. |
What you can automate
Reacts when…
- a scheduled query runs
- a threshold is crossed
Agents can…
- run parameterised queries
- write validated rows
- produce report extracts
Teams use it for
- metrics pulled straight from source
- anomalies caught by scheduled checks
- clean extracts for the weekly report
Build it: the PostgreSQL workflow
Design goal for PostgreSQL: metrics pulled straight from source; anomalies caught by scheduled checks; clean extracts for the weekly report. The template below supplies configurable nodes, not the complete logic for those goals.
Use this PostgreSQL setup template to arrange the schedule, input review and API operation. Configure the account-specific fields and add your own decision and approval controls before activation.
This is a schema-checked starting point, not an end-to-end tested automation. Replace every CONFIGURE_ value, choose the operations you intend, connect credentials and map source outputs into later inputs. An edge orders steps; it does not supply a condition, an approval gate or a field mapping. Add and test those controls explicitly before any write. Cloud APIs and model providers may receive data. Keep the workflow inactive until tested with fixtures.
{
"id": "d4eb8cc1-c598-4426-a22d-ce4703dad880",
"name": "PostgreSQL — read, decide, act",
"nodes": [
{
"id": "8ac57a6b-420e-4f6e-a45b-485d1a343534",
"text": "Run on a schedule",
"x": 512,
"y": 144,
"isEditing": false,
"type": "trigger-timer",
"icon": "clock",
"category": "trigger",
"isSelected": false,
"parameters": {
"fireOnStart": "No",
"scheduleType": "Interval",
"schedule": "Every 15 Minutes"
},
"description": "Setup template for Timer Trigger. This trigger node fires the workflow at specified intervals or at a specific time. Configure credentials, inputs and output mapping before use.",
"error": null,
"isActive": false,
"output": null,
"outputs": {}
},
{
"id": "1f042846-83ea-4af6-ad72-f2ba97321280",
"text": "Review source and draft",
"x": 512,
"y": 336,
"isEditing": false,
"type": "agnt-agent",
"icon": "agnt",
"category": "action",
"isSelected": false,
"parameters": {
"agentId": "CONFIGURE_AGENTID",
"message": "Decide what needs to happen in PostgreSQL. Explain your reasoning.\nSource input: CONFIGURE_SOURCE_INPUT. Produce a reviewable draft only; do not take external actions."
},
"description": "Setup template for Agent Chat. Chat with an AI agent from your agent library. Select an agent and send messages to interact with it within your workflow. Configure credentials, inputs and output mapping before use.",
"error": null,
"isActive": false,
"output": null,
"outputs": {}
},
{
"id": "a40dd042-0792-4ee3-a568-31e96c1df342",
"text": "Call the PostgreSQL API",
"x": 512,
"y": 528,
"isEditing": false,
"type": "custom-api",
"icon": "connect",
"category": "action",
"isSelected": false,
"parameters": {
"url": "postgresql://{user}:{password}@{host}:5432/{database}",
"authType": "None",
"headers": "{}",
"method": "GET",
"query": ""
},
"description": "Setup template for Custom API Request. This action node makes a custom API request to any endpoint with configurable method, headers, and authentication. Configure credentials, inputs and output mapping before use.",
"error": null,
"isActive": false,
"output": null,
"outputs": {}
}
],
"edges": [
{
"id": "a4aba3e1-f795-4108-a617-1df78f29c3f0",
"start": {
"id": "8ac57a6b-420e-4f6e-a45b-485d1a343534",
"type": "output"
},
"end": {
"id": "1f042846-83ea-4af6-ad72-f2ba97321280",
"type": "input"
},
"startX": 800,
"startY": 168,
"endX": 512,
"endY": 360
},
{
"id": "1160527d-8d60-4563-a481-9396a02346ca",
"start": {
"id": "1f042846-83ea-4af6-ad72-f2ba97321280",
"type": "output"
},
"end": {
"id": "a40dd042-0792-4ee3-a568-31e96c1df342",
"type": "input"
},
"startX": 800,
"startY": 360,
"endX": 512,
"endY": 552
}
],
"zoomLevel": 1,
"canvasOffsetX": 0,
"canvasOffsetY": 0,
"isTinyNodeMode": false
}
Configure Custom API Request
This action node makes a custom API request to any endpoint with configurable method, headers, and authentication.
- url — The URL of the API endpoint Current example:
postgresql://{user}:{password}@{host}:5432/{database}. - method — The HTTP method for the request Current example:
GET. - authType — The type of authentication Current example:
None. - query — Query parameters for the request (e.g., 'key1=value1&key2=value2') Current example:
. - headers — Optional headers for the request. e.g., {"Content-Type": "application/json"} Current example:
{}.
Install Report Assembler — it runs on PostgreSQL
Report Assembler is a working agent that uses PostgreSQL. Installing it drops the whole workflow onto your canvas — connected, editable, and yours to change.
Runs on your own machine · See what it does
Reports should come from the source
Numbers copied into a spreadsheet are stale the moment they are pasted. Querying the production database at run time means a report describes the system as it is, and the query is written once rather than reconstructed each cycle.
Parameterised, not improvised
Database access from an agent needs the same discipline as from any application: parameterised queries, a scoped role, and read-only credentials wherever writing is not required. The scoping belongs to the connection rather than to the model’s good behaviour.
PostgreSQL without a first-party node
There is no first-party PostgreSQL node yet, and a page implying otherwise would cost you an afternoon. What works today is the generic custom-api node pointed at PostgreSQL’s own API, authenticating with connection string.
| What you need | Value |
|---|---|
| Endpoint | postgresql://{user}:{password}@{host}:5432/{database} |
| Method | SQL |
| Authentication | Connection string |
| Header | n/a — credentials live in the connection string |
| Reference | PostgreSQL API documentation |
Worth knowing: Not an HTTP API. Reach it from an execute-javascript node, or put PostgREST in front of it if you want custom-api to work directly.
Where PostgreSQL integrations usually go wrong
Not an HTTP API. Reach it from an execute-javascript node, or put PostgREST in front of it if you want custom-api to work directly.
It is worth getting right first, because the failure is quiet rather than loud — you get a response, it just is not the one you wanted. Once past it, PostgreSQL is a straightforward API to automate against.
Connect PostgreSQL in two minutes
- Download AGNT Community Core — free, local-first, no account needed to run.
- Connects to your local instance directly — no cloud account required, nothing leaves your machine.
- Drop the PostgreSQL node into a workflow or hand it to an agent — the first run produces a receipt you can read line by line.
PostgreSQL + AGNT — common questions
Is it safe to give an agent database access?
With a scoped, read-only role for reporting work, yes. Restriction belongs at the credential, not in the prompt.
Can scheduled checks catch anomalies?
Yes — a scheduled query crossing a threshold can trigger a run and a briefing.
Can agents write to the database?
Yes where you grant it, with validation before the write and a receipt afterwards.