Back to Astron Agent

AstronAgent Project Complete Deployment Guide

docs/DEPLOYMENT_GUIDE_WITH_AUTH_RPA.md

1.0.610.3 KB
Original Source

AstronAgent Project Complete Deployment Guide

This guide will help you start all components of the AstronAgent project in the correct order, including authentication, RPA, knowledge base, and core services.

📋 Project Architecture Overview

The AstronAgent project consists of the following four main components:

  1. Casdoor - Identity authentication and single sign-on service (required deployment component, provides SSO functionality)
  2. RagFlow - Knowledge base and document retrieval service (optional deployment component, deploy as needed)
  3. AstronAgent - Core business service cluster (required deployment component)
  4. RPA - Enterprise-grade Robotic Process Automation service (backend automatic deployment)

🚀 Deployment Steps

Prerequisites

Agent System Requirements

  • CPU >= 2 Core
  • RAM >= 4 GiB
  • Disk >= 50 GB

RAGFlow Requirements

  • CPU >= 4 Core
  • RAM >= 16 GB
  • Disk >= 50 GB

Step 1: Start RagFlow Knowledge Base Service (Optional, deploy as needed)

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 command, please ensure Docker and Docker Compose are installed on your machine.

bash
# Navigate to the RagFlow directory
cd docker/ragflow

# Add executable permissions to all sh files
chmod +x *.sh

# Start RagFlow service (includes all dependencies)
docker compose up -d

# Check service status
docker compose ps

# View service logs
docker compose logs -f ragflow

Access URLs:

Model Configuration Steps:

  1. Click on your avatar to enter the Model Providers page, select Add Model, fill in the corresponding API address and API Key, and add both Chat model and Embedding model.
  2. In the upper right corner of the same page, click Set Default Models and set the Chat model and Embedding model added in step 1 as default.

Important Configuration Notes:

  • Elasticsearch is used by default. To use opensearch or infinity, modify the DOC_ENGINE configuration in .env
  • GPU acceleration is supported, use docker-compose-gpu.yml to start

Step 2: Configure AstronAgent Environment Variables

Before starting AstronAgent services, you need to configure the relevant connection information.

bash
# Navigate to astronAgent directory
cd docker/astronAgent

# Copy environment variable configuration
cp .env.example .env

2.1 Configure Knowledge Base Service Connection (Optional,If RagFlow is deployed)

Edit the docker/astronAgent/.env file to configure RagFlow connection information:

bash
# Navigate to astronAgent directory
cd docker/astronAgent

# Edit environment variable configuration
vim .env

Key Configuration Items:

env
# 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:

  1. Visit RagFlow Web Interface: http://localhost:18080
  2. Log in and click on your avatar to enter user settings
  3. Click API to generate an API KEY
  4. Update the generated API KEY to RAGFLOW_API_TOKEN in the .env file

2.2 Configure iFLYTEK Open Platform APP_ID, API_KEY, and Related Information (Optional, some built-in features require the use of capabilities from the Open Platform)

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:

env
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

2.3 Configure the default model interface (OpenAI protocol) for the Agent

Edit the docker/astronAgent/.env file and update the relevant environment variables:

env
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

2.4 Configure Spark RAG Cloud Service (Optional)

Spark RAG cloud service provides two usage methods:

Method 1: Obtain from the Web Interface
  1. Use the APP_ID and API_SECRET created on the iFLYTEK Open Platform
  2. Directly obtain the Spark dataset ID from the web interface, see: xinghuo_rag_tool.html
Method 2: Using cURL Command Line

If you prefer using command-line tools, you can create a dataset with the following cURL command:

bash
# 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:

  • Please replace your_app_id with your actual APP ID
  • Please replace your_api_secret with your actual API Secret

After obtaining the dataset ID, please update it in the docker/astronAgent/.env file:

env
XINGHUO_DATASET_ID=

2.5 Configure Service Host Address

Edit the docker/astronAgent/.env file to configure the AstronAgent service host address:

env
HOST_BASE_ADDRESS=http://localhost

Note:

  • If you're using a domain name for access, replace localhost with your domain name
  • Ensure nginx and minio ports are properly exposed

Step 3: Start AstronAgent Core Services (includes Casdoor authentication service, RPA backend service)

To start the AstronAgent service, run our docker-compose-with-auth-rpa.yaml file. This file has integrated Casdoor and RPA backend services through the include mechanism, and will automatically start Casdoor and RPA.

bash
# Navigate to the astronAgent directory
cd docker/astronAgent

# Start all services (includes Casdoor, RPA)
docker compose -f docker-compose-with-auth-rpa.yaml up -d

Notes:

  • Casdoor default login username: admin, password: 123

Step 4: Modify Casdoor Authentication (Optional)

You 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).

4.1 Configure Casdoor Application

Get Casdoor Configuration Information:

  1. Visit the Casdoor admin console: http://localhost:8000

  2. Log in with the default admin account: admin / 123

  3. Create Organization Go to the http://localhost:8000/organizations page, click "Add", fill in the organization name, save and exit.

  4. Create Application and Bind Organization Go to the http://localhost:8000/applications page, click "Add".

    Fill in the following information when creating the application:

    • Name: Custom application name, e.g., agent
    • Redirect URL: Set to the project's callback address. If Nginx exposes port 80, use http://your-local-ip/callback; if it's another port (e.g., 888), use http://your-local-ip:888/callback
    • Organization: Select the organization name just created
  5. After saving the application, record the following information and match it with the project configuration items:

Casdoor InformationExample ValueCorresponding .env Configuration
Casdoor service URLhttp://localhost:8000CONSOLE_CASDOOR_URL=http://localhost:8000
Client IDyour-casdoor-client-idCONSOLE_CASDOOR_ID=your-casdoor-client-id
Application Nameyour-casdoor-app-nameCONSOLE_CASDOOR_APP=your-casdoor-app-name
Organization Nameyour-casdoor-org-nameCONSOLE_CASDOOR_ORG=your-casdoor-org-name
  1. Fill in the above configuration information in the project's environment variable file:
bash
# Navigate to the astronAgent directory
cd docker/astronAgent

# Edit environment variable configuration
vim .env

Add or update the following configuration items in the .env file:

env
# 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
  1. Restart the AstronAgent service to apply the new configuration:
bash
docker compose restart console-frontend console-hub

📊 Service Access URLs

After startup is complete, you can access the services at the following addresses:

Authentication Service

Knowledge Base Service

AstronAgent Core Services

RPA Core Services

📚 Additional Resources

🤝 Technical Support

If you encounter issues, please:

  1. Check the relevant service log files
  2. Review the official documentation and troubleshooting guide
  3. Submit an issue on the project's GitHub repository
  4. Contact the technical support team

Note: For first-time deployment, it is recommended to validate all functionalities in a test environment before deploying to production.