
Alibabacloud Analyticdb Postgresql Ai Coaching Best Practice
- 127 installs
- 208 repo stars
- Updated August 4, 2026
- aliyun/alibabacloud-aiops-skills
Apply AnalyticDB for PostgreSQL AI coaching and documented best practices when designing schemas, tuning queries, and maintaining PostgreSQL-compatible analytics deployments.
About
Skill delivering AI coaching aligned with AnalyticDB for PostgreSQL best practices, covering schema design, query optimization, reliability patterns, and ongoing operational excellence for cloud analytics databases.
- PostgreSQL analytics best practices
- AI-guided operational coaching
- Schema and indexing recommendations
- Performance and reliability patterns
- AnalyticDB PostgreSQL specialization
Alibabacloud Analyticdb Postgresql Ai Coaching Best Practice by the numbers
- 127 all-time installs (skills.sh)
- Ranked #297 of 911 Databases skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aliyun/alibabacloud-aiops-skills --skill alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 127 |
|---|---|
| repo stars | ★ 208 |
| Last updated | August 4, 2026 |
| Repository | aliyun/alibabacloud-aiops-skills ↗ |
What it does
Apply AnalyticDB for PostgreSQL AI coaching and documented best practices when designing schemas, tuning queries, and maintaining PostgreSQL-compatible analytics deployments.
Files
ADBPG AI Coaching Best Practice
Build RAG-driven coaching systems using ADBPG Supabase (training data management) + ADBPG Vector Knowledge Base (RAG-driven intelligent coaching).
Core Capabilities:
- Supabase Project: PostgreSQL-based platform for managing coaching domains, learners, and session records
- Vector Knowledge Base: ADBPG instance with vector optimization for RAG-driven coaching
- Seamless Integration: Supabase stores structured data, ADBPG powers intelligent AI coaching dialogue
---
Pre-check: Aliyun CLI >= 3.3.3 Required
IMPORTANT: Run aliyun version to verify >= 3.3.3. If not installed or version too low,run curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash to update,or see references/cli-installation-guide.md for installation instructions.
>
Then [MUST] run aliyun configure set --auto-plugin-install true to enable automatic plugin installation.[MUST] run aliyun plugin update to ensure that any existing plugins on your local machine are always up-to-date.---
[MUST] CLI User-Agent
Every `aliyun` CLI command invocation must include:
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice---
[MUST] CLI AI-Mode Configuration
At the start of the Core Workflow (before any CLI invocation):
[MUST] Enable AI-Mode — AI-mode is required for Agent Skill execution. Run the following commands before any CLI invocation:
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice"[MUST] Disable AI-Mode at EVERY exit point — Before delivering the final response for ANY reason, always disable AI-mode first. This applies to ALL exit paths: workflow success, workflow failure, error/exception, user cancellation, session end, or any other scenario where no further CLI commands will be executed. AI-mode is only used for Agent Skill invocation scenarios and MUST NOT remain enabled after the skill stops running.
aliyun configure ai-mode disable---
Pre-check: Alibaba Cloud Credentials Required
Security Rules:
- NEVER read, echo, or print AK/SK values
- NEVER ask the user to input AK/SK directly
- NEVER print passwords or API Keys in plain text in logs or stdout
- ONLY use aliyun configure list to check credential status- When displaying API Keys, show only the first 6 characters +***(e.g.,sk-abc1***)
aliyun configure listIf no valid profile exists, STOP here. Configure credentials outside of this session via aliyun configure or environment variables.
---
Scenario Description
| Scenario | Use Case | Target Users |
|---|---|---|
| Workflow Coaching | Guide professionals through structured business processes (sales cycles, project management) | Sales teams, project managers |
| Decision Support | Help engineers evaluate trade-offs and make informed technical decisions | Engineers, architects |
| Skill Development | Develop communication, negotiation, or technical skills through guided practice | Professionals, new hires |
| Onboarding | Systematically guide new team members through technical and process onboarding | New employees, mentors |
Architecture
User (Web / Terminal / Agent)
│
┌──────┴──────┐
v v
┌─────────────┐ ┌────────────────────────┐
│ Supabase │ │ Agent Mode │
│ (spb-xxx) │ │ ChatWithKnowledgeBase │
│ - Domains │ └───────────┬────────────┘
│ - Sessions │ │
└──────┬──────┘ │
v v
┌────────────────────────────────────────┐
│ ADBPG Instance (gp-xxx) + KB │
│ Domain Knowledge + RAG + LLM │
└────────────────────────────────────────┘---
RAM Policy
Required Permissions
| Operation | RAM Permission |
|---|---|
| Supabase Project Management | gpdb:CreateSupabaseProject, gpdb:GetSupabaseProject, gpdb:ModifySupabaseProjectSecurityIps |
| ADBPG Instance Management | gpdb:CreateDBInstance, gpdb:DescribeDBInstances, gpdb:ModifySecurityIps |
| Account Management | gpdb:DescribeAccounts, gpdb:CreateAccount |
| Knowledge Base Operations | gpdb:InitVectorDatabase, gpdb:CreateNamespace, gpdb:CreateDocumentCollection, gpdb:UploadDocumentAsync, gpdb:ChatWithKnowledgeBase |
| VPC Network | vpc:DescribeVpcs, vpc:DescribeVSwitches, vpc:DescribeVSwitchAttributes |
| NAT Gateway & EIP | vpc:DescribeNatGateways, vpc:CreateNatGateway, vpc:DescribeEipAddresses, vpc:AllocateEipAddress, vpc:AssociateEipAddress, vpc:CreateSnatEntry |
Recommended System Policies: AliyunGPDBFullAccess, AliyunVPCFullAccess (or AliyunVPCReadOnlyAccess if NAT already exists)
See references/ram-policies.md for complete list.
[MUST] Permission Failure Handling: When any command fails due to permission errors:
1. Read references/ram-policies.md for required permissions
2. Use ram-permission-diagnose skill to guide the user3. Pause and wait until user confirms permissions granted
---
Core Workflow
When user says "Help me set up an AI coaching system" or similar, execute the following steps:
Smart Defaults Mode: User only needs minimal input (e.g., "北京i"). The agent auto-parses region, discovers VPC/VSwitch, generates passwords, and presents all parameters for one-click confirmation.
Step 1: Create Supabase Project
Parameters to confirm for this step:
>
| Parameter | Default | Notes |
|-----------|---------|-------|
|RegionId| Auto-parse | "北京i" →cn-beijing, "上海b" →cn-shanghai, "杭州" →cn-hangzhou, "深圳" →cn-shenzhen|
|ZoneId| Auto-parse | "北京i" →cn-beijing-i; query zones when only city provided |
| VpcId | Auto-discover | Query available VPCs, select one with most available IPs || VSwitchId | Auto-discover | Query VSwitches in target zone, select one with most available IPs ||ProjectName|ai_coaching| Supabase project name |
|AccountPassword| Auto-generate | Password rules: 8-32 chars, at least 3 of uppercase/lowercase/digits/special (@#$%^&*), avoid!|
1.1 Check/Create NAT Gateway
Important: Supabase public connection requires a NAT Gateway with SNAT rules in the VPC.
# Check existing NAT Gateways in VPC
aliyun vpc describe-nat-gateways --profile adbpg \
--biz-region-id <RegionId> --vpc-id <VpcId> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice- If `TotalCount > 0` and SNAT entries cover the VSwitch CIDR → Skip to Step 1.2
- If no NAT Gateway → Get user confirmation, then:
# 1.1a: Get VSwitch CIDR
aliyun vpc describe-vswitch-attributes --profile adbpg \
--biz-region-id <RegionId> --vswitch-id <VSwitchId> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice
# Record: CidrBlock
# 1.1b: Create Enhanced NAT Gateway (requires user confirmation)
# 💰 Cost note: NAT Gateway incurs hourly charges
aliyun vpc create-nat-gateway --profile adbpg \
--biz-region-id <RegionId> --vpc-id <VpcId> --vswitch-id <VSwitchId> \
--nat-type Enhanced \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice
# Record: NatGatewayId and SnatTableIds.SnatTableId[0]
# Poll until Status=Available
# 1.1c: Find or allocate EIP (requires user confirmation)
# 💰 Cost note: EIP incurs charges; release via VPC console when no longer needed
aliyun vpc describe-eip-addresses --profile adbpg \
--biz-region-id <RegionId> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice
# If no available EIP:
aliyun vpc allocate-eip-address --profile adbpg \
--biz-region-id <RegionId> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice
# Record: AllocationId and EipAddress
# 1.1d: Bindind EIP to NAT Gateway (requires user confirmation)
aliyun vpc associate-eip-address --profile adbpg \
--biz-region-id <RegionId> \
--allocation-id <EIP-AllocationId> --instance-id <NatGatewayId> \
--instance-type Nat \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice
# 1.1e: Create SNAT entry (requires user confirmation)
aliyun vpc create-snat-entry --profile adbpg \
--biz-region-id <RegionId> \
--snat-table-id <SnatTableId> \
--source-cidr "<VSwitch-CidrBlock>" --snat-ip "<EipAddress>" \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice1.2 Create Supabase Project
aliyun gpdb create-supabase-project --profile adbpg \
--biz-region-id <RegionId> --zone-id <ZoneId> \
--project-name <ProjectName> --account-password '<AccountPassword>' \
--security-ip-list "127.0.0.1" --vpc-id <VpcId> --vswitch-id <VSwitchId> \
--project-spec 2C4G --storage-size 20 --pay-type Postpaid \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceRecord: ProjectId (sbp-xxx), PublicConnectUrl, API Keys (store securely; do NOT print full API Keys in logs)
Timeout: Supabase project creation takes 5-10 minutes. Poll status until running:```bash
aliyun gpdb get-supabase-project --profile adbpg \
--biz-region-id <RegionId> --project-id <ProjectId> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice
```
CheckStatusfield. Retry every 30 seconds untilStatus=running.
Step 2: Initialize Coaching Platform Database
Note: Steps 2-3 execute on Supabase Project, Steps 4-8 on ADBPG Instance. They are independent.
Modify whitelist, then connect via psql and execute schema from references/database-schema.md.
# Ask user for whitelist IP (do NOT use curl to external services)
# Example: "Please provide the IP address to add to the whitelist"
# Set whitelist
aliyun gpdb modify-supabase-project-security-ips --profile adbpg \
--biz-region-id <RegionId> --project-id <ProjectId> \
--security-ip-list "<WhitelistIP>" \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceStep 3: Insert Preset Coaching Domains
Execute SQL from references/database-schema.md via psql to insert coaching domains and coaching personas.
Step 4: Discover / Select / Create ADBPG Instance
4.1 Discover Existing Instances
aliyun gpdb describe-db-instances --profile adbpg \
--biz-region-id <RegionId> --page-size 100 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceFilter results: DBInstanceStatus=Running AND VectorConfigurationStatus=enabled.
4.2 User Selects Instance
Present qualifying instances to user:
Available Instances (Running + Vector Enabled):
| # | Instance ID | Spec | Region | Status | Description |
|---|-------------|------|--------|--------|-------------|
| 1 | gp-xxxxx | 4C32G | cn-hangzhou | Running | Production || 2 | gp-yyyyy | 8C64G | cn-hangzhou | Running | Testing |>
Select an instance, or enter "Create New".
- User selects existing → Go to Step 4.3
- User selects "Create New" → Go to Step 4.4
- No qualifying instances → Inform user, go to Step 4.4
4.3 Verify Selected Instance (when using existing)
aliyun gpdb describe-db-instance-attribute --profile adbpg \
--db-instance-id <DBInstanceId> --region <RegionId> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceConfirm: DBInstanceStatus=Running + VectorConfigurationStatus=enabled. Then proceed to Step 5.
4.4 Create New Instance (when no existing or user chooses new)
Must present configuration and get user confirmation before execution:
>
💰 Cost note: Creating an instance incurs charges. Release or pause via ADBPG Console when not in use.
| Config | Default | Notes |
|---|---|---|
| RegionId | cn-hangzhou | User-specified |
| ZoneId | cn-hangzhou-j | Auto-query VPC/VSwitch after selection |
| EngineVersion | 7.0 | |
| DBInstanceMode | StorageElastic | Storage elastic mode |
| DBInstanceCategory | Basic | Default Basic; optional HighAvailability |
| InstanceSpec | 4C16G | Basic: 4C16G/8C32G/16C64G; HA: 4C32G/8C64G/16C128G |
| SegNodeNum | 2 | Basic default 2 (multiples of 2); HA default 4 (multiples of 4) |
| StorageSize | 50 GB | Range: 50–8000 GB |
| SegStorageType | cloud_essd | ESSD cloud disk |
| VPC/VSwitch | Auto-discover | Select VSwitch with most available IPs |
| VectorConfigurationStatus | enabled | Must be enabled for AI coaching |
| PayType | Postpaid | Pay-as-you-go; optional Prepaid |
Query VSwitch list for the zone:
aliyun vpc describe-vswitches --profile adbpg \
--biz-region-id <RegionId> --zone-id <ZoneId> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practicePresent VSwitch options to user, recommend the one with most available IPs.
After user confirms:
aliyun gpdb create-db-instance --profile adbpg \
--biz-region-id <RegionId> --zone-id <ZoneId> \
--engine gpdb --engine-version "7.0" \
--db-instance-mode StorageElastic --db-instance-category Basic \
--instance-spec 4C16G --seg-node-num 2 \
--storage-size 50 --seg-storage-type cloud_essd \
--vpc-id <VpcId> --vswitch-id <VSwitchId> \
--vector-configuration-status enabled --pay-type Postpaid \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceTimeout: Instance creation takes 10–15 minutes (max 30 min). Poll every 30–60 seconds:
```bash
aliyun gpdb describe-db-instance-attribute --profile adbpg \
--db-instance-id <DBInstanceId> --region <RegionId> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice
```
Wait until DBInstanceStatus=Running.Step 5: Configure Database Account
Check if the ADBPG instance already has a database account:
aliyun gpdb describe-accounts --profile adbpg \
--db-instance-id <DBInstanceId> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceCase A: No existing account → Create a new account:
Suggest account creation, confirm with user before executing:
- Account name: auto-generate ai_coaching_XX (XX = random 2-digit number), or user-specified- Password: auto-generate a compliant password (8-32 chars, at least 3 character types, avoid !), or user-specified- Example: Account: ai_coaching_01, Password: Coach3Acc#2x9K — Please confirm or provide your own.>
⚠️ Important:
- Account name cannot be changed after creation — confirm carefully!
- Password can be reset via console, but save it securely now.
- This account will be used as ManagerAccount in Step 6.aliyun gpdb create-account --profile adbpg \
--db-instance-id <DBInstanceId> --region <RegionId> \
--account-name <ManagerAccount> --account-password '<ManagerAccountPassword>' \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceCase B: Account already exists → Inform the user. If the account was not created by the agent, ask the user for the existing account password before proceeding to Step 6.
Record:ManagerAccountandManagerAccountPassword— these will be used in Step 6 for knowledge base initialization.
Step 6: Create Knowledge Base
Parameters to confirm for this step: Auto-generate the following, present to user for confirmation (user may modify), then execute.
>
| Parameter | Default | Notes |
|-----------|---------|-------|
|Namespace|ns_coaching| Namespace name, cannot be changed after creation |
| NamespacePassword | Auto-generate | Namespace password (same password rules); needed for uploads and coaching sessions ||Collection|coaching_knowledge| Knowledge base name |
|EmbeddingModel|text-embedding-v4| Embedding model |
Using the ManagerAccount and ManagerAccountPassword from Step 5, after user confirms the above parameters, execute:
# Initialize vector database
aliyun gpdb init-vector-database --profile adbpg \
--biz-region-id <RegionId> --db-instance-id <DBInstanceId> \
--manager-account <ManagerAccount> --manager-account-password '<ManagerAccountPassword>' \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice
# Create namespace
aliyun gpdb create-namespace --profile adbpg \
--biz-region-id <RegionId> --db-instance-id <DBInstanceId> \
--manager-account <ManagerAccount> --manager-account-password '<ManagerAccountPassword>' \
--namespace <Namespace> --namespace-password '<NamespacePassword>' \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice
# Create document collection
aliyun gpdb create-document-collection --profile adbpg \
--biz-region-id <RegionId> --db-instance-id <DBInstanceId> \
--manager-account <ManagerAccount> --manager-account-password '<ManagerAccountPassword>' \
--namespace <Namespace> --collection <Collection> \
--embedding-model <EmbeddingModel> --dimension 1024 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceStep 7 (Optional): Upload Domain Knowledge Documents
If the user has domain knowledge documents (PDF/TXT/Markdown, etc.), upload them to the knowledge base to enhance coaching quality. This step can be skipped — proceed directly to Step 8 to start coaching.
aliyun gpdb upload-document-async --profile adbpg \
--biz-region-id <RegionId> --db-instance-id <DBInstanceId> \
--namespace <Namespace> --namespace-password '<NamespacePassword>' \
--collection <Collection> --file-name "domain_knowledge.pdf" \
--file-url "https://example.com/knowledge.pdf" \
--document-loader-name ADBPGLoader --chunk-size 500 --chunk-overlap 50 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceRecommended documents by scenario: Sales methodologies, process guides (Workflow); Architecture patterns, design docs (Decision Support); Communication frameworks, best practices (Skill Development); Tech stack docs, onboarding guides (Onboarding).
Step 8: Start Coaching Session
Optional parameters for this step:
>
| Parameter | Default | Notes |
|-----------|---------|-------|
|Model|qwen-max| LLM model; useqwen-turbofor daily practice (lower cost) |
|TopK|5| RAG retrieval count |
Note: SourceCollection element MUST include `Namespace` field.aliyun gpdb chat-with-knowledge-base --profile adbpg \
--biz-region-id <RegionId> --db-instance-id <DBInstanceId> \
--model-params '{"Model": "<Model>", "Messages": [
{"Role": "system", "Content": "<system_prompt from coaching_personas>"},
{"Role": "user", "Content": "<learner message>"}
]}' \
--knowledge-params '{"SourceCollection": [{
"Collection": "<Collection>", "Namespace": "<Namespace>",
"NamespacePassword": "<NamespacePassword>", "QueryParams": {"TopK": <TopK>}
}]}' \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice---
Scenario Quick Reference
| Scenario | Flow |
|---|---|
| Workflow Coaching | Query sales_workflow_coach → Inject coaching persona + process KB → Guide learner through sales stages → Record session |
| Decision Support | Query architecture_advisor → Inject coaching persona + tech KB → Guide trade-off analysis → Document decision |
| Skill Development | Query communication_coach → Inject coaching persona + best practices KB → Practice scenarios → Provide feedback |
| Onboarding | Query onboarding_mentor → Inject coaching persona + tech docs KB → Progressive learning → Verify understanding |
---
Success Verification
See references/verification-method.md for detailed verification steps.
Quick verification: 1. Supabase project exists and is Running 2. ADBPG instance has VectorConfigurationStatus=enabled 3. Database tables exist (coaching_domains, coaching_personas, learners, coaching_sessions) 4. Preset coaching domains are queryable 5. ChatWithKnowledgeBase returns meaningful coaching responses
---
Best Practices
1. Supabase for data, KB for AI — Session records through Supabase, coaching dialogue through RAG 2. Coaching persona is key — Quality of system_prompt determines coaching effectiveness 3. Always store session records — Write every coaching round for review and improvement 4. All operations use `--profile adbpg` — Consistent credential management 5. Team isolation with namespaces — Different teams use different Namespace 6. TopK recommendation: 5 — Reduces token consumption 7. Daily practice: qwen-turbo (low cost), assessments: qwen-max (high quality) 8. Idempotent write operations — Before any resource creation (CreateSupabaseProject, CreateDBInstance, CreateAccount, CreateNamespace, etc.), always query first (Describe/List) to check if the resource already exists. Only create when the resource does not exist. This prevents duplicate resources on retry
---
References
| Document | Description |
|---|---|
| references/cli-installation-guide.md | Aliyun CLI installation |
| references/related-apis.md | All CLI commands and APIs used |
| references/ram-policies.md | Required RAM permissions |
| references/database-schema.md | SQL schema and preset coaching domains |
| references/acceptance-criteria.md | Correct/incorrect patterns |
| references/verification-method.md | Success verification steps |
Acceptance Criteria: AI Coaching Best Practice
Scenario: AI Coaching 最佳实践 - Supabase 陪练平台 + ADBPG 知识库 RAG 驱动陪练系统 Purpose: Skill testing acceptance criteria
---
Correct CLI Command Patterns
1. Product Subcommand - verify gpdb exists
✅ CORRECT
aliyun gpdb CreateDBInstance --region cn-hangzhou ...
aliyun gpdb DescribeDBInstances --region cn-hangzhou ...
aliyun gpdb ChatWithKnowledgeBase --region cn-hangzhou ...❌ INCORRECT
aliyun gpdb Createdbinstance --region cn-hangzhou ... # Wrong case
aliyun gpdb create-db-instance --region cn-hangzhou ... # Wrong format
aliyun adbpg CreateDBInstance --region cn-hangzhou ... # Wrong product name2. Action Subcommand - verify action exists under gpdb
✅ CORRECT
aliyun gpdb CreateSupabaseProject --region cn-hangzhou ...
aliyun gpdb InitVectorDatabase --region cn-hangzhou ...
aliyun gpdb CreateNamespace --region cn-hangzhou ...
aliyun gpdb CreateDocumentCollection --region cn-hangzhou ...
aliyun gpdb UploadDocumentAsync --region cn-hangzhou ...
aliyun gpdb ChatWithKnowledgeBase --region cn-hangzhou ...❌ INCORRECT
aliyun gpdb create-supabase-project --region cn-hangzhou ... # Wrong case (should be PascalCase)
aliyun gpdb CreateSupabase --region cn-hangzhou ... # Wrong action name
aliyun gpdb InitVectorDB --region cn-hangzhou ... # Wrong abbreviation
aliyun gpdb CreateCollection --region cn-hangzhou ... # Missing Document prefix3. Parameters - verify each parameter name exists
✅ CORRECT
aliyun gpdb CreateDBInstance \
--RegionId cn-hangzhou \
--ZoneId cn-hangzhou-j \
--Engine gpdb \
--EngineVersion "7.0" \
--DBInstanceMode StorageElastic \
--InstanceSpec "4C32G" \
--DBInstanceCategory HighAvailability \
--VectorConfigurationStatus enabled \
--SegStorageType cloud_essd \
--SegNodeNum 4 \
--StorageSize 50 \
--VPCId vpc-xxxxx \
--VSwitchId vsw-xxxxx \
--PayType Postpaid❌ INCORRECT
aliyun gpdb CreateDBInstance \
--region cn-hangzhou \ # Wrong case (should be --RegionId)
--zone cn-hangzhou-j \ # Wrong parameter name (should be --ZoneId)
--engine-version "7.0" \ # Wrong parameter name (should be --EngineVersion)
--instance-type "4C32G" \ # Wrong parameter name (should be --InstanceSpec)
--vpc vpc-xxxxx \ # Wrong parameter name (should be --VPCId)
--vswitch vsw-xxxxx \ # Wrong parameter name (should be --VSwitchId)4. Enum Values - verify values fall within allowed range
✅ CORRECT
# DBInstanceMode values
--DBInstanceMode StorageElastic
--DBInstanceMode Serverless
# DBInstanceCategory values
--DBInstanceCategory HighAvailability
--DBInstanceCategory Basic
# PayType values
--PayType Postpaid
--PayType Prepaid
# VectorConfigurationStatus values
--VectorConfigurationStatus enabled
--VectorConfigurationStatus disabled❌ INCORRECT
--DBInstanceMode elastic-storage # Invalid enum value
--DBInstanceCategory ha # Invalid abbreviation
--PayType pay-as-you-go # Wrong format (should be Postpaid)
--VectorConfigurationStatus true # Not a valid enum value5. Parameter Value Formats - verify format matches spec
✅ CORRECT
# RegionId format
--RegionId cn-hangzhou
--RegionId cn-shanghai
--RegionId cn-beijing
# ZoneId format
--ZoneId cn-hangzhou-j
--ZoneId cn-shanghai-f
# InstanceSpec format
--InstanceSpec "4C32G"
--InstanceSpec "8C64G"
--InstanceSpec "16C128G"
# StorageSize (integer, GB)
--StorageSize 50
--StorageSize 100
# SecurityIPList (CIDR or IP, comma-separated)
--SecurityIPList "192.168.1.0/24,10.0.0.1"
# JSON parameters
--ModelParams '{
"Model": "qwen-max",
"Messages": [
{"Role": "system", "Content": "You are a helpful coaching assistant."},
{"Role": "user", "Content": "Hello"}
]
}'
--KnowledgeParams '{
"SourceCollection": [{
"Collection": "coaching_knowledge",
"Namespace": "ns_coaching",
"NamespacePassword": "NsPass123!",
"TopK": 5
}]
}'❌ INCORRECT
--RegionId hangzhou # Missing country prefix
--ZoneId cn-hangzhou # Missing zone suffix (-j, -f, etc.)
--InstanceSpec "4vCPU 32GB" # Wrong format
--StorageSize "50GB" # Should be integer only
--SecurityIPList "192.168.1" # Incomplete IP/CIDR
--ModelParams "Model=qwen-max" # Should be JSON object6. User-Agent Flag - MUST be present
✅ CORRECT
aliyun gpdb DescribeDBInstances --region cn-hangzhou --user-agent AlibabaCloud-Agent-Skills
aliyun gpdb CreateDBInstance --region cn-hangzhou --user-agent AlibabaCloud-Agent-Skills ...
aliyun vpc describe-vpcs --biz-region-id cn-hangzhou --user-agent AlibabaCloud-Agent-Skills
aliyun vpc create-nat-gateway --biz-region-id cn-hangzhou --user-agent AlibabaCloud-Agent-Skills ...❌ INCORRECT
aliyun gpdb DescribeDBInstances --region cn-hangzhou # Missing --user-agent
aliyun gpdb CreateDBInstance --region cn-hangzhou ... # Missing --user-agent
aliyun vpc create-nat-gateway --biz-region-id cn-hangzhou ... # Missing --user-agent7. Database Account Commands - correct parameter usage
✅ CORRECT
# describe-accounts: only --db-instance-id required
aliyun gpdb describe-accounts --db-instance-id gp-xxxxx --user-agent AlibabaCloud-Agent-Skills
# create-account: use --region (not --biz-region-id), --account-type defaults to Super
aliyun gpdb create-account --db-instance-id gp-xxxxx --region cn-hangzhou --account-name ai_coaching_01 --account-password 'Coach3Acc#2x9K' --user-agent AlibabaCloud-Agent-Skills❌ INCORRECT
# Wrong: using --biz-region-id (not supported by describe-accounts)
aliyun gpdb describe-accounts --biz-region-id cn-hangzhou --db-instance-id gp-xxxxx
# Wrong: using --biz-region-id (not supported by create-account, use --region)
aliyun gpdb create-account --biz-region-id cn-hangzhou --db-instance-id gp-xxxxx --account-name admin_user --account-password 'Pass123!'
# Wrong: missing --user-agent
aliyun gpdb create-account --db-instance-id gp-xxxxx --account-name admin_user --account-password 'Pass123!'8. NAT Gateway & EIP Commands - correct VPC plugin mode format
✅ CORRECT
# Check NAT Gateways
aliyun vpc describe-nat-gateways --biz-region-id cn-hangzhou --vpc-id vpc-xxxxx --user-agent AlibabaCloud-Agent-Skills
# Get VSwitch CIDR
aliyun vpc describe-vswitch-attributes --biz-region-id cn-hangzhou --vswitch-id vsw-xxxxx --user-agent AlibabaCloud-Agent-Skills
# Create Enhanced NAT Gateway
aliyun vpc create-nat-gateway --biz-region-id cn-hangzhou --vpc-id vpc-xxxxx --vswitch-id vsw-xxxxx --nat-type Enhanced --user-agent AlibabaCloud-Agent-Skills
# Query EIP addresses
aliyun vpc describe-eip-addresses --biz-region-id cn-hangzhou --user-agent AlibabaCloud-Agent-Skills
# Allocate new EIP
aliyun vpc allocate-eip-address --biz-region-id cn-hangzhou --user-agent AlibabaCloud-Agent-Skills
# Bind EIP to NAT Gateway (--instance-type Nat)
aliyun vpc associate-eip-address --biz-region-id cn-hangzhou --allocation-id eip-xxxxx --instance-id ngw-xxxxx --instance-type Nat --user-agent AlibabaCloud-Agent-Skills
# Create SNAT entry (--source-cidr for CIDR)
aliyun vpc create-snat-entry --biz-region-id cn-hangzhou --snat-table-id stb-xxxxx --source-cidr "172.16.0.0/20" --snat-ip "47.xx.xx.xx" --user-agent AlibabaCloud-Agent-Skills❌ INCORRECT
# Wrong: using --region instead of --biz-region-id
aliyun vpc describe-nat-gateways --region cn-hangzhou --vpc-id vpc-xxxxx
# Wrong: missing --nat-type Enhanced
aliyun vpc create-nat-gateway --biz-region-id cn-hangzhou --vpc-id vpc-xxxxx
# Wrong: missing --instance-type Nat when binding EIP to NAT
aliyun vpc associate-eip-address --biz-region-id cn-hangzhou --allocation-id eip-xxxxx --instance-id ngw-xxxxx
# Wrong: using --source-vswitch-id without --snat-ip (SNAT IP is required for public NAT)
aliyun vpc create-snat-entry --biz-region-id cn-hangzhou --snat-table-id stb-xxxxx --source-vswitch-id vsw-xxxxx---
Correct Common SDK Code Patterns (if applicable)
1. Import Patterns
✅ CORRECT
from alibabacloud_tea_openapi.client import Client as OpenApiClient
from alibabacloud_credentials.client import Client as CredentialClient
from alibabacloud_gpdb20160503.client import Client as GpdbClient
from alibabacloud_tea_openapi import models as open_api_models❌ INCORRECT
from aliyun import gpdb # Wrong SDK structure
import alibabacloud # Too generic
from alibabacloud.gpdb import Client # Wrong import path2. Authentication - must use CredentialClient, never hardcode AK/SK
✅ CORRECT
credential = CredentialClient()
config = open_api_models.Config(credential=credential)
client = GpdbClient(config)❌ INCORRECT
# NEVER hardcode credentials
access_key_id = "LTAI5tXXXXXXXX"
access_key_secret = "8dXXXXXXXXXXXXXXXXXXXXXXXX"
config = open_api_models.Config(
access_key_id=access_key_id,
access_key_secret=access_key_secret
)3. Client Initialization
✅ CORRECT
from alibabacloud_credentials.client import Client as CredentialClient
from alibabacloud_gpdb20160503.client import Client as GpdbClient
from alibabacloud_tea_openapi import models as open_api_models
# Create credential client (uses environment variables or default credentials)
credential = CredentialClient()
# Create config
config = open_api_models.Config(
credential=credential,
region_id="cn-hangzhou",
endpoint="gpdb.cn-hangzhou.aliyuncs.com"
)
# Create client
client = GpdbClient(config)❌ INCORRECT
# Missing credential client
config = open_api_models.Config(
access_key_id="xxx", # Hardcoded
access_key_secret="xxx" # Hardcoded
)
client = GpdbClient(config)4. Async Patterns
✅ CORRECT
import asyncio
from alibabacloud_gpdb20160503 import models
async def upload_document():
request = models.UploadDocumentAsyncRequest(
dbinstance_id="gp-xxxxx",
namespace="ns_coaching",
collection="coaching_knowledge",
file_name="domain_knowledge.pdf",
file_url="https://example.com/knowledge.pdf"
)
response = await client.upload_document_async(request)
return response.body❌ INCORRECT
# Using sync method for async operation
def upload_document():
request = models.UploadDocumentAsyncRequest(...)
response = client.upload_document(request) # Wrong method5. Common Anti-Patterns
❌ INCORRECT - Reading/Printing Credentials
# NEVER do this in skill or scripts
echo $ALIBABA_CLOUD_ACCESS_KEY_ID
echo "Your key is: $ALIBABA_CLOUD_ACCESS_KEY_SECRET"
cat ~/.aliyun/config.json✅ CORRECT
# Only check credential status
aliyun configure list❌ INCORRECT - Skipping Verification
# Don't skip credential verification
aliyun gpdb CreateDBInstance ... # Without checking if credentials exist✅ CORRECT
# Always verify credentials first
aliyun configure list
# Check for valid profile before proceeding
aliyun gpdb DescribeDBInstances --region cn-hangzhou # Test connectivity---
Parameter Confirmation Patterns
✅ CORRECT - Confirm Before Execution
Before proceeding, I need to confirm the following parameters:
| Parameter | Value | Description |
|-----------|-------|-------------|
| RegionId | cn-hangzhou | Region where resources will be created |
| InstanceSpec | 4C32G | ADBPG instance specification |
| StorageSize | 50 GB | Initial storage size |
| VPCId | vpc-xxxxx | VPC for network isolation |
| VSwitchId | vsw-xxxxx | VSwitch for subnet |
Please confirm these values or provide alternatives.❌ INCORRECT - Assuming Values
# Never assume user-specific parameters without confirmation
aliyun gpdb CreateDBInstance \
--RegionId cn-hangzhou \ # Assumed default
--InstanceSpec "4C32G" \ # Assumed default
--VPCId vpc-xxxxx \ # Assumed without asking
...---
Verification Checklist
Before marking skill execution as complete:
- [ ] All
aliyuncommands include--user-agent AlibabaCloud-Agent-Skills - [ ] Credential verification performed before any CLI invocation
- [ ] All user-customizable parameters confirmed with user
- [ ] No hardcoded credentials in any output
- [ ] Instance/Resource status verified after creation
Aliyun CLI Installation & Configuration Guide
Complete guide for installing and configuring Aliyun CLI.
Aliyun CLI 3.3.3+: Supports installing and using all published product plugins. Make sure to upgrade to 3.3.3 or later for full plugin ecosystem coverage.
Installation
macOS
Using Homebrew (Recommended)
brew install aliyun-cli
# Upgrade to latest
brew upgrade aliyun-cli
# Verify version (>= 3.3.3)
aliyun versionUsing Binary
# Download
wget https://aliyuncli.alicdn.com/aliyun-cli-macosx-latest-amd64.tgz
# Extract
tar -xzf aliyun-cli-macosx-latest-amd64.tgz
# Move to PATH
sudo mv aliyun /usr/local/bin/
# Verify
aliyun versionLinux
Debian/Ubuntu
# Download
wget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz
# Extract and install
tar -xzf aliyun-cli-linux-latest-amd64.tgz
sudo mv aliyun /usr/local/bin/
# Verify
aliyun versionCentOS/RHEL
# Download
wget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz
# Extract and install
tar -xzf aliyun-cli-linux-latest-amd64.tgz
sudo mv aliyun /usr/local/bin/
# Verify
aliyun versionARM64 Architecture
# Download ARM64 version
wget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-arm64.tgz
# Extract and install
tar -xzf aliyun-cli-linux-latest-arm64.tgz
sudo mv aliyun /usr/local/bin/Windows
Using Binary 1. Download from: https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip 2. Extract the ZIP file 3. Add the directory to your PATH environment variable 4. Open new Command Prompt or PowerShell 5. Verify: aliyun version
Using PowerShell
# Download
Invoke-WebRequest -Uri "https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip" -OutFile "aliyun-cli.zip"
# Extract
Expand-Archive -Path aliyun-cli.zip -DestinationPath C:\aliyun-cli
# Add to PATH (requires admin privileges)
$env:Path += ";C:\aliyun-cli"
[Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Machine)
# Verify
aliyun versionConfiguration
Quick Start
aliyun configure set \
--mode AK \
--access-key-id <your-access-key-id> \
--access-key-secret <your-access-key-secret> \
--region cn-hangzhouAll aliyun configure commands support non-interactive flags, which is the recommended approach — it works in scripts, CI/CD pipelines, and agent-driven automation without hanging on stdin prompts.
Where to Get Access Keys
1. Log in to Aliyun Console: https://ram.console.aliyun.com/ 2. Navigate to: AccessKey Management 3. Create a new AccessKey pair 4. Save the secret immediately — it's only shown once
Configuration Modes
Aliyun CLI supports 6 authentication modes. All examples below use non-interactive flags.
1. AK Mode (Access Key)
Most common mode for personal accounts and scripts.
aliyun configure set \
--mode AK \
--access-key-id LTAI5tXXXXXXXX \
--access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \
--region cn-hangzhouConfiguration is stored in ~/.aliyun/config.json:
{
"current": "default",
"profiles": [
{
"name": "default",
"mode": "AK",
"access_key_id": "LTAI5tXXXXXXXX",
"access_key_secret": "8dXXXXXXXXXXXXXXXXXXXXXXXX",
"region_id": "cn-hangzhou",
"output_format": "json",
"language": "en"
}
]
}2. StsToken Mode (Temporary Credentials)
For short-lived access (tokens expire in 1-12 hours).
aliyun configure set \
--mode StsToken \
--access-key-id LTAI5tXXXXXXXX \
--access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \
--sts-token v1.0:XXXXXXXXXXXXXXXX \
--region cn-hangzhouUse cases: CI/CD pipelines, temporary access for external contractors, cross-account access.
3. RamRoleArn Mode (Assume RAM Role)
Assume a RAM role for elevated or cross-account access.
aliyun configure set \
--mode RamRoleArn \
--access-key-id LTAI5tXXXXXXXX \
--access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \
--ram-role-arn acs:ram::123456789012:role/AdminRole \
--role-session-name my-session \
--region cn-hangzhouUse cases: cross-account resource access, temporary elevated privileges, role-based access control.
4. EcsRamRole Mode (ECS Instance RAM Role)
Use the RAM role attached to an ECS instance — no credentials needed.
aliyun configure set \
--mode EcsRamRole \
--ram-role-name MyEcsRole \
--region cn-hangzhouRequirements: must be running on an ECS instance with a RAM role attached.
Use cases: scripts and automation running on ECS instances.
5. RsaKeyPair Mode (RSA Key Pair)
Use RSA key pair for authentication (generate key pair in Aliyun Console first).
aliyun configure set \
--mode RsaKeyPair \
--private-key /path/to/private-key.pem \
--key-pair-name my-key-pair \
--region cn-hangzhou6. RamRoleArnWithEcs Mode (ECS + RAM Role)
Combine ECS instance role with RAM role assumption for cross-account access from ECS.
aliyun configure set \
--mode RamRoleArnWithEcs \
--ram-role-name MyEcsRole \
--ram-role-arn acs:ram::123456789012:role/TargetRole \
--role-session-name my-session \
--region cn-hangzhouEnvironment Variables
Highest priority - overrides config file
Access Key Mode
export ALIBABA_CLOUD_ACCESS_KEY_ID=your_access_key_id
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=your_access_key_secret
export ALIBABA_CLOUD_REGION_ID=cn-hangzhouSTS Token Mode
export ALIBABA_CLOUD_ACCESS_KEY_ID=your_access_key_id
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=your_access_key_secret
export ALIBABA_CLOUD_SECURITY_TOKEN=your_sts_token
export ALIBABA_CLOUD_REGION_ID=cn-hangzhouECS RAM Role Mode
export ALIBABA_CLOUD_ECS_METADATA=role_nameUse Case:
- CI/CD pipelines
- Docker containers
- Temporary credential override
Managing Multiple Profiles
Create Named Profiles
aliyun configure set --profile projectA \
--mode AK \
--access-key-id LTAI5tAAAAAAAA \
--access-key-secret 8dAAAAAAAAAAAAAAAAAAAAAAAA \
--region cn-hangzhou
aliyun configure set --profile projectB \
--mode AK \
--access-key-id LTAI5tBBBBBBBB \
--access-key-secret 8dBBBBBBBBBBBBBBBBBBBBBBBB \
--region cn-shanghaiUse Specific Profile
aliyun ecs describe-instances --profile projectA
export ALIBABA_CLOUD_PROFILE=projectA
aliyun ecs describe-instances # Uses projectAList and Switch Profiles
aliyun configure list # List all profiles
aliyun configure set --current projectA # Switch default profileCredential Priority
Credentials are loaded in this order (first found wins):
1. Command-line flag: --profile <name> 2. Environment variable: ALIBABA_CLOUD_PROFILE 3. Environment credentials: ALIBABA_CLOUD_ACCESS_KEY_ID, etc. 4. Configuration file: ~/.aliyun/config.json (current profile) 5. ECS Instance RAM Role: If running on ECS with attached role
Verification
Test Authentication
# Basic test - list regions
aliyun ecs describe-regions
# Expected output: JSON array of regionsIf successful, you'll see:
{
"Regions": {
"Region": [
{
"RegionId": "cn-hangzhou",
"RegionEndpoint": "ecs.cn-hangzhou.aliyuncs.com",
"LocalName": "华东 1(杭州)"
},
...
]
},
"RequestId": "..."
}If failed, you'll see error messages:
InvalidAccessKeyId.NotFound- Wrong Access Key IDSignatureDoesNotMatch- Wrong Access Key SecretInvalidSecurityToken.Expired- STS token expired (for StsToken mode)Forbidden.RAM- Insufficient permissions
Debug Configuration
# Show current configuration
aliyun configure get
# Test with debug logging
aliyun ecs describe-regions --log-level=debug
# Check credential provider
aliyun configure get modeSecurity Best Practices
1. Use RAM Users (Not Root Account)
❌ Don't: Use Aliyun root account credentials ✅ Do: Create RAM users with specific permissions
# Create RAM user in console
# Attach only necessary policies
# Use RAM user's access keys2. Principle of Least Privilege
Grant only the minimum permissions needed:
# Example: Read-only ECS access
# Attach policy: AliyunECSReadOnlyAccess3. Rotate Access Keys Regularly
# Create new access key in RAM Console, then update configuration
aliyun configure set --access-key-id NEW_KEY --access-key-secret NEW_SECRET4. Use STS Tokens for Temporary Access
aliyun configure set --mode StsToken \
--access-key-id XXXX --access-key-secret XXXX \
--sts-token XXXX --region cn-hangzhou5. Use ECS RAM Roles When Possible
aliyun configure set --mode EcsRamRole --ram-role-name MyRole --region cn-hangzhou6. Never Commit Credentials
# Add to .gitignore
echo "~/.aliyun/config.json" >> .gitignore
# Use environment variables in CI/CD instead7. Secure Config File
# Restrict permissions
chmod 600 ~/.aliyun/config.jsonTroubleshooting
Issue: Command Not Found
# Check installation
which aliyun
# Check PATH
echo $PATH
# Reinstall or add to PATHIssue: Authentication Failed
# Verify configuration
aliyun configure get
# Test with debug
aliyun ecs describe-regions --log-level=debug
# Check credentials in console
# Verify access key is activeIssue: Permission Denied
# Error: Forbidden.RAM
# Check RAM user permissions
# Attach necessary policies in RAM console
# Example: AliyunECSFullAccess for ECS operationsIssue: STS Token Expired
# Error: InvalidSecurityToken.Expired
# Reconfigure with new token
aliyun configure set --mode StsToken \
--access-key-id XXXX --access-key-secret XXXX \
--sts-token NEW_TOKEN --region cn-hangzhouIssue: Wrong Region
# Some resources may not exist in the specified region
# Check available regions
aliyun ecs describe-regions
# Update default region
aliyun configure set region cn-shanghaiAdvanced Configuration
Custom Endpoint
# Use custom or private endpoint
export ALIBABA_CLOUD_ECS_ENDPOINT=ecs-vpc.cn-hangzhou.aliyuncs.comProxy Settings
# HTTP proxy
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
# No proxy for specific domains
export NO_PROXY=localhost,127.0.0.1,.aliyuncs.comTimeout Settings
# Connection timeout (default: 10s)
export ALIBABA_CLOUD_CONNECT_TIMEOUT=30
# Read timeout (default: 10s)
export ALIBABA_CLOUD_READ_TIMEOUT=30Next Steps
After installation and configuration:
1. Install plugins for services you need (v3.3.3+ supports all published product plugins):
aliyun plugin install --names ecs vpc rds
# List all available plugins
aliyun plugin list-remote2. Explore commands:
aliyun ecs --help
aliyun fc --help3. Read documentation:
- Command Syntax Guide
- Global Flags Reference
- Common Scenarios
References
- Official Documentation: https://help.aliyun.com/zh/cli/
- RAM Console: https://ram.console.aliyun.com/
- Access Key Management: https://ram.console.aliyun.com/manage/ak
- Plugin Repository: https://github.com/aliyun/aliyun-cli
Aliyun CLI Parameter Guide
Key Parameter Rules
gpdb commands use --biz-region-id (NOT --RegionId)
Important: All aliyun gpdb commands use --biz-region-id parameter to specify the region.
# Correct
aliyun gpdb create-db-instance --biz-region-id cn-hangzhou ...
# Wrong - will fail
aliyun gpdb create-db-instance --RegionId cn-hangzhou ...Parameter Naming Convention: kebab-case
All CLI parameters use lowercase letters + hyphens (kebab-case), NOT PascalCase:
| API Parameter | CLI Parameter |
|---|---|
| RegionId | --biz-region-id |
| DBInstanceId | --db-instance-id |
| ZoneId | --zone-id |
| VpcId | --vpc-id |
| VSwitchId | --vswitch-id |
| ProjectName | --project-name |
| AccountPassword | --account-password |
| ManagerAccount | --manager-account |
| ManagerAccountPassword | --manager-account-password |
| NamespacePassword | --namespace-password |
| EmbeddingModel | --embedding-model |
VPC Command Parameters
VPC commands also use --biz-region-id:
aliyun vpc describe-vpcs --biz-region-id cn-hangzhou
aliyun vpc create-nat-gateway --biz-region-id cn-hangzhou --vpc-id vpc-xxxEIP Command Parameters
EIP commands use --region (NOT --biz-region-id):
aliyun vpc associate-eip-address --region cn-hangzhou --allocation-id eip-xxxVerify Commands
Use --help to check correct parameters:
aliyun gpdb create-db-instance --help
aliyun gpdb create-namespace --help
aliyun vpc create-nat-gateway --helpCommon Errors
Error 1: Using --RegionId
# Wrong
aliyun gpdb create-db-instance --RegionId cn-hangzhou ...
# Error message
Error: '--RegionId' is not a valid parameter or flag.
Did you mean: --biz-region-idError 2: Using PascalCase Parameter Names
# Wrong
aliyun gpdb create-db-instance --biz-region-id cn-hangzhou --DBInstanceId gp-xxx ...
# Error message
Error: '--DBInstanceId' is not a valid parameter or flag.
Did you mean: --db-instance-idError 3: ChatWithKnowledgeBase Missing QueryParams
# Wrong
--knowledge-params '{"SourceCollection": [{"Collection": "...", "TopK": 5}]}'
# Error message
Error: invalid 'SourceCollection': unknown field: TopK
# Correct - TopK must be inside QueryParams
--knowledge-params '{"SourceCollection": [{"Collection": "...", "QueryParams": {"TopK": 5}}]}'For complete command examples, see related-apis.md.
Database Schema
SQL schema and preset data for AI Coaching platform.
Supabase Tables
Core Tables Schema
-- Coaching domains table
CREATE TABLE IF NOT EXISTS coaching_domains (
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
category TEXT NOT NULL, -- 'workflow_coaching' | 'decision_support' | 'skill_development' | 'onboarding'
difficulty TEXT DEFAULT 'medium', -- 'beginner' | 'intermediate' | 'advanced' | 'expert'
description TEXT,
scenario TEXT,
default_opening TEXT,
knowledge_tags TEXT[],
is_active BOOLEAN DEFAULT true,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Coaching personas table (core: system_prompt determines coaching style)
CREATE TABLE IF NOT EXISTS coaching_personas (
domain_id TEXT PRIMARY KEY REFERENCES coaching_domains(id),
system_prompt TEXT NOT NULL,
coaching_style TEXT,
evaluation_criteria JSONB,
interaction_patterns JSONB,
forbidden_topics TEXT[],
success_conditions TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Learners table
CREATE TABLE IF NOT EXISTS learners (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name TEXT NOT NULL,
team TEXT,
position TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Coaching sessions table
CREATE TABLE IF NOT EXISTS coaching_sessions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
learner_id TEXT NOT NULL,
domain_id TEXT NOT NULL,
learner_message TEXT NOT NULL,
coach_response TEXT NOT NULL,
round_number INT DEFAULT 1,
session_id TEXT,
response_time_ms INT,
score INT CHECK (score >= 1 AND score <= 10),
feedback TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_coaching_learner ON coaching_sessions(learner_id, created_at DESC);
CREATE INDEX IF NOT EXISTS idx_coaching_domain ON coaching_sessions(domain_id, created_at DESC);
CREATE INDEX IF NOT EXISTS idx_coaching_session ON coaching_sessions(session_id, round_number);Preset Coaching Domains
Insert Domains
INSERT INTO coaching_domains (id, name, category, difficulty, description, scenario, default_opening, knowledge_tags) VALUES
-- Workflow Coaching: Sales Process Guide
('sales_workflow_coach', 'Sales Process Coach', 'workflow_coaching', 'intermediate',
'Guides sales professionals through structured sales workflows, from lead qualification to deal closure',
'You are coaching a sales professional through a structured sales process. Guide them through each stage with best practices and real-time feedback.',
'Welcome! Let us walk through your current sales opportunity. Tell me about the prospect you are working with.',
ARRAY['sales_process','lead_qualification','negotiation','closing_techniques']),
-- Decision Support: Technical Architecture Advisor
('architecture_advisor', 'Architecture Decision Coach', 'decision_support', 'advanced',
'Helps engineers make informed technical architecture decisions by evaluating trade-offs and best practices',
'You are coaching an engineer through a technical architecture decision. Help them evaluate options, consider trade-offs, and reach a well-reasoned conclusion.',
'Let us work through your architecture challenge. What system are you designing and what are your key requirements?',
ARRAY['system_design','architecture_patterns','scalability','trade_offs']),
-- Skill Development: Customer Communication Trainer
('communication_coach', 'Communication Skills Coach', 'skill_development', 'intermediate',
'Develops customer communication skills through guided practice, scenario analysis, and constructive feedback',
'You are coaching a professional to improve their customer communication skills. Provide scenarios, feedback, and techniques for effective communication.',
'Let us work on your communication skills. Tell me about a recent customer interaction that you found challenging.',
ARRAY['communication','customer_service','conflict_resolution','empathy']),
-- Onboarding: New Hire Technical Mentor
('onboarding_mentor', 'Technical Onboarding Coach', 'onboarding', 'beginner',
'Systematically guides new team members through technical onboarding with knowledge checks and progressive learning',
'You are coaching a new team member through technical onboarding. Guide them through the tech stack, best practices, and team workflows step by step.',
'Welcome to the team! Let us start your technical onboarding. What is your background and what technologies are you most familiar with?',
ARRAY['tech_stack','onboarding','best_practices','team_workflows'])
ON CONFLICT (id) DO NOTHING;Insert Coaching Personas
INSERT INTO coaching_personas (domain_id, system_prompt, coaching_style, evaluation_criteria, success_conditions) VALUES
('sales_workflow_coach',
'You are an experienced Sales Coach with 15 years in B2B enterprise sales. Your coaching approach:
- Guide learners through structured sales stages: Qualification → Discovery → Proposal → Negotiation → Close
- Ask probing questions to help them identify gaps in their approach
- Provide real-time feedback on their strategy and messaging
- Share relevant frameworks (SPIN Selling, Challenger Sale, MEDDIC) when appropriate
- Challenge assumptions and help refine value propositions
- Never give direct answers; instead, guide through questions and frameworks
Coaching style:
1. Start by understanding the current opportunity and stage
2. Ask what they have done so far and what they plan to do next
3. Identify gaps or risks in their approach through questions
4. Suggest frameworks or techniques to address weaknesses
5. Help them practice key conversations (objection handling, closing)',
'Socratic questioning with structured frameworks',
'{"dimensions": ["process_adherence", "customer_understanding", "value_articulation", "objection_handling"]}',
'Learner demonstrates ability to navigate full sales cycle with clear strategy for each stage'),
('architecture_advisor',
'You are a Senior Architecture Coach with expertise in distributed systems. Your coaching approach:
- Help engineers think through architecture decisions systematically
- Guide them to evaluate trade-offs (CAP theorem, consistency vs availability, cost vs performance)
- Ask probing questions about requirements, constraints, and scale
- Introduce relevant patterns (microservices, event-driven, CQRS) when appropriate
- Never prescribe solutions; help them discover the right approach through analysis
- Challenge assumptions about scale, failure modes, and operational complexity
Coaching style:
1. Clarify requirements and constraints first
2. Help enumerate possible approaches
3. Guide evaluation of each option against requirements
4. Explore failure modes and edge cases
5. Help document the decision with rationale',
'Analytical questioning with trade-off analysis',
'{"dimensions": ["requirements_clarity", "option_evaluation", "trade_off_analysis", "decision_rationale"]}',
'Learner makes well-reasoned architecture decision with documented trade-offs'),
('communication_coach',
'You are a Communication Skills Coach specializing in professional customer interactions. Your coaching approach:
- Help professionals develop empathy, active listening, and clear communication
- Provide practice scenarios for challenging customer situations
- Give specific, actionable feedback on communication techniques
- Teach de-escalation, expectation management, and positive framing
- Guide through real scenarios the learner brings from their experience
- Model effective communication patterns through examples
Coaching style:
1. Understand the learner current communication challenges
2. Provide targeted practice scenarios
3. Analyze their approach and provide specific feedback
4. Teach techniques: active listening, empathy statements, positive framing
5. Progress from simple to complex communication scenarios',
'Experiential learning with scenario-based practice',
'{"dimensions": ["empathy", "clarity", "de_escalation", "problem_resolution"]}',
'Learner demonstrates improved communication skills across multiple scenario types'),
('onboarding_mentor',
'You are a Technical Onboarding Coach with 10 years of engineering leadership. Your coaching approach:
- Systematically guide new hires through the team tech stack and workflows
- Use progressive disclosure: start with fundamentals, build to advanced topics
- Check understanding through questions, not lectures
- Encourage hands-on exploration and experimentation
- Connect technical concepts to real team projects and use cases
- Adapt pace based on the learner background and responses
Coaching style:
1. Assess current knowledge level with open-ended questions
2. Build a personalized learning path based on gaps
3. Introduce concepts progressively with practical examples
4. Verify understanding through guided exercises and questions
5. Connect learning to real team projects and workflows',
'Progressive guided learning with knowledge checks',
'{"dimensions": ["technical_foundation", "learning_velocity", "practical_application", "curiosity"]}',
'Learner demonstrates working knowledge of core tech stack and team workflows')
ON CONFLICT (domain_id) DO NOTHING;Alibaba Cloud RAM Permissions
Required RAM policies for the AI Coaching Best Practice skill.
Minimum Permission Requirements
The following RAM permissions are required for all operations in this skill.
Supabase Project Operations
| API Action | RAM Permission | Description |
|---|---|---|
| CreateSupabaseProject | gpdb:CreateSupabaseProject | Create Supabase projects |
| GetSupabaseProject | gpdb:GetSupabaseProject | Query project details |
| GetSupabaseProjectApiKeys | gpdb:GetSupabaseProjectApiKeys | Retrieve API keys |
| ModifySupabaseProjectSecurityIps | gpdb:ModifySupabaseProjectSecurityIps | Update project whitelist |
ADBPG Instance Operations
| API Action | RAM Permission | Description |
|---|---|---|
| CreateDBInstance | gpdb:CreateDBInstance | Create ADBPG instances |
| DescribeDBInstances | gpdb:DescribeDBInstances | List/query instances |
| DescribeDBInstanceAttribute | gpdb:DescribeDBInstanceAttribute | Get instance attributes |
| ModifySecurityIps | gpdb:ModifySecurityIps | Update instance whitelist |
| DescribeParameters | gpdb:DescribeParameters | Query parameters |
| ModifyParameters | gpdb:ModifyParameters | Modify parameters |
Account Operations
| API Action | RAM Permission | Description |
|---|---|---|
| DescribeAccounts | gpdb:DescribeAccounts | List database accounts |
| CreateAccount | gpdb:CreateAccount | Create database accounts |
| DescribeAccountPrivilege | gpdb:DescribeAccountPrivilege | Query account privileges |
Knowledge Base Operations
| API Action | RAM Permission | Description |
|---|---|---|
| InitVectorDatabase | gpdb:InitVectorDatabase | Initialize vector database |
| CreateNamespace | gpdb:CreateNamespace | Create namespace |
| CreateDocumentCollection | gpdb:CreateDocumentCollection | Create knowledge base |
| UploadDocumentAsync | gpdb:UploadDocumentAsync | Upload documents |
| QueryContent | gpdb:QueryContent | Query knowledge base |
| ChatWithKnowledgeBase | gpdb:ChatWithKnowledgeBase | RAG-powered coaching chat |
| DescribeVectorDatabase | gpdb:DescribeVectorDatabase | Query vector DB status |
VPC Network Operations (Prerequisites)
| API Action | RAM Permission | Description |
|---|---|---|
| DescribeVpcs | vpc:DescribeVpcs | Query VPC list |
| DescribeVSwitches | vpc:DescribeVSwitches | Query VSwitch list |
| DescribeVSwitchAttributes | vpc:DescribeVSwitchAttributes | Query VSwitch details (CIDR) |
| DescribeNatGateways | vpc:DescribeNatGateways | Query NAT Gateway list |
| CreateNatGateway | vpc:CreateNatGateway | Create Enhanced NAT Gateway |
| DescribeEipAddresses | vpc:DescribeEipAddresses | Query EIP addresses |
| AllocateEipAddress | vpc:AllocateEipAddress | Allocate a new EIP |
| AssociateEipAddress | vpc:AssociateEipAddress | Bind EIP to NAT Gateway |
| CreateSnatEntry | vpc:CreateSnatEntry | Create SNAT rule |
System Policies
Use these system policies as baseline:
| Policy Name | Type | Permissions |
|---|---|---|
AliyunGPDBFullAccess | System | Full access to AnalyticDB PostgreSQL |
AliyunVPCFullAccess | System | Full access to VPC resources (needed for NAT/EIP creation) |
AliyunVPCReadOnlyAccess | System | Read-only access to VPC resources (if NAT already exists) |
Custom Policy Example
For least-privilege access, create a custom policy:
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": [
"gpdb:CreateSupabaseProject",
"gpdb:GetSupabaseProject",
"gpdb:GetSupabaseProjectApiKeys",
"gpdb:ModifySupabaseProjectSecurityIps",
"gpdb:CreateDBInstance",
"gpdb:DescribeDBInstances",
"gpdb:DescribeDBInstanceAttribute",
"gpdb:ModifySecurityIps",
"gpdb:DescribeAccounts",
"gpdb:CreateAccount",
"gpdb:InitVectorDatabase",
"gpdb:CreateNamespace",
"gpdb:CreateDocumentCollection",
"gpdb:UploadDocumentAsync",
"gpdb:QueryContent",
"gpdb:ChatWithKnowledgeBase"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"vpc:DescribeVpcs",
"vpc:DescribeVSwitches",
"vpc:DescribeVSwitchAttributes",
"vpc:DescribeNatGateways",
"vpc:CreateNatGateway",
"vpc:DescribeEipAddresses",
"vpc:AllocateEipAddress",
"vpc:AssociateEipAddress",
"vpc:CreateSnatEntry"
],
"Resource": "*"
}
]
}Permission by Scenario
Scenario 1: Full Deployment (Create Everything)
Required policies:
AliyunGPDBFullAccessAliyunVPCReadOnlyAccess
Scenario 2: Only Knowledge Base Operations
If instance already exists, only need:
gpdb:InitVectorDatabasegpdb:CreateNamespacegpdb:CreateDocumentCollectiongpdb:UploadDocumentAsyncgpdb:QueryContentgpdb:ChatWithKnowledgeBase
Scenario 3: Only Supabase Project Management
Required policies:
gpdb:CreateSupabaseProjectgpdb:GetSupabaseProjectgpdb:GetSupabaseProjectApiKeysgpdb:ModifySupabaseProjectSecurityIps
Scenario 4: Read-Only Operations
For querying and analysis only:
gpdb:DescribeDBInstancesgpdb:DescribeDBInstanceAttributegpdb:DescribeAccountsgpdb:GetSupabaseProjectgpdb:QueryContent
Permission Failure Handling
[MUST] Permission Failure Handling: When any command or API call fails due to permission errors at any point during execution, follow this process:
1. Read this ram-policies.md file to get the full list of permissions required by this SKILL2. Use ram-permission-diagnose skill to guide the user through requesting the necessary permissions3. Pause and wait until the user confirms that the required permissions have been granted
RAM Role Configuration
For ECS-based deployment, attach the custom policy to a RAM role:
1. Create RAM role in console: https://ram.console.aliyun.com/roles 2. Attach the custom policy above 3. Assign role to ECS instance 4. Configure CLI with --mode EcsRamRole
aliyun configure set \
--mode EcsRamRole \
--ram-role-name ADBPGCoachingRole \
--region cn-hangzhouSecurity Best Practices
1. Use RAM users, not root account - Create dedicated RAM users for automation 2. Apply least privilege - Only grant permissions actually needed 3. Rotate access keys - Update credentials periodically 4. Use STS for temporary access - For short-lived operations 5. Scope resources when possible - Use resource-level permissions
Troubleshooting Permission Errors
Error: Forbidden.RAM
Error code: Forbidden.RAM
Error message: The specified action is not authorized.Solution: 1. Check which API action triggered the error 2. Verify the RAM user has the corresponding permission 3. Attach the missing policy or action
Error: InvalidAccount.NotExist
Error code: InvalidAccount.NotExist
Error message: The specified account does not exist.Solution:
- Create the Super account first using
CreateAccount
Error: OperationDenied.InstanceStatus
Error code: OperationDenied.InstanceStatus
Error message: The instance status does not support this operation.Solution:
- Wait for instance to be in
Runningstate before proceeding
Related APIs and CLI Commands
All CLI commands and APIs used in the AI Coaching Best Practice skill.
Supabase Project Management
| Operation | CLI Command | API Action | Description |
|---|---|---|---|
| Create Supabase Project | aliyun gpdb create-supabase-project | CreateSupabaseProject | Create a new Supabase project |
| Get Project Details | aliyun gpdb get-supabase-project | GetSupabaseProject | Query Supabase project details |
| Get Project API Keys | aliyun gpdb get-supabase-project-api-keys | GetSupabaseProjectApiKeys | Retrieve API keys for Supabase project |
| Modify Security IPs | aliyun gpdb modify-supabase-project-security-ips | ModifySupabaseProjectSecurityIps | Update whitelist/IP access rules |
ADBPG Instance Management
| Operation | CLI Command | API Action | Description |
|---|---|---|---|
| Create Instance | aliyun gpdb create-db-instance | CreateDBInstance | Create ADBPG instance with vector optimization |
| Describe Instances | aliyun gpdb describe-db-instances | DescribeDBInstances | List and query ADBPG instances |
| Modify Security IPs | aliyun gpdb modify-security-ips | ModifySecurityIps | Update instance whitelist |
| Describe Parameters | aliyun gpdb describe-parameters | DescribeParameters | Query instance parameters |
| Modify Parameters | aliyun gpdb modify-parameters | ModifyParameters | Modify instance parameters |
Account Management
| Operation | CLI Command | API Action | Description |
|---|---|---|---|
| Describe Accounts | aliyun gpdb describe-accounts | DescribeAccounts | List database accounts |
| Create Account | aliyun gpdb create-account | CreateAccount | Create database account (Super/Normal) |
Knowledge Base Management
| Operation | CLI Command | API Action | Description |
|---|---|---|---|
| Initialize Vector DB | aliyun gpdb init-vector-database | InitVectorDatabase | Initialize vector database for knowledge base |
| Create Namespace | aliyun gpdb create-namespace | CreateNamespace | Create namespace for isolation |
| Create Collection | aliyun gpdb create-document-collection | CreateDocumentCollection | Create document collection/knowledge base |
| Upload Document | aliyun gpdb upload-document-async | UploadDocumentAsync | Upload and process documents asynchronously |
| Query Content | aliyun gpdb query-content | QueryContent | Query/retrieve content from knowledge base |
| Chat with KB | aliyun gpdb chat-with-knowledge-base | ChatWithKnowledgeBase | RAG-powered coaching chat with knowledge base |
VPC Network (Prerequisites)
| Operation | CLI Command | API Action | Description |
|---|---|---|---|
| Describe VPCs | aliyun vpc describe-vpcs | DescribeVpcs | Query VPC list |
| Describe VSwitches | aliyun vpc describe-vswitches | DescribeVSwitches | Query VSwitch list |
| Describe VSwitch Attributes | aliyun vpc describe-vswitch-attributes | DescribeVSwitchAttributes | Query VSwitch details (CIDR) |
| Describe NAT Gateways | aliyun vpc describe-nat-gateways | DescribeNatGateways | Query NAT Gateway list |
| Create NAT Gateway | aliyun vpc create-nat-gateway | CreateNatGateway | Create Enhanced NAT Gateway |
| Describe EIP Addresses | aliyun vpc describe-eip-addresses | DescribeEipAddresses | Query EIP list |
| Allocate EIP Address | aliyun vpc allocate-eip-address | AllocateEipAddress | Allocate a new EIP |
| Associate EIP | aliyun vpc associate-eip-address | AssociateEipAddress | Bind EIP to NAT Gateway |
| Create SNAT Entry | aliyun vpc create-snat-entry | CreateSnatEntry | Create SNAT rule for public access |
Common Parameters
IMPORTANT: All `aliyun gpdb` commands use `--biz-region-id` (not `--RegionId`):
| Parameter | Required | Description |
|---|---|---|
--biz-region-id | Yes | Region ID (e.g., cn-hangzhou) - use this, NOT `--RegionId` |
--db-instance-id | Most operations | ADBPG instance ID (gp-xxxxx) |
--manager-account | KB operations | Super account name |
--manager-account-password | KB operations | Super account password |
--namespace-password | Namespace operations | Namespace password |
--collection | Collection operations | Collection name |
--profile adbpg | Recommended | Named profile for credentials |
VPC commands also use `--biz-region-id`:
| Parameter | Required | Description |
|---|---|---|
--biz-region-id | Yes | Region ID (e.g., cn-hangzhou) |
--vpc-id | VPC operations | VPC ID (vpc-xxxxx) |
--vswitch-id | VSwitch operations | VSwitch ID (vsw-xxxxx) |
Example Command Patterns
Create Supabase Project
aliyun gpdb create-supabase-project --profile adbpg \
--biz-region-id cn-hangzhou \
--zone-id cn-hangzhou-j \
--project-name ai_coaching \
--account-password '<AccountPassword>' \
--security-ip-list "127.0.0.1" \
--vpc-id vpc-xxxxx \
--vswitch-id vsw-xxxxx \
--project-spec 2C4G \
--storage-size 20 \
--pay-type Postpaid \
--user-agent AlibabaCloud-Agent-SkillsModify Supabase Security IPs
# Ask user for whitelist IP (do NOT use curl to external services)
aliyun gpdb modify-supabase-project-security-ips --profile adbpg \
--biz-region-id cn-hangzhou \
--project-id spb-xxxxx \
--security-ip-list "<WhitelistIP>" \
--user-agent AlibabaCloud-Agent-SkillsDescribe DB Instances
aliyun gpdb describe-db-instances --profile adbpg \
--biz-region-id cn-hangzhou \
--output cols="DBInstanceId,DBInstanceStatus,EngineVersion,VectorConfigurationStatus" rows="Items.DBInstance[]" \
--user-agent AlibabaCloud-Agent-SkillsCreate ADBPG Instance with Vector Optimization
aliyun gpdb create-db-instance --profile adbpg \
--biz-region-id cn-hangzhou \
--zone-id cn-hangzhou-j \
--engine gpdb \
--engine-version "7.0" \
--db-instance-mode StorageElastic \
--db-instance-category Basic \
--instance-spec 4C16G \
--seg-node-num 2 \
--storage-size 50 \
--seg-storage-type cloud_essd \
--vpc-id vpc-xxxxx \
--vswitch-id vsw-xxxxx \
--vector-configuration-status enabled \
--pay-type Postpaid \
--user-agent AlibabaCloud-Agent-SkillsInitialize Vector Database
aliyun gpdb init-vector-database --profile adbpg \
--biz-region-id cn-hangzhou \
--db-instance-id gp-xxxxx \
--manager-account admin_user \
--manager-account-password '<ManagerAccountPassword>' \
--user-agent AlibabaCloud-Agent-SkillsCreate Namespace
aliyun gpdb create-namespace --profile adbpg \
--biz-region-id cn-hangzhou \
--db-instance-id gp-xxxxx \
--manager-account admin_user \
--manager-account-password '<ManagerAccountPassword>' \
--namespace ns_coaching \
--namespace-password '<NamespacePassword>' \
--user-agent AlibabaCloud-Agent-SkillsCreate Document Collection
aliyun gpdb create-document-collection --profile adbpg \
--biz-region-id cn-hangzhou \
--db-instance-id gp-xxxxx \
--manager-account admin_user \
--manager-account-password '<ManagerAccountPassword>' \
--namespace ns_coaching \
--collection coaching_knowledge \
--embedding-model text-embedding-v4 \
--dimension 1024 \
--user-agent AlibabaCloud-Agent-SkillsUpload Document
aliyun gpdb upload-document-async --profile adbpg \
--biz-region-id cn-hangzhou \
--db-instance-id gp-xxxxx \
--namespace ns_coaching \
--namespace-password '<NamespacePassword>' \
--collection coaching_knowledge \
--file-name "domain_knowledge.pdf" \
--file-url "https://example.com/knowledge.pdf" \
--document-loader-name ADBPGLoader \
--chunk-size 500 \
--chunk-overlap 50 \
--user-agent AlibabaCloud-Agent-SkillsChat with Knowledge Base (AI Coaching)
aliyun gpdb chat-with-knowledge-base --profile adbpg \
--biz-region-id cn-hangzhou \
--db-instance-id gp-xxxxx \
--model-params '{
"Model": "qwen-max",
"Messages": [
{"Role": "system", "Content": "<system_prompt from coaching_personas>"},
{"Role": "user", "Content": "<learner message>"}
]
}' \
--knowledge-params '{
"SourceCollection": [{
"Collection": "coaching_knowledge",
"Namespace": "ns_coaching",
"NamespacePassword": "<NamespacePassword>",
"QueryParams": {"TopK": 5}
}]
}' \
--user-agent AlibabaCloud-Agent-SkillsQuery Accounts
aliyun gpdb describe-accounts --profile adbpg \
--db-instance-id gp-xxxxx \
--output cols="AccountName,AccountType,AccountStatus" rows="Accounts.DBInstanceAccount[]" \
--user-agent AlibabaCloud-Agent-SkillsCreate Account
# Note: --account-type defaults to Super; no --biz-region-id, use --region
aliyun gpdb create-account --profile adbpg \
--db-instance-id gp-xxxxx --region cn-hangzhou \
--account-name ai_coaching_01 \
--account-password 'Coach3Acc#2x9K' \
--user-agent AlibabaCloud-Agent-SkillsNAT Gateway for Supabase Public Access
Step 1: Check NAT Gateway
aliyun vpc describe-nat-gateways --profile adbpg \
--biz-region-id cn-hangzhou \
--vpc-id vpc-xxxxx \
--user-agent AlibabaCloud-Agent-SkillsIf TotalCount > 0 and SNAT entries cover the VSwitch CIDR, skip remaining NAT steps.
Step 2: Get VSwitch CIDR
aliyun vpc describe-vswitch-attributes --profile adbpg \
--biz-region-id cn-hangzhou \
--vswitch-id vsw-xxxxx \
--user-agent AlibabaCloud-Agent-SkillsRecord CidrBlock from response.
Step 3: Create Enhanced NAT Gateway (requires user confirmation)
# 💰 Cost note: NAT Gateway incurs hourly charges
aliyun vpc create-nat-gateway --profile adbpg \
--biz-region-id cn-hangzhou \
--vpc-id vpc-xxxxx --vswitch-id vsw-xxxxx \
--nat-type Enhanced \
--user-agent AlibabaCloud-Agent-SkillsRecord NatGatewayId and SnatTableIds.SnatTableId[0]. Poll until Status=Available.
Step 4: Find or Allocate EIP (requires user confirmation)
# Check existing EIPs
aliyun vpc describe-eip-addresses --profile adbpg \
--biz-region-id cn-hangzhou \
--user-agent AlibabaCloud-Agent-Skills
# If no available EIP, allocate a new one:
# 💰 Cost note: EIP incurs charges; release via VPC console when no longer needed
aliyun vpc allocate-eip-address --profile adbpg \
--biz-region-id cn-hangzhou \
--user-agent AlibabaCloud-Agent-SkillsRecord AllocationId and EipAddress.
Step 5: Bind EIP to NAT Gateway (requires user confirmation)
aliyun vpc associate-eip-address --profile adbpg \
--biz-region-id cn-hangzhou \
--allocation-id eip-xxxxx \
--instance-id ngw-xxxxx \
--instance-type Nat \
--user-agent AlibabaCloud-Agent-SkillsStep 6: Create SNAT Entry (requires user confirmation)
aliyun vpc create-snat-entry --profile adbpg \
--biz-region-id cn-hangzhou \
--snat-table-id stb-xxxxx \
--source-cidr "<VSwitch-CidrBlock>" --snat-ip "<EipAddress>" \
--user-agent AlibabaCloud-Agent-SkillsVerification Methods
Success verification steps for AI Coaching Best Practice skill execution.
Overview
This document provides step-by-step verification commands to confirm each stage of the AI Coaching system deployment was successful.
---
Step 0: Verify NAT Gateway and SNAT Configuration
Verification Command
# Check NAT Gateway exists
aliyun vpc describe-nat-gateways --profile adbpg \
--biz-region-id cn-hangzhou --vpc-id vpc-xxxxx \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceExpected Success Indicators
TotalCount>= 1- NAT Gateway
StatusisAvailable NatTypeisEnhancedSnatTableIdscontains at least one entry- Verify SNAT entry covers the VSwitch CIDR with a valid EIP
Failure Indicators
TotalCountis 0 — no NAT Gateway exists- NAT Gateway
StatusisCreatingorDeleting - No SNAT entries configured — Supabase public access will fail
- EIP not bound to NAT Gateway
---
Step 1: Verify Supabase Project Creation
Verification Command
aliyun gpdb get-supabase-project --profile adbpg \
--project-id sbp-xxxxx \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceExpected Success Indicators
ProjectIdmatches the created project (sbp-xxx format)ProjectNameequals the specified nameStatusisRunningorActivePublicConnectUrlis populatedApiKeyssection containsanon_keyandservice_role_key
Failure Indicators
- Error:
InvalidProjectId.NotFound StatusisCreatingorFailed- Missing connection URL or API keys
---
Step 2: Verify ADBPG Instance Creation
Verification Command
aliyun gpdb describe-db-instances --profile adbpg \
--biz-region-id cn-hangzhou \
--output cols="DBInstanceId,DBInstanceDescription,DBInstanceStatus,EngineVersion,VectorConfigurationStatus" rows="Items.DBInstance[]" \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceExpected Success Indicators
- Instance appears in the list with correct
DBInstanceId(gp-xxx format) DBInstanceStatusisRunningEngineVersionis7.0VectorConfigurationStatusisenabledDBInstanceCategoryisHighAvailability
Failure Indicators
- Instance not found in list
DBInstanceStatusisCreating,Modifying, orFailedVectorConfigurationStatusisdisabledornull
---
Step 3: Verify Database Account
Verification Command
aliyun gpdb describe-accounts --profile adbpg \
--db-instance-id gp-xxxxx \
--output cols="AccountName,AccountType,AccountStatus" rows="Accounts.DBInstanceAccount[]" \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceExpected Success Indicators
- Super account exists with specified name
AccountTypeisSuperAccountStatusisActive
Failure Indicators
- No accounts listed
- Only
Normalaccounts exist - Account status is
LockedorCreating
---
Step 4: Verify Vector Database Initialization
Verification Command
aliyun gpdb describe-namespaces --profile adbpg \
--biz-region-id cn-hangzhou \
--db-instance-id gp-xxxxx \
--manager-account admin_user \
--manager-account-password '<ManagerAccountPassword>' \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceExpected Success Indicators
- Vector database is initialized
- No error about uninitialized vector DB
Failure Indicators
- Error:
VectorDatabase.NotInitialized - Error:
ManagerAccount.PasswordMismatch
---
Step 5: Verify Namespace Creation
Verification Command
aliyun gpdb describe-namespaces --profile adbpg \
--biz-region-id cn-hangzhou \
--db-instance-id gp-xxxxx \
--manager-account admin_user \
--manager-account-password '<ManagerAccountPassword>' \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceExpected Success Indicators
- Command succeeds without error
- Can create collection in the namespace
Failure Indicators
- Error:
Namespace.NotExist - Error:
Namespace.AlreadyExists - Error:
ManagerAccount.PasswordMismatch
---
Step 6: Verify Document Collection Creation
Verification Command
# Query collections (if available via API)
# Or verify by listing documents in collectionExpected Success Indicators
- Collection exists with specified name
- Embedding model matches specification
- Dimension matches specification
Failure Indicators
- Error:
Collection.NotExist - Embedding model mismatch
---
Step 7: Verify Document Upload
Verification Command
aliyun gpdb upload-document-async --profile adbpg \
--biz-region-id cn-hangzhou \
--db-instance-id gp-xxxxx \
--namespace ns_coaching \
--namespace-password '<NamespacePassword>' \
--collection coaching_knowledge \
--file-name "test_verify.pdf" \
--file-url "https://example.com/test.pdf" \
--document-loader-name ADBPGLoader \
--chunk-size 500 \
--chunk-overlap 50 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceExpected Success Indicators
- Returns
TaskIdfor async operation - Document status becomes
Processedafter completion
Check Upload Status
# Query document upload task status (if API available)Failure Indicators
- Error:
Collection.NotExist - Error:
InvalidFileUrl - Error:
UnsupportedFileType - Task status remains
Processingindefinitely
---
Step 8: Verify Knowledge Base Chat (AI Coaching)
Verification Command
aliyun gpdb chat-with-knowledge-base --profile adbpg \
--biz-region-id cn-hangzhou \
--db-instance-id gp-xxxxx \
--model-params '{
"Model": "qwen-max",
"Messages": [
{"Role": "user", "Content": "Hello, I need coaching on my sales process."}
]
}' \
--knowledge-params '{
"SourceCollection": [{
"Collection": "coaching_knowledge",
"Namespace": "ns_coaching",
"NamespacePassword": "<NamespacePassword>",
"QueryParams": {"TopK": 5}
}]
}' \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practiceExpected Success Indicators
- Response contains meaningful coaching guidance
- Response includes retrieved knowledge context
- No authentication or permission errors
Failure Indicators
- Error:
AccountOrPassword.VerificationError - Error:
Collection.NotExist - Error:
Namespace.NotExist - Empty or nonsensical response
- Model inference timeout
---
Step 9: Verify Supabase Database Schema
Verification Command
Connect to Supabase database using psql:
psql "postgres://<user>:<password>@<host>:<port>/postgres" -c "
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_type = 'BASE TABLE';
"Expected Success Indicators
Tables exist:
coaching_domainscoaching_personaslearnerscoaching_sessions
Verify Preset Coaching Domains
SELECT id, name, category, difficulty, is_active
FROM coaching_domains
ORDER BY category, difficulty;Expected domains:
sales_workflow_coach(workflow_coaching, intermediate)architecture_advisor(decision_support, advanced)communication_coach(skill_development, intermediate)onboarding_mentor(onboarding, beginner)
Verify Coaching Personas
SELECT domain_id, LEFT(system_prompt, 50) as prompt_preview
FROM coaching_personas;Failure Indicators
- Tables don't exist
- Missing expected coaching domains
- Empty coaching_personas table
---
Step 10: End-to-End Coaching Test
Full Flow Test
1. Query a coaching domain from Supabase:
SELECT d.id, d.name, p.system_prompt
FROM coaching_domains d
LEFT JOIN coaching_personas p ON d.id = p.domain_id
WHERE d.id = 'sales_workflow_coach';2. Call ChatWithKnowledgeBase with coaching prompt:
aliyun gpdb chat-with-knowledge-base --profile adbpg \
--biz-region-id cn-hangzhou \
--db-instance-id gp-xxxxx \
--model-params '{
"Model": "qwen-max",
"Messages": [
{"Role": "system", "Content": "<system_prompt from query>"},
{"Role": "user", "Content": "I have a prospect who keeps delaying the decision. How should I handle this?"}
]
}' \
--knowledge-params '{
"SourceCollection": [{
"Collection": "coaching_knowledge",
"Namespace": "ns_coaching",
"NamespacePassword": "<NamespacePassword>",
"QueryParams": {"TopK": 5}
}]
}' \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice3. Verify response quality:
- Response matches the coaching persona style
- Response incorporates knowledge from uploaded documents
- Response provides actionable coaching guidance
- Response uses Socratic questioning or appropriate coaching technique
Failure Indicators
- Coaching domain not found in database
- Chat API returns errors
- Response doesn't match expected coaching style
- No knowledge retrieval in response
---
Quick Health Check Script
Run this script to verify all components:
#!/bin/bash
# Configuration
PROFILE="adbpg"
REGION="cn-hangzhou"
DB_INSTANCE="gp-xxxxx"
MANAGER_ACCOUNT="admin_user"
MANAGER_PASSWORD="<ManagerAccountPassword>" # Replace with actual password
NAMESPACE="ns_coaching"
NAMESPACE_PASSWORD="<NamespacePassword>" # Replace with actual password
COLLECTION="coaching_knowledge"
echo "=== AI Coaching System Health Check ==="
echo ""
# 1. Check CLI version
echo "1. Checking Aliyun CLI version..."
aliyun version
# 2. Check credentials
echo ""
echo "2. Checking credentials..."
aliyun configure list
# 3. Check ADBPG instance
echo ""
echo "3. Checking ADBPG instance status..."
aliyun gpdb describe-db-instances --profile $PROFILE \
--biz-region-id $REGION \
--output cols="DBInstanceId,DBInstanceStatus,VectorConfigurationStatus" rows="Items.DBInstance[]" \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice
# 4. Check accounts
echo ""
echo "4. Checking database accounts..."
aliyun gpdb describe-accounts --profile $PROFILE \
--db-instance-id $DB_INSTANCE \
--output cols="AccountName,AccountType,AccountStatus" rows="Accounts.DBInstanceAccount[]" \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice
# 5. Test ChatWithKnowledgeBase
echo ""
echo "5. Testing ChatWithKnowledgeBase..."
aliyun gpdb chat-with-knowledge-base --profile $PROFILE \
--biz-region-id $REGION \
--db-instance-id $DB_INSTANCE \
--model-params '{"Model": "qwen-max", "Messages": [{"Role": "user", "Content": "Hello"}]}' \
--knowledge-params "{\"SourceCollection\": [{\"Collection\": \"$COLLECTION\", \"Namespace\": \"$NAMESPACE\", \"NamespacePassword\": \"$NAMESPACE_PASSWORD\", \"QueryParams\": {\"TopK\": 5}}]}" \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-postgresql-ai-coaching-best-practice
echo ""
echo "=== Health Check Complete ==="---
Troubleshooting Common Issues
Issue: InvalidAccessKeyId.NotFound
Solution: Re-verify credentials with aliyun configure list
Issue: Forbidden.RAM
Solution: Check RAM policies - ensure user has required GPDB permissions
Issue: AccountOrPassword.VerificationError
Solution: Verify manager account password is correct
Issue: Namespace.NotExist
Solution: Create namespace first with CreateNamespace
Issue: VectorDatabase.NotInitialized
Solution: Run InitVectorDatabase first
Issue: Response quality is poor
Solution: 1. Verify documents were uploaded successfully 2. Increase TopK value (try 10) 3. Check document content quality 4. Verify embedding model compatibility