Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / AI Agents & Assistants

AI Agents & Assistants

Chat with Postgres Using Text-to-SQL with OpenAI

When a chat message arrives, an AI agent using OpenAI or DeepSeek reads the Postgres schema, writes SQL queries, and answers questions about the data.

The steps

  1. Window Buffer Memory
  2. No Operation, do nothing
  3. Add table name to output
  4. Save file locally
  5. Extract data from file
  6. Chat Trigger
  7. AI Agent
  8. When clicking "Test workflow"
  9. Combine schema data and chat input
  10. Load the schema from the local file
  11. Extract SQL query
  12. Check if query exists
  13. Format query results
  14. Prepare final output

25 steps in total.

Similar automations