Skip to content

Commit 0b568cf

Browse files
committed
Update the README content.
1 parent 9d17152 commit 0b568cf

File tree

8 files changed

+219
-60
lines changed

8 files changed

+219
-60
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ You are a professional Alibaba Cloud RDS Copilot, specializing in providing cust
141141
- **Safety Awareness**: Ensure no operations negatively impact customer databases.
142142
```
143143

144+
## Use Cases
145+
### mydba
146+
Alibaba Cloud Database MyDBA Agent(<a href="./component/mydba/README.md">README.md</a>)
147+
- Buy RDS
148+
<img src="./assets/buy_rds.gif" alt="buy RDS" width="500"/>
149+
- Diagnose RDS
150+
<img src="./assets/diagnose.gif" alt="diagnose RDS" width="500"/>
151+
144152
## Contributing
145153
Contributions are welcome! Please feel free to submit a Pull Request.
146154
1. Fork the repository

README_CN.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ git clone https://github.com/aliyun/alibabacloud-rds-openapi-mcp-server.git
138138
- **安全性注意**:在执行任何操作时,需确保不会对客户的数据库造成负面影响。
139139
```
140140

141+
## 使用案例
142+
### mydba
143+
阿里云数据库 MyDBA 智能体(<a href="./component/mydba/README_cn.md">README_cn.md</a>)
144+
- 购买RDS
145+
<img src="./assets/buy_rds_cn.gif" alt="购买RDS" width="500"/>
146+
- 诊断RDS
147+
<img src="./assets/diagnose_cn.gif" alt="诊断RDS" width="500"/>
148+
141149
## 贡献指南
142150
欢迎贡献代码!请提交Pull Request:
143151
1. Fork 本仓库

assets/buy_rds.gif

4.1 MB
Loading

assets/buy_rds_cn.gif

5 MB
Loading

assets/diagnose.gif

2.04 MB
Loading

assets/diagnose_cn.gif

3.04 MB
Loading

component/mydba/README.md

Lines changed: 63 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,52 @@
1-
# 阿里云数据库 MyDBA 智能体
1+
<p align="center">English | <a href="./README_CN.md">中文</a><br></p>
22

3-
## 特性
3+
# Alibaba Cloud Database MyDBA Agent
44

5-
1. **支持对阿里云 RDS 进行管理**,包括:
6-
- 实例信息查询
7-
- 问题分析
8-
- 购买与变配
9-
2. **对自建数据库进行问数**,帮助进行数据查询、统计与分析。
5+
## Features
106

11-
## 安装指南
7+
1. **Supports management of Alibaba Cloud RDS**, including:
8+
- Instance information query
9+
- RDS Issue analysis
10+
- Purchase and modify RDS instance
1211

13-
### 环境准备
12+
2. **Query data for self-built databases**, assisting with data queries, statistics and analysis.
1413

15-
1. **安装 `uv`**
16-
- [Astral](https://docs.astral.sh/uv/getting-started/installation/) 安装 `uv`
17-
- [GitHub README](https://github.com/astral-sh/uv#installation) 安装 `uv`
18-
- [GitHub Release](https://github.com/astral-sh/uv/releases) 下载 `uv`
14+
## Installation Guide
1915

20-
2. **安装 Python**
21-
- 使用以下命令安装 Python:
16+
### Environment Preparation
17+
18+
1. **Install `uv`**:
19+
- Install `uv` via [Astral](https://docs.astral.sh/uv/getting-started/installation/)
20+
- Install `uv` via [GitHub README](https://github.com/astral-sh/uv#installation)
21+
- Download `uv` from [GitHub Release](https://github.com/astral-sh/uv/releases)
22+
23+
2. **Install Python**:
24+
- Use the following command to install Python:
2225

2326
```shell
2427
uv python install 3.12
2528
```
2629

27-
3. **申请大模型 Key**
28-
- 兼容 OpenAI 客户端,支持通义千问、Deepseek
30+
3. **Apply for a LLM api key**:
31+
- Compatible with OpenAI client, support Qwen and Deepseek.
2932

30-
4. **准备阿里云账号**
31-
- 确保你有阿里云 RDS 服务访问权限(策略名:AliyunRDSFullAccess)的账号凭证。
33+
4. **Prepare an Alibaba Cloud account AK/SK**:
34+
- Ensure your account having the access permission with Alibaba Cloud RDS service (Policy Name: AliyunRDSFullAccess).
3235

33-
### 安装依赖
36+
### Install Dependencies
3437

35-
使用 `uv` 安装依赖模块:
38+
Install dependency modules using `uv`:
3639

3740
```shell
38-
export UV_DEFAULT_INDEX="https://mirrors.aliyun.com/pypi/simple"
41+
export UV_DEFAULT_INDEX="https://mirrors.aliyun.com/pypi/simple" # optional
3942
uv sync --inexact
4043
```
4144

42-
### 服务初始化
45+
### Service Initialization
4346

44-
1. **准备配置文件**
45-
- 默认路径:`/usr/local/mydba/config_app.ini`
46-
- 配置好 `model``app` `rag` 部分的参数项:
47+
1. **Prepare Configuration File**
48+
- Default path: `/usr/local/mydba/config_app.ini`
49+
- Configure parameters in the `model`, `app`, and `rag` sections:
4750

4851
```ini
4952
[common]
@@ -56,83 +59,83 @@ uv sync --inexact
5659
file_level = INFO
5760

5861
[model]
59-
api_key = sk-xxx ; 大模型 key
60-
base_url = https://api.deepseek.com ; 大模型调用地址(这里是 Deepseek 模型地址)
61-
model = deepseek-chat ; 模型名称(这里是 Deepseek 模型名称)
62+
api_key = sk-xxx ; LLM api key
63+
base_url = https://api.deepseek.com ; LLM api base url (example is the model address of Deepseek)
64+
model = deepseek-chat ; LLM model name (example is the model name of Deepseek)
6265
max_tokens = 1000
6366
temperature = 1.0
6467

6568
[app]
6669
refresh_interval = 60
6770
max_steps = 100
68-
security_key = xxxxxxxxxxxxxxxx ; 加密 key,固定 16 字节长度,用于工程内部数据保护
71+
security_key = xxxxxxxxxxxxxxxx ; Key for encryption, 16-byte length, for internal data protection
6972

7073
[rag]
71-
api_key = sk-xxx ; 大模型 key
72-
base_url = https://dashscope.aliyuncs.com/compatible-mode/v1 ; 大模型调用地址(这里是通义模型地址)
73-
embedding = text-embedding-v2 ; embedding 模型名称(通义千问支持 embedding 调用)
74+
api_key = sk-xxx ; LLM api key
75+
base_url = https://dashscope.aliyuncs.com/compatible-mode/v1 ; LLM api base url (example is the model address of Qwen)
76+
embedding = text-embedding-v2 ; Embedding model name (Qwen supports embedding api calls)
7477
data_dir = /usr/local/mydba/vector_store
7578
```
7679

77-
2. **初始化 Agent**
78-
- 执行以下命令以初始化 Agent。请确保您已经正确配置了 **`config_app.ini`** 文件,并用您的阿里云账号替换 `xxxxxx`
80+
2. **Initialize Agent**
81+
- Execute the following command to initialize the Agent. Ensure you have correctly configured the **`config_app.ini`** file and replace `xxxxxx` with your Alibaba Cloud account AK/SK.
7982

8083
```shell
8184
uv --directory /path/to/mydba \
8285
run init_config.py \
83-
init-project \ # 初始化工程
84-
--config_file /usr/local/mydba/config_app.ini \ # 配置文件路径
85-
--reset \ # 清空已有配置(可选)
86-
--rds_access_id xxxxxx \ # 替换为您的阿里云账号 ID
87-
--rds_access_key xxxxxx # 替换为您的阿里云账号密钥
86+
init-project \ # Initialize project
87+
--config_file /usr/local/mydba/config_app.ini \ # Configuration file path
88+
--reset \ # Clear existing configuration (optional)
89+
--rds_access_id xxxxxx \ # Replace with your Alicloud account ID
90+
--rds_access_key xxxxxx # Replace with your Alicloud account secret
8891
```
8992

90-
3. **添加自建数据库**
91-
- 执行以下命令以添加自建数据库。请确保您已正确配置 **`config_app.ini`** 文件,并根据实际情况替换 `--db_info` 参数中的数据库连接信息。
93+
3. **Add Self-Built Database**
94+
- Execute the following command to add a self-built database. Ensure you have correctly configured the **`config_app.ini`** file and replace `--db_info` parameters with actual database connection details.
9295

9396
```shell
9497
uv --directory /path/to/mydba \
9598
run init_config.py \
96-
add-db \ # 添加自建数据库
97-
--config_file /usr/local/mydba/config_app.ini \ # 配置文件路径
98-
--db_info 'mysql####127.0.0.1##3306##root##123456##utf8mb4##mybase' # 数据库连接信息,注意特殊字符的转义
99+
add-db \ # Add self-built database
100+
--config_file /usr/local/mydba/config_app.ini \ # Path to the configuration file
101+
--db_info 'mysql####127.0.0.1##3306##root##123456##utf8mb4##mybase' # Database connection info, pay attention to the escape of special characters
99102
```
100103

101-
4. **初始化 RAG 工具**
102-
- 执行以下命令以初始化 RAG 工具。请确保您已经正确配置了 **`config_app.ini`** 文件,并添加了**自建数据库**
104+
4. **Initialize RAG Tool**
105+
- Execute the following command to initialize the RAG tool. Ensure you have correctly configured the **`config_app.ini`** file and added the **self-built database**.
103106

104107
```shell
105-
uv --directory /path/to/mydba/mydba/mcp/rag \ # 这里是 RAG 的工作目录 ./mydba/mcp/rag
106-
run rag_init.py \ # 运行 RAG 初始化脚本
107-
init-config \ # 初始化配置
108-
--config_file /usr/local/mydba/config_app.ini # 配置文件路径
108+
uv --directory /path/to/mydba/mydba/mcp/rag \ # RAG working directory ./mydba/mcp/rag
109+
run rag_init.py \ # Run RAG initialization script
110+
init-config \ # Initialize configuration
111+
--config_file /usr/local/mydba/config_app.ini # Path to the configuration file
109112
```
110113

111-
### 服务启动
114+
### Service Startup
112115

113-
- 执行启动命令:**`mydba`** 通过控制台安装的智能体,会在操作系统注册此命令。
116+
- Execute the start command: **`mydba`** (install agent via MyBase console, this command will register in the OS)
114117

115118
```shell
116119
mydba
117120
```
118121

119-
- 或者执行启动脚本:**`mydba.sh`** 智能体自带的启动脚本,如果没有修改默认的安装路径,可直接使用。
122+
- Or use the startup script: **`mydba.sh`** (built-in startup script, use directly if default installation path is unchanged)
120123

121124
```shell
122125
sh /path/to/mydba/shell/mydba.sh
123126
```
124127

125-
- 或者手动执行如下命令:
128+
- Or manually execute the following commands:
126129

127130
```shell
128-
# 配置环境变量(可选,默认:/usr/local/mydba/config_app.ini
131+
# Set environment variables (optional, default: /usr/local/mydba/config_app.ini)
129132
export MYDBA_CONFIG_FILE=/path/to/mydba/config_app.ini
130-
# 启动 RAG Server
133+
# Start RAG Server
131134
nohup uv --directory /path/to/mydba/mydba/mcp/rag run rag_server.py >> /path/to/mydba/logs/rag.log 2>&1 &
132-
# 启动 MyDBA
135+
# Start MyDBA
133136
uv --directory /path/to/mydba run main.py
134137
```
135138

136-
## 联系我们
139+
## Contact Us
137140

138-
- 向上查看 RDS MCP 的 README.md,加入钉钉群。
141+
- Welcome joining the DingTalk group for feedback, refer to the README.md of RDS MCP for details.

component/mydba/README_CN.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
<p align="center"><a href="./README.md">English</a> | 中文<br></p>
2+
3+
# 阿里云数据库 MyDBA 智能体
4+
5+
## 特性
6+
7+
1. **支持对阿里云 RDS 进行管理**,包括:
8+
- 实例信息查询
9+
- 问题分析
10+
- 购买与变配
11+
2. **对自建数据库进行问数**,帮助进行数据查询、统计与分析。
12+
13+
## 安装指南
14+
15+
### 环境准备
16+
17+
1. **安装 `uv`**
18+
- [Astral](https://docs.astral.sh/uv/getting-started/installation/) 安装 `uv`
19+
- [GitHub README](https://github.com/astral-sh/uv#installation) 安装 `uv`
20+
- [GitHub Release](https://github.com/astral-sh/uv/releases) 下载 `uv`
21+
22+
2. **安装 Python**
23+
- 使用以下命令安装 Python:
24+
25+
```shell
26+
uv python install 3.12
27+
```
28+
29+
3. **申请大模型 Key**
30+
- 兼容 OpenAI 客户端,支持通义千问、Deepseek。
31+
32+
4. **准备阿里云账号**
33+
- 确保你有阿里云 RDS 服务访问权限(策略名:AliyunRDSFullAccess)的账号凭证。
34+
35+
### 安装依赖
36+
37+
使用 `uv` 安装依赖模块:
38+
39+
```shell
40+
export UV_DEFAULT_INDEX="https://mirrors.aliyun.com/pypi/simple"
41+
uv sync --inexact
42+
```
43+
44+
### 服务初始化
45+
46+
1. **准备配置文件**
47+
- 默认路径:`/usr/local/mydba/config_app.ini`
48+
- 配置好 `model``app``rag` 部分的参数项:
49+
50+
```ini
51+
[common]
52+
debug = False
53+
config_database = sqlite:///usr/local/mydba/sqlite_app.db
54+
55+
[log]
56+
dir = /usr/local/mydba/logs
57+
name = mydba
58+
file_level = INFO
59+
60+
[model]
61+
api_key = sk-xxx ; 大模型 key
62+
base_url = https://api.deepseek.com ; 大模型调用地址(这里是 Deepseek 模型地址)
63+
model = deepseek-chat ; 模型名称(这里是 Deepseek 模型名称)
64+
max_tokens = 1000
65+
temperature = 1.0
66+
67+
[app]
68+
refresh_interval = 60
69+
max_steps = 100
70+
security_key = xxxxxxxxxxxxxxxx ; 加密 key,固定 16 字节长度,用于工程内部数据保护
71+
72+
[rag]
73+
api_key = sk-xxx ; 大模型 key
74+
base_url = https://dashscope.aliyuncs.com/compatible-mode/v1 ; 大模型调用地址(这里是通义模型地址)
75+
embedding = text-embedding-v2 ; embedding 模型名称(通义千问支持 embedding 调用)
76+
data_dir = /usr/local/mydba/vector_store
77+
```
78+
79+
2. **初始化 Agent**
80+
- 执行以下命令以初始化 Agent。请确保您已经正确配置了 **`config_app.ini`** 文件,并用您的阿里云账号替换 `xxxxxx`
81+
82+
```shell
83+
uv --directory /path/to/mydba \
84+
run init_config.py \
85+
init-project \ # 初始化工程
86+
--config_file /usr/local/mydba/config_app.ini \ # 配置文件路径
87+
--reset \ # 清空已有配置(可选)
88+
--rds_access_id xxxxxx \ # 替换为您的阿里云账号 ID
89+
--rds_access_key xxxxxx # 替换为您的阿里云账号密钥
90+
```
91+
92+
3. **添加自建数据库**
93+
- 执行以下命令以添加自建数据库。请确保您已正确配置 **`config_app.ini`** 文件,并根据实际情况替换 `--db_info` 参数中的数据库连接信息。
94+
95+
```shell
96+
uv --directory /path/to/mydba \
97+
run init_config.py \
98+
add-db \ # 添加自建数据库
99+
--config_file /usr/local/mydba/config_app.ini \ # 配置文件路径
100+
--db_info 'mysql####127.0.0.1##3306##root##123456##utf8mb4##mybase' # 数据库连接信息,注意特殊字符的转义
101+
```
102+
103+
4. **初始化 RAG 工具**
104+
- 执行以下命令以初始化 RAG 工具。请确保您已经正确配置了 **`config_app.ini`** 文件,并添加了**自建数据库**
105+
106+
```shell
107+
uv --directory /path/to/mydba/mydba/mcp/rag \ # 这里是 RAG 的工作目录 ./mydba/mcp/rag
108+
run rag_init.py \ # 运行 RAG 初始化脚本
109+
init-config \ # 初始化配置
110+
--config_file /usr/local/mydba/config_app.ini # 配置文件路径
111+
```
112+
113+
### 服务启动
114+
115+
- 执行启动命令:**`mydba`** 通过控制台安装的智能体,会在操作系统注册此命令。
116+
117+
```shell
118+
mydba
119+
```
120+
121+
- 或者执行启动脚本:**`mydba.sh`** 智能体自带的启动脚本,如果没有修改默认的安装路径,可直接使用。
122+
123+
```shell
124+
sh /path/to/mydba/shell/mydba.sh
125+
```
126+
127+
- 或者手动执行如下命令:
128+
129+
```shell
130+
# 配置环境变量(可选,默认:/usr/local/mydba/config_app.ini)
131+
export MYDBA_CONFIG_FILE=/path/to/mydba/config_app.ini
132+
# 启动 RAG Server
133+
nohup uv --directory /path/to/mydba/mydba/mcp/rag run rag_server.py >> /path/to/mydba/logs/rag.log 2>&1 &
134+
# 启动 MyDBA
135+
uv --directory /path/to/mydba run main.py
136+
```
137+
138+
## 联系我们
139+
140+
- 向上查看 RDS MCP 的 README.md,加入钉钉群。

0 commit comments

Comments
 (0)