Agricultural Data Query

Use Case: Building a Real-time Agricultural Data Query Assistant

If you are an agricultural professional, such as a farmer, wholesaler, retailer, or agricultural policy maker in the public sector, you can access real-time agricultural product transaction data through the Ministry of Agriculture's public APIs to analyze and predict market prices and trading trends for various agricultural products (such as rice, fruits, vegetables, livestock products, etc.), and further conduct data analysis to improve decision-making efficiency.

Application Process

1. Create Agricultural Product Trading Query Tool

Obtain API Configuration

First, you can obtain the required data integration source through the API section of the Agricultural Data Open Platform according to your needs.

Using agricultural product trading information as an example for tool setup, click the "Try it out" button in the Parameters section, then click "Execute" to obtain the API configuration data.

Create API Tool

Go to the MaiAgent platform's left sidebar, click "Tools", then click "Add Tool"

Enter the display name, tool name, select API as the tool type, and fill in the description for this tool

For the API configuration below, you can take a screenshot of the API information interface from the Agricultural Data Open Platform and paste it to the MaiAgent Tool Creation Assistant to quickly obtain the API URL, HTTP method, headers, and parameter structure content.

  • API URL Example: https://data.moa.gov.tw/api/v1/AgriProductsTransType/

  • HTTP Method Example: GET

  • Headers (JSON) Example:

{
  "Accept": "application/json"
}
  • Parameter Structure (JSON Schema) Example:

{
  "type": "object",
  "required": [
    "Start_time",
    "End_time"
  ],
  "properties": {
    "End_time": {
      "type": "string",
      "description": "Query end date (format: ROC year.month.day, e.g.: 107.07.10)"
    },
    "Start_time": {
      "type": "string",
      "description": "Query start date (format: ROC year.month.day, e.g.: 107.07.01)"
    }
  }
}

2. Create Agricultural Data Query AI Assistant

Create AI Assistant

Go to the MaiAgent platform's left sidebar, click "AI Assistant", then click "Create AI Assistant"

Select "Agent" as the response mode and enter the role instructions

Configure Tools for AI Assistant

Select the "Tools" tab, click "+ Select Tool"

Select the agricultural product trading query tool you just created and click confirm

3. AI Assistant Online Application

Now you can directly ask questions through the AI assistant Q&A interface to quickly query agricultural product transaction volumes, average price changes, and other information, instantly grasp market prices and trading trends, facilitating further data analysis and improving decision-making efficiency!

You can also check the tool invocation records when the AI assistant responds in the "All Conversations" function of the MaAgent platform.

Last updated

Was this helpful?