1
- # 阿里云数据库 MyDBA 智能体
1
+ < p align = " center " >English | < a href = " ./README_CN.md " >中文</ a >< br ></ p >
2
2
3
- ## 特性
3
+ # Alibaba Cloud Database MyDBA Agent
4
4
5
- 1 . ** 支持对阿里云 RDS 进行管理** ,包括:
6
- - 实例信息查询
7
- - 问题分析
8
- - 购买与变配
9
- 2 . ** 对自建数据库进行问数** ,帮助进行数据查询、统计与分析。
5
+ ## Features
10
6
11
- ## 安装指南
7
+ 1 . ** Supports management of Alibaba Cloud RDS** , including:
8
+ - Instance information query
9
+ - RDS Issue analysis
10
+ - Purchase and modify RDS instance
12
11
13
- ### 环境准备
12
+ 2 . ** Query data for self-built databases ** , assisting with data queries, statistics and analysis.
14
13
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
19
15
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:
22
25
23
26
``` shell
24
27
uv python install 3.12
25
28
```
26
29
27
- 3 . ** 申请大模型 Key ** :
28
- - 兼容 OpenAI 客户端,支持通义千问、 Deepseek。
30
+ 3 . ** Apply for a LLM api key ** :
31
+ - Compatible with OpenAI client, support Qwen and Deepseek.
29
32
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).
32
35
33
- ### 安装依赖
36
+ ### Install Dependencies
34
37
35
- 使用 ` uv ` 安装依赖模块:
38
+ Install dependency modules using ` uv ` :
36
39
37
40
``` shell
38
- export UV_DEFAULT_INDEX=" https://mirrors.aliyun.com/pypi/simple"
41
+ export UV_DEFAULT_INDEX=" https://mirrors.aliyun.com/pypi/simple" # optional
39
42
uv sync --inexact
40
43
```
41
44
42
- ### 服务初始化
45
+ ### Service Initialization
43
46
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:
47
50
48
51
``` ini
49
52
[common]
@@ -56,83 +59,83 @@ uv sync --inexact
56
59
file_level = INFO
57
60
58
61
[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)
62
65
max_tokens = 1000
63
66
temperature = 1.0
64
67
65
68
[app]
66
69
refresh_interval = 60
67
70
max_steps = 100
68
- security_key = xxxxxxxxxxxxxxxx ; 加密 key,固定 16 字节长度,用于工程内部数据保护
71
+ security_key = xxxxxxxxxxxxxxxx ; Key for encryption, 16-byte length, for internal data protection
69
72
70
73
[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)
74
77
data_dir = /usr/local/mydba/vector_store
75
78
```
76
79
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.
79
82
80
83
``` shell
81
84
uv --directory /path/to/mydba \
82
85
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
88
91
```
89
92
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.
92
95
93
96
``` shell
94
97
uv --directory /path/to/mydba \
95
98
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
99
102
```
100
103
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 ** .
103
106
104
107
``` 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
109
112
```
110
113
111
- ### 服务启动
114
+ ### Service Startup
112
115
113
- - 执行启动命令: ** ` mydba ` ** 通过控制台安装的智能体,会在操作系统注册此命令。
116
+ - Execute the start command: ** ` mydba ` ** (install agent via MyBase console, this command will register in the OS)
114
117
115
118
``` shell
116
119
mydba
117
120
```
118
121
119
- - 或者执行启动脚本: ** ` mydba.sh ` ** 智能体自带的启动脚本,如果没有修改默认的安装路径,可直接使用。
122
+ - Or use the startup script: ** ` mydba.sh ` ** (built-in startup script, use directly if default installation path is unchanged)
120
123
121
124
``` shell
122
125
sh /path/to/mydba/shell/mydba.sh
123
126
```
124
127
125
- - 或者手动执行如下命令:
128
+ - Or manually execute the following commands:
126
129
127
130
``` shell
128
- # 配置环境变量(可选,默认: /usr/local/mydba/config_app.ini)
131
+ # Set environment variables (optional, default: /usr/local/mydba/config_app.ini)
129
132
export MYDBA_CONFIG_FILE=/path/to/mydba/config_app.ini
130
- # 启动 RAG Server
133
+ # Start RAG Server
131
134
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
133
136
uv --directory /path/to/mydba run main.py
134
137
```
135
138
136
- ## 联系我们
139
+ ## Contact Us
137
140
138
- - 向上查看 RDS MCP 的 README.md,加入钉钉群。
141
+ - Welcome joining the DingTalk group for feedback, refer to the README.md of RDS MCP for details.
0 commit comments