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
3942uv 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.
0 commit comments