AI Agent Hub
Back to skills
BI Query Smart Analytics icon

BI Query Smart Analytics

Data Analysis Updated 2026.08.29

Paste the following prompt into your AI chat to install this skill:

Please install @user_4203c0d6/bi-query according to https://skillhub.cn/install/skillhub.md.

About this skill

The problem

Analysts and product teams often need quick answers such as “What was GMV this month?” or “Which SKUs are out of stock?” Writing SQL by hand is still frictionful: schemas are large, field names are unclear, and production databases need protection. bi-query turns a data question into a controlled read-only pipeline: confirm schema context, generate SQL, execute it safely, and summarize the result.

How it works

The skill uses config.json for the MySQL connection and creates a lightweight references/schema.md index. When answering, it reads that index, fetches column details only for relevant tables via scripts/get_schema.py --mode detail --tables t1,t2, then generates SQL and runs it through scripts/query_mysql.py. Its guidance favors table aliases, WHERE filters, aggregation, ORDER BY, LIMIT, NULL handling, and date functions; large tables should use index-friendly filters. Server-side validation allows only SELECT, SHOW, DESCRIBE, and EXPLAIN; DML/DDL and multi-statement queries are blocked, with a default LIMIT 1000 and 30-second timeout. The response usually includes a plain-language answer, key metrics, and up to 20 rows, but it does not show the generated SQL to the user.

Boundaries

It fits read-only analytics over structured MySQL tables, especially simple statistical questions. It is not intended for writes, bulk exports, or complex warehouse modeling. If the schema changes, the schema cache should be regenerated; timeouts or empty results usually point to filters, date ranges, or field definitions.

Use Cases

  • Product operations reviews campaign metrics by asking for GMV, conversion, and refunds from MySQL tables.
  • Data engineers set up a read-only Q&A path for new teams to query order and inventory metrics by date range.
  • Customer support leads investigate fulfillment issues by asking for unshipped orders in a region over seven days.
  • Growth teams prepare weekly materials by querying retention and new-user trends from user behavior tables.

Best For

  • Product operations staff who need date-, region-, and channel-based order, GMV, and conversion summaries without writing SQL.
  • Data engineers who need to expose controlled, read-only MySQL querying and result interpretation to business teams.
  • Customer support leads who need to check unshipped, refunded, or out-of-stock orders for a region in recent days.
  • Growth analysts who need new-user, retention, and trend extracts from behavior tables for weekly reviews.