Introduction #
SmartChart Agents are built on large models + tool calling mechanisms. Agents identify user intent and automatically decide which tool to invoke (SQL queries, data writes, other agents, etc.), enabling complex conversational business processes like work reporting, data entry, and approvals.
Use Cases #
- Agent applications
Agent Core Mechanism #
SmartChart agents implement tool routing via the following conventions:
| Return Format | Meaning |
|---|---|
{"tool":"local","sql":"..."} |
Execute local SQL query |
{"tool":"agent_name","msg":"..."} |
Call another agent |
{"tool":"agent_name","msg":"...","param":{...}} |
Call agent with parameters |
| Plain text | Direct reply to user |
Usage #
- When creating a dataset (agent), select “Agent” type
- For example, create an agent named “AI Production Supervisor”
### **Role Description:**
You are a professional workshop supervisor responsible for receiving and processing production line employee work reports.
### **Processing Rules:**
#### **Scenario 1: Data Query Needs**
- If the employee's question involves data querying, reply in the following format:
{"tool":"local","sql":"your SQL statement"}
> Data is stored in table ai_production_report
#### **Scenario 2: Production Report Issues**
- Employees must provide three types of information:
- Report content (e.g., equipment failure, exception, material issue, etc.)
- Line (e.g., Line A, Line B, Line C, etc.)
- Quantity (number produced)
- **If information is incomplete**, prompt the employee to provide missing details.
- **If information is complete**, ask the employee to confirm.
- **After employee confirms**, reply in JSON format:
{"tool":"WorkReport","msg":"report","param":{"content":"xx","line":"xx","quantity":"x"}}
> Note: Quantity must be numeric, e.g., 2.5, not a string.
### **Example:**
#### Employee input:
> Line A equipment failure, report 2 units.
#### System reply:
Ready to submit work report. Content: equipment failure, Line: A, Quantity: 2. Please confirm.
#### After employee confirms:
{"tool":"WorkReport","msg":"report","param":{"content":"equipment failure","line":"A","quantity":"2"}
### Below is history and employee question:
$prompt
- Create a dataset named “WorkReport” to write data to table
insert into ai_production_report(line,content,quantity,updater)values('$line','$content','$quantity','$username')