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
Take the simplest useful version: a scheduled query runs in PostgreSQL. Instead of a rule firing blindly, an agent reads the item in full, works out whether it matters and what it means, and then decides whether to run parameterised queries. Over a week that turns metrics pulled straight from source from something a person checks into something that reports to a person.
The shape is deliberately small. A trigger watching PostgreSQL, an agent that judges what arrived, and one action taken only when that judgment warrants it. Everything below is the actual definition, not an illustration of one.
{
"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": {
"interval": "15",
"unit": "minutes"
},
"description": "Checks PostgreSQL every fifteen minutes.",
"error": null,
"isActive": false,
"output": null,
"outputs": {}
},
{
"id": "1f042846-83ea-4af6-ad72-f2ba97321280",
"text": "Work out what should change",
"x": 512,
"y": 336,
"isEditing": false,
"type": "agnt-agent",
"icon": "agnt",
"category": "action",
"isSelected": false,
"parameters": {
"instructions": "Decide what needs to happen in PostgreSQL. Explain your reasoning."
},
"description": "Decides what needs to happen in PostgreSQL, and why.",
"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}",
"method": "SQL",
"authType": "Bearer",
"headers": "{\"Content-Type\": \"application/json\"}"
},
"description": "SQL against the PostgreSQL API, authenticated with connection string.",
"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
}
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.