Receber por email
← Voltar para o catálogo

alibabacloud-data-agent-skill

Invoque o Alibaba Cloud Apsara Data Agent for Analytics via CLI para análise de dados orientada por linguagem natural em bancos de dados corporativos. Este agente inteligente da equipe de Banco de Dados da Alibaba Cloud automatiza a análise de requisitos, compreensão de dados, insights e geração de relatórios.

47estrelas
Atualizado há 2 meses

Ver no GitHub ↗

Como adicionar

/plugin marketplace add aliyun/data-agent-skill

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/alibabacloud-data-agent-skill/svg)](https://www.skillteca.com.br/skills/alibabacloud-data-agent-skill)

Skills relacionadas

Ver todas de Dados e Análise →

Alerta por categoria

Receba novas skills de Dados e Análise toda segunda

1 email curto, só com as skills novas de Dados e Análise. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

metadata: author: DataAgent Team version: "1.8.0"

Changelog

  • v1.8.0: Add workspace (collaborative space) support, add custom agent support
  • v1.7.2: Use Alibaba Cloud default credential chain instead of explicit AK/SK, add User-Agent header, fix RAM policy wildcard issues
  • v1.7.1: Fix CLI ls command API response parsing (support case-insensitive field names), optimize SKILL documentation structure, separate ANALYSIS mode specification document
  • v1.7.0: API_KEY authentication support, native async execution mode, session isolation, enhanced attach mode, optimized log output

Installation

Configure Credentials

This Skill uses Alibaba Cloud default credential chain (recommended) or API_KEY authentication.

Option 1: Default Credential Chain (Recommended)

The Skill uses Alibaba Cloud SDK's default credential chain to automatically obtain credentials, supporting environment variables, configuration files, instance roles, etc.

See Alibaba Cloud Credential Chain Documentation

Option 2: API_KEY Authentication (File Analysis Only)

export DATA_AGENT_API_KEY=your-api-key
export DATA_AGENT_REGION=cn-hangzhou

Get API_KEY: Data Agent Console

Permission Requirements

RAM users need AliyunDMSFullAccess or AliyunDMSDataAgentFullAccess permissions. See [RAM-POLICIES.md](references/RAM-POLICIES.md) for detailed permission information.

Debug Mode

DATA_AGENT_DEBUG_API=1 python3 scripts/data_agent_cli.py file example.csv -q "analyze"

💡 Getting Started Tips

  • Use the built-in demo database internal_data_employees (DataAgent's built-in test database containing employee, department, and salary data) for first-time experience
  • Or use local file assets/example_game_data.csv for file analysis experience

Data Agent CLI — Unified Command-Line Data Analysis Tool

Overview

scripts/data_agent_cli.py helps users complete the full workflow from discover data → initiate analysis → track progress → get results.

Core Concepts

⚠️ Key Prerequisite: Data Agent can only analyze databases that have been imported into Data Agent Data Center.
- Data Center: Data Agent's data center, only databases here can be analyzed
- DMS: Alibaba Cloud Data Management Service, stores metadata of all databases
- Relationship: Databases registered in DMS ≠ Databases in Data Center
Usage Flow:
1. First use ls to check if the target database exists in Data Center
2. If not found, use dms subcommand to search for database info, then use import subcommand to import it
3. After successful import, you can use db subcommand for analysis

Analysis Modes

  • ASK_DATA (default): Synchronous execution, sub-second response, suitable for quick Q&A
  • ANALYSIS: Deep analysis, takes 5-40 minutes, requires spawning a sub-agent for async execution or using --async-run parameter
See [ANALYSIS_MODE.md](references/ANALYSIS_MODE.md) for details

Workspace (Collaborative Space)

Workspaces are collaborative spaces that enable team-based data analysis with shared sessions, data sources, and access control.

  • List workspaces: Use workspace subcommand to discover available workspaces (personal or shared)
  • Bind session to workspace: Pass --workspace-id <ID> when using db or file to create a session within a specific workspace context
  • Workspace types: MY (default, personal spaces), ALL (all accessible spaces including shared ones)
Note: When a session is created within a workspace, all subsequent API calls (describe, send message, etc.) automatically carry the workspace context.

Custom Agent

Custom Agents are user-defined AI agents with specialized instructions, knowledge bases, and data scope configurations.

  • List custom agents: Use agent subcommand to discover available custom agents (RELEASED status by default)
  • View agent details: Use agent describe --custom-agent-id <ID> to see full agent configuration
  • Bind session to custom agent: Pass --custom-agent-id <ID> when using db or file to create a session powered by a specific custom agent
Note: Custom Agent sessions automatically use the prod stage. The custom agent's instructions, knowledge, and data scope will be applied to the analysis session.

Session Reuse

Use db/file to create a session for initial analysis, then use attach --session-id <ID> to reuse the session for follow-up questions.

See [COMMANDS.md](references/COMMANDS.md) and [WORKFLOWS.md](references/WORKFLOWS.md) for details

Quick Start

# 1. List available databases
python3 scripts/data_agent_cli.py ls

# 2. Query analysis (synchronous response)
python3 scripts/data_agent_cli.py db \
    --dms-instance-id <ID> --dms-db-id <ID> \
    --instance-name <NAME> --db-name <DB> \
    --tables "employees,departments" -q "Which department has the highest average salary"

# 3. Follow-up question (reuse session)
python3 scripts/data_agent_cli.py attach --session-id <ID> -q "Break down by month"

# 4. List workspaces
python3 scripts/data_agent_cli.py workspace

# 5. Query in a specific workspace
python3 scripts/data_agent_cli.py db \
    --workspace-id <WORKSPACE_ID> \
    --dms-instance-id <ID> --dms-db-id <ID> \
    --instance-name <NAME> --db-name <DB> \
    --tables "employees,departments" -q "Which department has the highest average salary"

# Step 6: List available custom agents
data-agent agent

# Step 7: Use a custom agent for analysis
data-agent db --custom-agent-id <AGENT_ID> --dms-instance-id ... -q "your question"
📖 See [WORKFLOWS.md](references/WORKFLOWS.md) and [COMMANDS.md](references/COMMANDS.md) for complete workflows, command reference, and best practices

Project Structure

                          # Skill root directory
├── SKILL.md              # This document
├── scripts/              # Source code
│   ├── data_agent/       # SDK module
│   ├── cli/              # CLI module
│   ├── data_agent_cli.py # CLI entry point
│   └── requirements.txt  # Dependencies
├── sessions/             # Session data
└── references/           # Reference documents
Compartilhar X LinkedIn