How it Works
When a visitor asks a question that requires database information, the AI agent:- Discovers the database schema (table structure)
- Generates the appropriate SQL query
- Executes the query (read-only) and returns the results
Adding the MySQL Database Action
Configuration
Name (required)
A descriptive name for the action. This helps the AI agent understand what data this database contains. Example:query_inventory
Description (required)
A description of the action and when it should be used. Be specific about what data is available. Example:Use this action when the user asks about product inventory, stock levels, or product details.
Make the Name and Description as specific as possible so the AI agent knows exactly when to use this action and what kind of data to look for.
Host (required)
The hostname or IP address of your MySQL server. Example:db.example.com or 127.0.0.1
Port (required)
The port your MySQL server listens on. Default is3306.
Database Name (required)
The name of the database to connect to. Example:my_database
Username (required)
The MySQL username for authentication.Password (required)
The password for the MySQL user.SSL (optional)
Enable SSL/TLS for the connection. Recommended for cloud-hosted databases such as AWS RDS, Google Cloud SQL, PlanetScale, or DigitalOcean Managed Databases. Enabled by default.Connection Validation
When you save the action, the connection is automatically tested. If the connection fails, you will see an error message on the host field with details about what went wrong. Common issues include:- Incorrect hostname or port
- Wrong username or password
- Firewall blocking the connection
- SSL required but not enabled
Security
- Read-only queries only - the agent can only execute SELECT statements
- Query timeout - queries are limited to 5 seconds to prevent slow queries from affecting your database
- Result size limit - large results are truncated to prevent excessive data transfer
- All credentials are encrypted at rest
Make sure your MySQL server allows connections from external IP addresses. You may need to update your firewall rules or security group settings to allow connections from the SiteSpeak server.
Example Use Case
With an e-commerce database, your chatbot can answer questions like:- “What products do you have in stock?”
- “What is the price of the Pro Plan?”
- “How many orders were placed this month?”
- “Show me the top-selling products”
Ready to automate your customer service with AI?
Join over 1000+ businesses, websites and startups automating their customer service and other tasks with a custom trained AI agent.