docs/DEPLOYMENT_GUIDE.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
Casdoor is an open-source identity and access management platform that provides support for multiple authentication protocols including OAuth 2.0, OIDC, and SAML.
To start the Casdoor service, run our docker-compose-with-auth.yaml file. Before running the installation commands, please ensure that Docker and Docker Compose are installed on your machine.
# Navigate to astronAgent directory
cd docker/astronAgent
# Start Casdoor service
docker compose -f docker-compose-auth.yml up -d
Service Information:
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
Access Address:
Model Configuration Steps:
Important Configuration Notes:
docker-compose-gpu.ymlBefore starting astronAgent services, configure Casdoor, access addresses, and other infrastructure connection information.
# Navigate to astronAgent directory
cd docker/astronAgent
# Copy environment variable configuration
cp .env.example .env
The .env file is only used for startup, access addresses, authentication, database, Redis, object storage, and other infrastructure settings. Business capability accounts such as RAGFlow, iFLYTEK Open Platform, AI Ability Chat, Virtual Man, and Spark Knowledge Base are no longer configured in .env. Configure them in Platform Account Management after astronAgent starts.
# Navigate to astronAgent directory
cd docker/astronAgent
# Edit environment variable configuration
vim .env
Configure the astronAgent service host address:
HOST_BASE_ADDRESS=http://localhost
Notes:
localhost with your domain nameEdit the docker/astronAgent/.env file to configure Casdoor connection information:
Key Configuration Items:
# Casdoor Configuration
CONSOLE_CASDOOR_URL=http://your-casdoor-server:8000
CONSOLE_CASDOOR_ID=your-casdoor-client-id
CONSOLE_CASDOOR_APP=your-casdoor-app-name
CONSOLE_CASDOOR_ORG=your-casdoor-org-name
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
To start astronAgent services, run our docker-compose.yaml file. Before running the installation commands, please ensure that Docker and Docker Compose are installed on your machine.
# Navigate to astronAgent directory
cd docker/astronAgent
# Start all services
docker compose up -d
After astronAgent starts, access the console and log in. Open Platform Account Management from the left menu. Platform Account Management is at the same menu level as Application Management and Resource Management, and contains the following four configuration cards. After saving, the configuration takes effect globally immediately. The system automatically refreshes the cache, and containers do not need to be restarted. If a feature depends on a capability that has not been configured, the system prompts the user to configure it in Platform Account Management and does not block system startup.
iFLYTEK Open Platform (used by built-in Spark model, real-time speech recognition, image generation, and related capabilities):
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:
Prepare and fill in the following fields under Platform Account Management - iFLYTEK Open Platform:
PLATFORM_APP_IDPLATFORM_API_KEYPLATFORM_API_SECRETSPARK_API_PASSWORDSPARK_RTASR_API_KEYAI Ability Chat (used by platform AI generation capabilities, compatible with OpenAI protocols, such as prompt optimization and one-sentence agent creation):
AI_ABILITY_CHAT_BASE_URLAI_ABILITY_CHAT_MODELAI_ABILITY_CHAT_API_KEYVirtual Man capability:
SPARK_VIRTUAL_MAN_APP_IDSPARK_VIRTUAL_MAN_API_KEYSPARK_VIRTUAL_MAN_API_SECRETKnowledge Base Platform:
RAGFLOW_BASE_URL, RAGFLOW_API_TOKEN, RAGFLOW_TIMEOUT, RAGFLOW_DEFAULT_GROUPXINGHUO_DATASET_IDWhen creating a knowledge base, users choose RAGFlow or Spark Knowledge Base. Only the platform actually used needs to be configured.
Obtaining RagFlow API Token:
RAGFLOW_API_TOKEN under Platform Account Management - Knowledge Base PlatformObtaining Spark Knowledge Base Dataset ID:
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, fill it in as XINGHUO_DATASET_ID under Platform Account Management - Knowledge Base Platform.
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.