# Chatbot for natural language queries to MySQL with conversation memory
This automation template allows users to ask questions about their MySQL database in plain language via chat and receive accurate answers based on real data. Using an AI agent powered by OpenAI and LangChain, the system automatically generates and executes correct SQL queries, enabling easy data access even for non-technical users.
## Who it´s for
- Internal analysts who need quick database access without writing SQL.
- Managers requesting reports through chat.
- System administrators aiming to provide a user-friendly database interface.
- Developers testing AI-to-SQL integrations.
## What the automation does
- Receives a user question via chat in natural language.
- Analyzes the MySQL database schema using LangChain tools.
- Generates a secure and accurate SQL query using OpenAI´s model.
- Executes the query and returns results in a readable format.
- Maintains context from up to 5 previous messages for conversational continuity.
- Handles follow-up questions and refined queries.
## What´s included
- Ready-to-use n8n workflow.
- Trigger logic for ´new chat message´.
- Integrations with OpenAI API and MySQL.
- Basic setup and adaptation guide.
## Requirements for setup
- Access to an n8n instance or account.
- Active OpenAI account with API key.
- MySQL database access (host, port, credentials, database name).
- Database schema must be readable by the agent.
## Benefits and outcomes
- Faster data retrieval by eliminating manual SQL writing.
- Reduced load on IT and analytics teams.
- Simplified data access for non-technical users.
- Context retention improves accuracy of follow-up queries.
- Automated query generation reduces human error.
- Flexible usage—from simple counts to complex JOINs.
## Important: template only
Important: you are purchasing a ready-made automation workflow template only. Rollout into your infrastructure, connecting specific accounts and services, 1:1 setup help, custom adjustments for non-standard stacks and any consulting support are provided as a separate paid service at an individual rate. To discuss custom work or 1:1 help, contact via chat
No feedback yet