Turn chat questions into clear answers from your database. The flow can also add a chart when it helps you understand the result. It suits teams that need quick data checks without waiting for a full report.
A public chat trigger starts the process when a message arrives. An information extractor pulls the user question. A SQL agent then queries PostgreSQL and returns a simple summary. A classifier checks if a visual would add value. If a chart is useful, a subworkflow calls OpenAI to create a valid Chart.js definition, then builds a QuickChart image link and returns the answer with the chart. If a chart is not needed, it sends text only. A memory buffer keeps the session context so follow up questions stay on topic. The language model runs at a low temperature for stable output.
Connect your PostgreSQL database and add your OpenAI API key. Expect faster KPI reviews, trend checks, and ad hoc analysis with less back and forth. Teams in operations and analytics can use it for daily metrics, month to date trends, and product breakdowns in minutes. The chart builder uses a compact width so images render well in chat. The subworkflow waits for the chart tool to finish, so users always get a complete response in one go.