Database
Last updated
Was this helpful?
Database enables Agents to query structured data using natural language. When a user asks "How many laptops did we sell last month?", the Agent automatically converts the question into a SQL query, retrieves the answer from the database, and responds in plain language.
The technical name for this feature is Text to SQL.
When your use case involves:
Data queries: Order status, inventory quantities, sales figures
Statistical analysis: "How much did this quarter's revenue grow compared to last quarter?"
Real-time status: "How many pending tickets are there right now?"
The answers to these questions are stored in structured tables, not in documents, so you need a Database rather than a Knowledge Base.
MaiAgent Built-in Database
A database provided by the platform where you can directly upload CSV files or manually create tables
External Database
Connect to your PostgreSQL, MySQL, SQL Server, or Oracle
The Agent only executes read-only queries (SELECT) and will not modify or delete your data. You can also restrict which tables and fields the Agent can access.
Advanced Note: The accuracy of Text to SQL depends on how clearly the table structure is defined. It is recommended to add Chinese descriptions to tables and fields to help the Agent understand what each field represents.
Create a database connection — Select the database type and configure connection details
Set accessible tables — Choose which tables the Agent can query
Add field descriptions — Add descriptions to fields to improve query accuracy
Test queries — Test whether the Agent can query correctly using natural language
Attach to Agent — Link to the Agent as a tool
Last updated
Was this helpful?
Was this helpful?
