admin/client/README.md
Admin Service is a dedicated management component designed to monitor, maintain, and administrate the RAGFlow system. It provides comprehensive tools for ensuring system stability, performing operational tasks, and managing users and permissions efficiently.
The service offers real-time monitoring of critical components, including the RAGFlow server, Task Executor processes, and dependent services such as MySQL, Infinity, Elasticsearch, Redis, and MinIO. It automatically checks their health status, resource usage, and uptime, and performs restarts in case of failures to minimize downtime.
For user and system management, it supports listing, creating, modifying, and deleting users and their associated resources like knowledge bases and Agents.
Built with scalability and reliability in mind, the Admin Service ensures smooth system operation and simplifies maintenance workflows.
It consists of a server-side Service and a command-line client (CLI), both implemented in Python. User commands are parsed using the Lark parsing toolkit.
Before start Admin Service, please make sure RAGFlow system is already started.
Launch from source code:
python admin/server/admin_server.py
The service will start and listen for incoming connections from the CLI on the configured port.
Before startup, please configure the docker_compose.yml file to enable admin server:
command:
- --enable-adminserver
Start the containers, the service will start and listen for incoming connections from the CLI on the configured port.
Ensure the Admin Service is running.
Install ragflow-cli.
pip install ragflow-cli==0.25.1
Launch the CLI client:
ragflow-cli -h 127.0.0.1 -p 9381
You will be prompted to enter the superuser's password to log in. The default password is admin.
Parameters:
-h: RAGFlow admin server host address
-p: RAGFlow admin server port
Commands are case-insensitive and must be terminated with a semicolon (;).
LIST SERVICES;
SHOW SERVICE <id>;
<id>.LIST USERS;
SHOW USER '<username>';
CREATE USER <username> <password>;
DROP USER '<username>';
ALTER USER PASSWORD '<username>' '<new_password>';
ALTER USER ACTIVE <username> <on/off>;
LIST DATASETS OF '<username>';
LIST AGENTS OF '<username>';
Meta-commands are prefixed with a backslash (\).
\? or \help
\q or \quit
admin> list users;
+-------------------------------+------------------------+-----------+-------------+
| create_date | email | is_active | nickname |
+-------------------------------+------------------------+-----------+-------------+
| Fri, 22 Nov 2024 16:03:41 GMT | [email protected] | 1 | Jeffery |
| Fri, 22 Nov 2024 16:10:55 GMT | [email protected] | 1 | Waterdancer |
+-------------------------------+------------------------+-----------+-------------+
admin> list services;
+-------------------------------------------------------------------------------------------+-----------+----+---------------+-------+----------------+
| extra | host | id | name | port | service_type |
+-------------------------------------------------------------------------------------------+-----------+----+---------------+-------+----------------+
| {} | 0.0.0.0 | 0 | ragflow_0 | 9380 | ragflow_server |
| {'meta_type': 'mysql', 'password': 'infini_rag_flow', 'username': 'root'} | localhost | 1 | mysql | 5455 | meta_data |
| {'password': 'infini_rag_flow', 'store_type': 'minio', 'user': 'rag_flow'} | localhost | 2 | minio | 9000 | file_store |
| {'password': 'infini_rag_flow', 'retrieval_type': 'elasticsearch', 'username': 'elastic'} | localhost | 3 | elasticsearch | 1200 | retrieval |
| {'db_name': 'default_db', 'retrieval_type': 'infinity'} | localhost | 4 | infinity | 23817 | retrieval |
| {'database': 1, 'mq_type': 'redis', 'password': 'infini_rag_flow'} | localhost | 5 | redis | 6379 | message_queue |
+-------------------------------------------------------------------------------------------+-----------+----+---------------+-------+----------------+