docs/DEPLOYMENT_GUIDE_WITH_AUTH.md
This guide will help you start all components of the AstronAgent project in the correct order, including authentication, knowledge base, and core services.
The AstronAgent project consists of the following three main components:
Agent System Requirements
RAGFlow Requirements
RagFlow is an open-source RAG (Retrieval-Augmented Generation) engine that provides accurate question-answering services using deep document understanding technology.
To start the RagFlow service, run our docker-compose.yml file or docker-compose-macos.yml. Before running the installation commands, please ensure that Docker and Docker Compose are installed on your machine.
# Navigate to RagFlow directory
cd docker/ragflow
# Add executable permissions to all sh files
chmod +x *.sh
# Start RagFlow service (including all dependencies)
docker compose up -d
# Check service status
docker compose ps
# View service logs
docker compose logs -f ragflow
Access Address:
Model Configuration Steps:
Important Configuration Notes:
docker-compose-gpu.ymlBefore starting AstronAgent services, you need to configure the relevant connection information.
# Navigate to astronAgent directory
cd docker/astronAgent
# Copy environment variable configuration
cp .env.example .env
Edit the docker/astronAgent/.env file to configure RagFlow connection information:
# Navigate to astronAgent directory
cd docker/astronAgent
# Edit environment variable configuration
vim .env
Key Configuration Items:
# RAGFlow Configuration
RAGFLOW_BASE_URL=http://localhost:18080
RAGFLOW_API_TOKEN=ragflow-your-api-token-here
RAGFLOW_TIMEOUT=60
RAGFLOW_DEFAULT_GROUP=星辰知识库
Obtaining RagFlow API Token:
For documentation, see: https://www.xfyun.cn/doc/platform/quickguide.html
After creating your application, you may need to purchase or claim API authorization service quotas for the corresponding capabilities:
Edit the docker/astronAgent/.env file and update the relevant environment variables:
PLATFORM_APP_ID=your-app-id
PLATFORM_API_KEY=your-api-key
PLATFORM_API_SECRET=your-api-secret
SPARK_API_PASSWORD=your-api-password
SPARK_RTASR_API_KEY=your-rtasr-api-key
Edit the docker/astronAgent/.env file and update the relevant environment variables:
AI_ABILITY_CHAT_BASE_URL=https://spark-api-open.xf-yun.com/v1
AI_ABILITY_CHAT_MODEL=your-model-id
AI_ABILITY_CHAT_API_KEY=your-api-key
Spark RAG cloud service provides two usage methods:
If you prefer using command-line tools, you can create a dataset with the following cURL command:
# Create Spark RAG dataset
curl -X PUT 'https://chatdoc.xfyun.cn/openapi/v1/dataset/create' \
-H "Accept: application/json" \
-H "appId: your_app_id" \
-H "timestamp: $(date +%s)" \
-H "signature: $(echo -n "$(echo -n "your_app_id$(date +%s)" | md5sum | awk '{print $1}')" | openssl dgst -sha1 -hmac 'your_api_secret' -binary | base64)" \
-F "name=我的数据集"
Notes:
your_app_id with your actual APP IDyour_api_secret with your actual API SecretAfter obtaining the dataset ID, please update it in the docker/astronAgent/.env file:
XINGHUO_DATASET_ID=
Edit the docker/astronAgent/.env file to configure the AstronAgent service host address:
HOST_BASE_ADDRESS=http://localhost
Note:
localhost with your domain nameTo start AstronAgent services, run our docker-compose-with-auth.yaml file. This file has integrated the Casdoor authentication service through the include mechanism and will automatically start Casdoor.
# Navigate to astronAgent directory
cd docker/astronAgent
# Start all services (including Casdoor)
docker compose -f docker-compose-with-auth.yaml up -d
Note:
admin, password: 123You can create new applications and organizations in Casdoor as needed, and update the configuration information in the .env file (default organization and application already exist).
Obtaining Casdoor Configuration Information:
Visit the Casdoor management console: http://localhost:8000
Log in with the default administrator account: admin / 123
Create Organization Go to the http://localhost:8000/organizations page, click "Add", fill in the organization name, save and exit.
Create Application and Bind Organization Go to the http://localhost:8000/applications page, click "Add".
When creating the application, fill in the following information:
agent80, use http://your-local-ip/callback; if it's another port (e.g., 888), use http://your-local-ip:888/callbackAfter saving the application, record the following information and map it to the project configuration items:
| Casdoor Information Item | Example Value | Corresponding .env Configuration Item |
|---|---|---|
| Casdoor Service Address (URL) | http://localhost:8000 | CONSOLE_CASDOOR_URL=http://localhost:8000 |
| Client ID | your-casdoor-client-id | CONSOLE_CASDOOR_ID=your-casdoor-client-id |
| Application Name (Name) | your-casdoor-app-name | CONSOLE_CASDOOR_APP=your-casdoor-app-name |
| Organization Name (Organization) | your-casdoor-org-name | CONSOLE_CASDOOR_ORG=your-casdoor-org-name |
# Navigate to astronAgent directory
cd docker/astronAgent
# Edit environment variable configuration
vim .env
Add or update the following configuration items in the .env file:
# Casdoor Configuration
CONSOLE_CASDOOR_URL=http://localhost:8000
CONSOLE_CASDOOR_ID=your-casdoor-client-id
CONSOLE_CASDOOR_APP=your-casdoor-app-name
CONSOLE_CASDOOR_ORG=your-casdoor-org-name
docker compose restart console-frontend console-hub
After startup, you can access the services at the following addresses:
If you encounter issues, please:
Note: For first-time deployment, it is recommended to verify all functionalities in a test environment before deploying to production.