# rds-ai

Part of **RDS**

# ApsaraDB RDS AI Assistant and Conversational AI Console Guide

## Operations Overview

| Operation | Console Entry Point | Prerequisites | Description |
|----------|---------------------|---------------|-------------|
| Embed RDS Copilot in a Custom Web Application | Console > RAM > Users/Roles | Alibaba Cloud account with RAM permissions, Python 3.x | Configure RAM user and role to generate logon-free URLs for embedding RDS Copilot in iframes or new tabs |
| Integrate RDS AI Assistant with DingTalk Chatbot | https://open.dingtalk.com/ > App Development | RDS AI Assistant Professional Edition subscription, DingTalk Open Platform access | Create and configure a DingTalk chatbot to manage RDS instances via chat |
| Integrate RDS Copilot with Lark Robot | https://open.feishu.cn/ > Developer Console | RDS Copilot Professional Edition subscription, Alibaba Cloud AccessKey | Set up a Lark bot to interact with RDS Copilot through persistent connections |
| Create RDS Custom Instance with OpenClaw | Console > RDS Custom > Create Instance | Valid Alibaba Cloud account, VPC/security group, Open Platform access | Deploy an RDS Custom instance with OpenClaw and integrate with multiple messaging platforms |
| Manage RDS Copilot Professional Edition | Console > RDS > RDS Copilot > RDS Copilot Professional Edition | Access to RDS console, base package subscription | Activate, upgrade, downgrade, renew, or unsubscribe from RDS Copilot Professional Edition |
| Configure AI Long-term Memory | Console > RDS > Long-term Memory | Active Alibaba Cloud account, RDS for PostgreSQL instance | Create and manage personalized AI memory projects with vector and graph storage |

## Step-by-Step Instructions

### Embed RDS Copilot in a Custom Web Application

**Navigation**: Console > RAM > Users/Roles

**Prerequisites**:
- An Alibaba Cloud account with permission to create RAM users and roles
- Python 3.x installed locally

1. Log on to the RAM console
   - Element: **RAM console** (link) — top navigation bar

2. Create a RAM user
   - Element: **Create a RAM user** (button) — RAM console home page
   - Notes: Follow the guided steps in the linked documentation

3. Grant the AliyunSTSAssumeRoleAccess policy to the RAM user
   - Element: **Manage permissions for a RAM user** (link) — user detail page

4. Create an AccessKey for the RAM user
   - Element: **Create an AccessKey** (link) — user detail page
   - Notes: Save the AccessKey ID and Secret immediately

5. Create a RAM role for a trusted Alibaba Cloud service
   - Element: **Create a RAM role for a trusted Alibaba Cloud service** (link) — RAM console home page

6. Attach required policies to the RAM role
   - Element: **Manage permissions for a RAM role** (link) — role detail page
   - Notes: Attach at least AliyunRDSReadOnlyAccess and AliyunRDSCopilotReadOnlyAccess

7. Copy the RAM role ARN
   - Element: **Basic Information** (section) — role detail page
   - Notes: Example format: acs:ram::13427***:role/rdscopilot-console

### Integrate RDS AI Assistant with DingTalk Chatbot

**Navigation**: https://open.dingtalk.com/ > App Development > DingTalk App > Create App

**Prerequisites**:
- Purchase of Alibaba Cloud RDS AI Assistant Professional Edition
- Access to DingTalk Open Platform
- Access to Alibaba Cloud console for AccessKey creation
- RAM user recommended for security best practices

1. Log in to the DingTalk Open Platform and click developer console in the upper-right corner
   - Element: **developer console** (link) — upper-right corner

2. Navigate to App Development > DingTalk App and click Create App
   - Element: **Create App** (button) — App Development > DingTalk App page

3. Enter an App Name and App Description, upload an App Icon (optional), and click OK to create the app
   - Element: **OK** (button) — Create App form

4. Click Add Bot on the chatbot configuration page
   - Element: **Add Bot** (button) — chatbot configuration page

5. Provide Bot Name, Bot Icon, Description, and Feature Description; select Stream mode for Message Receiving Mode; then click Publish
   - Element: **Publish** (button) — chatbot configuration page

6. Click Permission Management in the left-side navigation pane
   - Element: **Permission Management** (menu) — left-side navigation panel

7. Enable the following three permissions: Permission to send messages from in-house bots, Interactive Card Write Permission, and AI Card Stream Update Permission
   - Element: **Enable Now** (button) — permissions list
   - Notes: Each permission must be enabled individually

8. Click Version Management & Release in the left-side navigation pane
   - Element: **Version Management & Release** (menu) — left-side navigation panel

9. Click Create New Version in the upper-right corner
   - Element: **Create New Version** (button) — upper-right corner

10. Enter a Version Description, select the Visible Scope, and click Publish
    - Element: **Publish** (button) — Create New Version form

11. Open the DingTalk app and select the group where you want to add the chatbot
    - Element: **Group Settings** (menu) — group interface

12. Click Bots and then click Add Bot
    - Element: **Add Bot** (button) — Bots section in Group Settings

13. Search for and add the chatbot you created in Step 1 from the list
    - Element: **Search** (text_input) — top of the bot selection list

14. In the search box at the top of the DingTalk app, enter the name of your chatbot and click its name to open the chat screen
    - Element: **search box** (text_input) — top of the app

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| App Name | text | Yes | — | The name of the DingTalk app being created |
| App Description | text | No | — | A brief description of the app's purpose |
| App Icon | file | No | — | Optional icon file to represent the app |
| Bot Name | text | Yes | — | The name of the chatbot |
| Bot Icon | file | No | — | Optional icon for the chatbot |
| Description | text | No | — | Description of the chatbot's function |
| Feature Description | text | No | — | Details about the chatbot’s capabilities |
| Message Receiving Mode | dropdown | Yes | Stream mode | Specifies how the chatbot receives messages |
| Version Description | text | Yes | — | Description of the app version being published |
| Visible Scope | dropdown | Yes | — | Who can see this app version |

### Integrate RDS Copilot with Lark Robot

**Navigation**: https://open.feishu.cn/ > Developer Console > Permissions Management > Import or Export Permissions in Bulk

**Prerequisites**:
- An active RDS Copilot Professional Edition subscription
- An Alibaba Cloud AccessKey ID and AccessKey secret from a RAM user
- A server that can run Python 3

1. Log on to the Lark Open Platform and click Developer Console in the upper-right corner
   - Element: **Developer Console** (link) — upper-right corner

2. Click Create Enterprise Self-built App
   - Element: **Create Enterprise Self-built App** (button) — main content area

3. Enter an App Name, App Description, and App Icon, then click Create
   - Element: **Create** (button) — form submission area

4. In the navigation pane, click Permission Management
   - Element: **Permission Management** (menu) — left navigation panel

5. Click Import or Export Permissions in Bulk
   - Element: **Import or Export Permissions in Bulk** (button) — main content area

6. On the Import tab, paste the provided JSON and click Next, Confirm New Permissions
   - Element: **Next, Confirm New Permissions** (button) — confirmation step

7. Click Apply for Activation
   - Element: **Apply for Activation** (button) — confirmation step

8. In the navigation pane, click Events and Callbacks
   - Element: **Events and Callbacks** (menu) — left navigation panel

9. Click the Encryption Policy tab and click Refresh to generate a new Encrypt Key
   - Element: **Refresh** (button) — Encrypt Key section

10. In the navigation pane, click Credentials and Basic Information
    - Element: **Credentials and Basic Information** (menu) — left navigation panel

11. Under App Credentials, copy the App ID and App Secret
    - Element: **App ID** (text_input) — credentials section

12. In the navigation pane, click Events and Callbacks
    - Element: **Events and Callbacks** (menu) — left navigation panel

13. Under Encryption Policy, copy the Encrypt Key and Verification Token
    - Element: **Encrypt Key** (text_input) — encryption policy section

14. Log on to the Alibaba Cloud console and use an existing AccessKey or create one
    - Element: **Create an AccessKey** (link) — console home
    - Notes: Use a RAM user AccessKey for security

15. Export all credentials as environment variables using the provided code snippet
    - Element: **export LARK_APP_ID="your_lark_app_id"** (text_input) — terminal/command line
    - Notes: Replace placeholder values with actual credentials

16. Start the service by running python main.py
    - Element: **python main.py** (text_input) — terminal/command line

17. In the navigation pane, click Events and Callbacks
    - Element: **Events and Callbacks** (menu) — left navigation panel

18. On the Events Configuration tab, select Persistent Connection as the subscription method
    - Element: **Persistent Connection** (radio) — subscription method options

19. Subscribe to the required events as shown in the figure
    - Element: **subscribe to events** (checkbox) — event list
    - Notes: Refer to screenshot for correct event selection

20. Click Callback Configuration
    - Element: **Callback Configuration** (button) — main content area

21. Select Persistent Connection as the subscription method
    - Element: **Persistent Connection** (radio) — subscription method options

22. Subscribe to the required callbacks as shown in the figure
    - Element: **subscribe to callbacks** (checkbox) — callback list
    - Notes: Refer to screenshot for correct callback selection

23. In the navigation pane, click Version Management and Publishing
    - Element: **Version Management and Publishing** (menu) — left navigation panel

24. Click Create Version in the upper-right corner and publish it
    - Element: **Create Version** (button) — upper-right corner
    - Notes: After publishing, version status changes to Published

25. Open the Lark app and go to the group where you want to add the bot
    - Element: **Settings** (menu) — group settings

26. Click Add Robot
    - Element: **Add Robot** (button) — settings menu

27. Search for the bot name and add it
    - Element: **search field** (text_input) — bot search area

28. Type @ followed by the bot name to start a Q&A session
    - Element: **@** (text_input) — chat input area

29. Search for the bot name in the Lark app
    - Element: **search field** (text_input) — main search bar

30. Enter your question in the chat dialog and click Send
    - Element: **Send** (button) — chat input area

### Create RDS Custom Instance with OpenClaw

**Navigation**: Console > RDS Custom > Create Instance

**Prerequisites**:
- A valid Alibaba Cloud account with developer permissions
- Authorization for the service-linked role
- An existing VPC or security group configuration
- Access to the DingTalk, Lark, WeCom, or QQ Open Platform

1. Go to the instance purchase page
   - Element: **Go to Purchase Page** (link) — top of the page

2. Set billing method to subscription or pay-as-you-go
   - Element: **Billing Method** (dropdown) — form section

3. Select RDS Custom as the database type
   - Element: **Database Type** (dropdown) — form section

4. Select MySQL as the engine
   - Element: **Engine** (dropdown) — form section

5. Grant authorization for the service-linked role
   - Element: **Go to Authorization** (button) — form section
   - Notes: If not already authorized

6. Select VM series as the product series
   - Element: **Product Series** (dropdown) — form section

7. Select Standard Edition as the product type
   - Element: **Product Type** (dropdown) — form section

8. Select Default Image > OpenClaw as the image
   - Element: **Image** (dropdown) — form section
   - Notes: Screenshot shows selection interface

9. Configure security group
   - Element: **Custom Security Group** (radio) — form section

10. Click Confirm Order and complete payment
    - Element: **Confirm Order** (button) — bottom of form

11. Return to console and navigate to RDS Custom > Custom Instance List
    - Element: **RDS Custom** (menu) — left navigation panel

12. Click Execute Command under Configure OpenClaw
    - Element: **Execute Command** (button) — Configure OpenClaw section

13. Copy the API key from Model Studio
    - Element: **Credentials and Basic Information** (menu) — left navigation pane

14. Click Execute Command under Access Web UI Panel
    - Element: **Execute Command** (button) — Access Web UI Panel section

15. Access the OpenClaw Web UI and initiate device pairing
    - Element: **Device Pairing** (button) — console
    - Notes: Page automatically initiates pairing request

16. Bind an Elastic IP Address for public access (optional)
    - Element: **Elastic IP Address** (button) — network settings
    - Notes: Required for internet access

17. Select a model from the supported list and apply it
    - Element: **Apply** (button) — Model Configuration section

18. Create a DingTalk application
    - Element: **Create** (button) — DingTalk Open Platform

19. Add Bot feature to the DingTalk app
    - Element: **Add** (button) — Add App Features

20. Publish the application version
    - Element: **Create New Version** (button) — Version Management and Publishing

21. Copy Client ID and Client Secret from DingTalk credentials
    - Element: **Credentials and Basic Information** (menu) — left navigation pane

22. Enter credentials in the RDS Custom console under Channel Configuration > DingTalk
    - Element: **Apply** (button) — Channel Configuration

23. Add the bot to a DingTalk group
    - Element: **Add Bot** (button) — Group Settings

24. Create a Lark application
    - Element: **Create Custom App** (button) — Lark Open Platform

25. Copy App ID and App Secret from Lark credentials
    - Element: **Credentials and Basic Information** (menu) — left navigation pane

26. Configure event subscription using WebSocket
    - Element: **Use WebSocket to receive events** (radio) — Events & Callbacks

27. Subscribe to im.message.receive_v1 event
    - Element: **Add Events** (button) — Event Subscription

28. Publish the Lark app version
    - Element: **Submit for Review** (button) — Version Management

29. Enter App ID and App Secret in RDS Custom console under Channel Configuration > Lark
    - Element: **Apply** (button) — Channel Configuration

30. Create a persistent smart bot in WeCom
    - Element: **Create Bot** (button) — Smart Bot

31. Select API Mode and create with persistent connection
    - Element: **API Mode** (radio) — Create Bot

32. Enter Bot ID and Secret in RDS Custom console under Channel Configuration > WeCom
    - Element: **Apply** (button) — Channel Configuration

33. Add the WeCom bot to a group chat
    - Element: **Search and Add** (text_input) — group chat

34. Go to QQ Open Platform and create a new bot
    - Element: **Create Bot** (button) — QQ Open Platform

35. Save App ID and App Secret securely
    - Element: **App ID** (text_input) — bot creation form
    - Notes: Secret is not stored in plaintext

36. Enter App ID and App Secret in RDS Custom console under Channel Configuration > QQ
    - Element: **Apply** (button) — Channel Configuration

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Billing Method | dropdown | Yes | Subscription, Pay-as-you-go | Choose how you want to pay for the RDS Custom instance |
| Database Type | dropdown | Yes | RDS Custom | Select the database type for the instance |
| Region | dropdown | Yes | — | Select the region where the instance will be deployed |
| Engine | dropdown | Yes | MySQL | Select the database engine |
| Product Series | dropdown | Yes | VM series | Choose the compute series for the instance |
| Product Type | dropdown | Yes | Standard Edition | Only Standard Edition is supported |
| Image | dropdown | Yes | Default Image > OpenClaw | Select the pre-configured image with OpenClaw |
| Security Group | dropdown | No | Custom Security Group, Create Security Group | Choose or create a security group for network access |
| Security Group Name | text | No | — | Name for the new security group |
| Security Group Type | dropdown | No | Classic, VPC | Type of security group |
| Enable IPv4 Port/Protocol | checkbox | No | — | Enable specific ports and protocols |
| App Name | text | Yes | — | Name for the new application |
| App Description | text | Yes | — | Description of the application |
| App Icon | file | Yes | — | Upload an icon for the application |
| Client ID | text | Yes | — | DingTalk application client ID |
| Client Secret | text | Yes | — | DingTalk application client secret |
| App ID | text | Yes | — | Lark application ID |
| App Secret | text | Yes | — | Lark application secret |
| Bot ID | text | Yes | — | WeCom bot ID |
| Secret | text | Yes | — | WeCom bot secret |
| App ID | text | Yes | — | QQ bot App ID |
| App Secret | text | Yes | — | QQ bot App Secret |
| App Version | text | Yes | — | Version number for the published app |
| Version Description | text | Yes | — | Description of changes in this version |
| App Visibility | dropdown | Yes | Internal, External | Who can see the app |

### Manage RDS Copilot Professional Edition

**Navigation**: Console > RDS > RDS Copilot > RDS Copilot Professional Edition

**Prerequisites**:
- Access to the RDS console
- Valid subscription for base package

1. Navigate to the RDS console and select RDS Copilot Professional Edition from the left navigation pane
   - Element: **RDS Copilot** (menu) — left navigation panel

2. Click the 'Enable Now' button to start creating a new instance
   - Element: **Enable Now** (button) — top-right corner
   - Notes: Screenshots show the interface for both China and international regions

3. Configure core parameters on the purchase page, including the number of AI capacity packages and subscription duration
   - Element: **AI Capacity Package** (dropdown) — main content area
   - Notes: Each package increases task concurrency by 10 and adds 1 billion tokens to daily limit

4. Click 'Next' to proceed with the purchase
   - Element: **Next** (button) — bottom of form

5. On the upgrade page, increase the number of AI capacity packages
   - Element: **Upgrade** (button) — top-right corner
   - Notes: Screenshot shows the upgrade dialog with configuration options

6. On the downgrade page, decrease the number of AI capacity packages
   - Element: **Downgrade** (button) — top-right corner
   - Notes: Screenshot shows the downgrade dialog with configuration options

7. On the renewal page, select a subscription duration and enable auto-renewal if desired
   - Element: **Renew** (button) — top-right corner
   - Notes: Auto-renewal helps avoid service disruptions

8. On the unsubscription list page, select the resource and click 'Unsubscribe'
   - Element: **Unsubscribe** (button) — top-right corner

9. Confirm unsubscription by selecting a reason and clicking 'OK'
   - Element: **OK** (button) — lower-right corner
   - Notes: Screenshot shows the confirmation dialog with reason selection

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| AI Capacity Package | dropdown | Yes | 0, 1, 2, 3, 4, 5 | Number of additional AI capacity packages to purchase. Each increases task concurrency by 10 and adds 1 billion tokens to daily limit |
| Subscription Duration | dropdown | Yes | 1 month, 3 months, 6 months, 1 year | Duration of the subscription for the RDS Copilot Professional Edition |
| Auto Renewal | checkbox | No | — | Enables automatic renewal one month before expiration to prevent service disruption |
| Reason for Unsubscription | dropdown | Yes | No longer needed, Cost optimization, Migration to another solution, Other | Select the reason for unsubscribing from the service |

### Configure AI Long-term Memory

**Navigation**: RDS Console > Long-term Memory > Create Project

**Prerequisites**:
- An active Alibaba Cloud account
- A valid RDS for PostgreSQL instance
- Network access to the public endpoint

1. Log on to the RDS console
   - Element: **RDS console** (link) — top navigation bar

2. Click on Long-term Memory in the left-side navigation pane
   - Element: **Long-term Memory** (menu) — left-side navigation panel

3. Click Create Project on the instance list page
   - Element: **Create Project** (button) — main content area

4. Select the project type and complete the configuration
   - Element: **project type** (dropdown) — configuration form
   - Notes: Follow on-screen instructions

5. Wait for the instance status to become Running
   - Element: **Running** (label) — instance status indicator

6. Navigate to the instance details page
   - Element: **projectID** (link) — instance list page
   - Notes: Click on the projectID to open details

7. Find the PublicString field on the Basic Info tab
   - Element: **PublicString** (text_input) — Basic Info tab

8. Click Get API Key in the upper-right corner
   - Element: **Get API Key** (button) — upper-right corner

9. Turn on the switch for Network > Bind Elastic Network
   - Element: **Bind Elastic Network** (toggle) — Basic Info tab

10. Add your client IP address to the whitelist
    - Element: **Add** (button) — Whitelist section
    - Notes: Click Add and enter your IP address

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| project type | dropdown | Yes | Standard, Advanced | Choose the type of long-term memory project to create |

## FAQ

Q: Where do I find the RAM role ARN needed for embedding RDS Copilot?
A: After creating a RAM role in the RAM console, navigate to the role's detail page and look for the "Basic Information" section where the ARN is displayed in the format acs:ram::account-id:role/role-name.

Q: Can I modify the DingTalk chatbot configuration after publishing?
A: Yes, you can return to the DingTalk Open Platform, navigate to your app's configuration page, and make changes to the bot settings, permissions, or version details as needed.

Q: What happens if I leave the AI Capacity Package field empty when managing RDS Copilot Professional Edition?
A: The AI Capacity Package field defaults to 0, which means you'll only have the base package capabilities. Each additional package increases task concurrency by 10 and adds 1 billion tokens to your daily limit.

Q: Do I need to create separate RAM users for each integration platform (DingTalk, Lark, etc.)?
A: While not strictly required, it's a security best practice to create separate RAM users with minimal necessary permissions for each integration to follow the principle of least privilege.

Q: How do I troubleshoot if my embedded RDS Copilot iframe shows an authentication error?
A: Verify that your RAM role has the required policies (AliyunRDSReadOnlyAccess and AliyunRDSCopilotReadOnlyAccess), ensure your temporary credentials haven't expired (they last 1 hour), and confirm that the TicketType parameter is set to "mini" for iframe embedding.

## Pricing & Billing

### Billing Model
- RDS Copilot Standard: Free during public preview
- RDS Copilot Professional Edition: Monthly subscription with base package and optional AI capacity packages
- RDS Custom with OpenClaw: Pay-per-request for model invocation plus instance fees
- AI Long-term Memory: Currently free for compute resources; model invocation fees apply per API call

### Price Reference

| Tier | CNY Price | USD Price |
|------|-----------|-----------|
| Base Package | CNY 6,000 per month | USD 869 per month |
| AI Capacity Package | CNY 10,000 per package per month | USD 1,448 per package per month |

### Free Tier
- RDS Copilot Standard: 1 million tokens free per month
- RDS Custom: New user free quota available on first activation; services suspend when quota is exhausted to avoid unexpected charges
- AI Long-term Memory: Compute resources are currently free

### Billing Notes
- AI capacity packages are purchased separately and each increases task concurrency by 10 and adds 1 billion tokens to daily limit
- Auto-renewal is recommended to avoid service disruption for RDS Copilot Professional Edition
- Model invocation fees for RDS Custom and AI Long-term Memory are billed based on usage; async tasks are billed on completion
- The official billing start date for AI Long-term Memory will be announced separately
- Maximum 5 AI capacity packages allowed; daily token limit up to 5.5 billion; task concurrency up to 55