Alibabacloud Analyticdb Postgresql Ai Coaching Best Practice
Implement AI Coaching best practices on AnalyticDB for PostgreSQL (ADBPG): Leverage Supabase projects (training data management) + ADBPG instances with vector optimization to build RAG-driven coaching systems that guide users through domain-specific workflows, decision-making, or skill development.
Use when: User wants to create Supabase projects (spb-xxx), ADBPG instances (gp-xxx), vector knowledge bases, or RAG-driven coaching systems on ADBPG.
Triggers: "Supabase", "ADBPG", "vector database", "knowledge base", "RAG", "AI coaching", "coaching system", "spb-xxx", "gp-xxx"
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:
[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.
bash
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***)
bash
aliyun configure list
If 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
Use ram-permission-diagnose skill to guide the user
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.
# 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-practice
Case 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:ManagerAccount and ManagerAccountPassword — 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:
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.
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