An AI agent to chat with you with data, using OpenAI and
Workflow Description
An intelligent AI agent that converses with you based on data stored in PostgreSQL, powered by OpenAI's advanced language models. Receives requests via webhook and delivers contextual, accurate responses through smart conversation memory.
How it works
- 1.Receive conversation request via webhook and determine user intent
- 2.Retrieve conversation history and relevant data from PostgreSQL
- 3.Process the request with OpenAI model using stored context
- 4.Store new exchange in memory and database for future conversations
- 5.Send response via webhook with additional interaction options
Use cases
- Build an intelligent customer support assistant that understands your interaction history
- Create a data analysis bot that combines stored information with real-time processing
- Develop an interactive sales agent that learns from customer records
Requirements
- Active OpenAI account with valid API key
- PostgreSQL database with tables for storing conversations and reference data
- Configured webhook endpoint to receive requests and send responses
Service Value
Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.
Apps Used
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (30)
Postgres Chat Memory
Memory Postgres Chat
OpenAI Chat Model
OpenAI
Set fields
Set
Sticky Note
Sticky Note
Webhook - ChatInput
Webhook
Sticky Note1
Sticky Note
Respond to Webhook
Webhook
Sticky Note2
Sticky Note
Call Search Console Tool
Tool Workflow
Sticky Note3
Sticky Note
Sticky Note4
Sticky Note
Sticky Note6
Sticky Note
Sticky Note5
Sticky Note
Sticky Note7
Sticky Note
Tool calling
Execute Workflow Trigger
Switch
Switch
Set fields - Consruct API CALL
Set
Sticky Note8
Sticky Note
Set fields - Create searchConsoleDataArray
Set
Set fields - Create searchConsoleDataArray 2
Set
Search Console - Get Custom Insights
HTTP Request
Sticky Note9
Sticky Note
Sticky Note10
Sticky Note
## Search Console - Get List of Properties
HTTP Request
Sticky Note11
Sticky Note
Sticky Note12
Sticky Note
Array aggregation - response to AI Agent
Aggregate
Array aggregation - response to AI Agent1
Aggregate
Sticky Note13
Sticky Note
AI Agent
Agent