This guide is designed for Ubuntu system users to quickly deploy and configure the PolyAgent production-grade AI agent platform development environment.
- System Environment
- Dependencies Installation
- Project Deployment
- Service Verification
- Running Your First Task
- Web Interface Access
- Common Management Commands
- Troubleshooting
# Check system version information
cat /etc/lsb-releaseRecommended Configuration:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"# Docker version requirements
docker -v
# Recommended: Docker version 26.1.3, build b72abbb
# Docker Compose version requirements
docker compose -v
# Recommended: docker-compose version 1.29.1, build c34c88b2# Project deployment directory (customize as needed)
${SHANNON_BASE_DIR:-/data}
# Code path (relative to base directory)
${SHANNON_BASE_DIR:-/data}/PolyAgent/# Complete development environment one-click installation
sudo apt-get update && sudo apt-get install -y \
netcat-traditional curl wget tar unzip git \
net-tools telnet nmap dnsutils tcpdump \
htop iotop lsof strace tree jq \
vim nano grep awk sed \
build-essential make gcc g++grpcurl is an essential debugging tool for the PolyAgent platform, used to test gRPC service interfaces:
# Project Information
# Repository: https://github.com/fullstorydev/grpcurl
# Language: Go
# Purpose: Command-line client for gRPC services (equivalent to curl for HTTP)
# Download latest version
wget https://github.com/fullstorydev/grpcurl/releases/download/v1.8.9/grpcurl_1.8.9_linux_x86_64.tar.gz
# Extract files
tar -xzf grpcurl_1.8.9_linux_x86_64.tar.gz
# Move to system path
sudo mv grpcurl /usr/local/bin/
# Verify installation
grpcurl --version
# Output: grpcurl v1.8.9# Create and enter project directory
export SHANNON_BASE_DIR=${SHANNON_BASE_DIR:-/data}
sudo mkdir -p $SHANNON_BASE_DIR
cd $SHANNON_BASE_DIR
# Clone PolyAgent project repository
git clone https://github.com/Kocoro-lab/PolyAgent.git
cd $SHANNON_BASE_DIR/PolyAgent/
# Check current directory
pwd
# Expected output: $SHANNON_BASE_DIR/PolyAgent/# Copy environment variables template
cp .env.example .env
# Edit configuration file
vi .envRequired Configuration Items:
# LLM service provider API keys (configure at least one)
OPENAI_API_KEY=sk-your-openai-key-here
ANTHROPIC_API_KEY=your-anthropic-key-here
# Optional: Search service API key
EXA_API_KEY=your-exa-key-here
# Optional: Web search configuration
GOOGLE_API_KEY=your-google-key
GOOGLE_SEARCH_ENGINE_ID=your-search-engine-idSave and exit the editor.
# Step 1: Initialize project environment and basic configuration
make setup-env
# Step 2: Remote server specific setup (install tools + generate proto)
./scripts/setup-remote.sh
# Step 3: Generate cross-language gRPC code
make proto
# Step 4: Start the complete PolyAgent platform
make devService Startup Notes:
- First startup may take 3-5 minutes (downloading Docker images)
- Platform will automatically start 8 docker instances
- Access addresses will be displayed after all services start
# View all running containers
make ps
# Check service health status
curl http://localhost:8081/health # Orchestrator service
# Run end-to-end test verification
make smoke| Service | Port | Description |
|---|---|---|
| Orchestrator | 50052 (gRPC), 8081 (HTTP) | Workflow orchestration service |
| LLM Service | 8000 | LLM provider interface service |
| Agent Core | 50051 (gRPC) | Agent core execution service |
| Temporal UI | 8088 | Workflow management interface |
| PostgreSQL | 5432 | Main database |
| Redis | 6379 | Cache service |
| Qdrant | 6333 | Vector database |
# Use task submission script
./scripts/submit_task.sh "Is the Earth round? How do you prove it? What evidence do you have?"Expected Output Example:
{
"workflowId": "task-00000000-0000-0000-0000-000000000002-1758093116",
"taskId": "task-00000000-0000-0000-0000-000000000002-1758093116",
"status": "STATUS_CODE_OK",
"decomposition": {
"mode": "EXECUTION_MODE_STANDARD",
"complexityScore": 0.5
},
"message": "Task submitted successfully. Session: 40d7e9b5-df1c-462b-9221-cd6df8e6318b"
}# Script will automatically poll task status
Polling status for task: task-00000000-0000-0000-0000-000000000002-1758093116
attempt 1: status=TASK_STATUS_RUNNING
attempt 2: status=TASK_STATUS_RUNNING
...
attempt 10: status=TASK_STATUS_COMPLETED
Done.Seeing "Task submitted successfully" indicates the task was submitted successfully and the system is processing it.
# Access URL
http://your-server-ip:8088Usage Instructions:
- After entering the homepage, click "Workflows"
- View detailed execution flow and status of tasks
- Supports workflow replay and debugging features
# Orchestrator metrics
curl http://localhost:2112/metrics
# Agent core metrics
curl http://localhost:2113/metrics
# LLM service metrics
curl http://localhost:8000/metrics# Stop all services (preserve data)
make down
# Stop services and remove all data volumes
make clean
# View all service logs
make logs
The following are the two most frequently encountered problems during deployment and their solutions:
-
Go Module Build Failure
⚠️ CommonError Symptoms:
=> ERROR [orchestrator builder 7/7] RUN CGO_ENABLED=0 GOOS=linux go build... internal/server/session_service.go:14:5: module github.com/Kocoro-lab/PolyAgent@latest found (v0.0.0-20250829105349-0a1cee10d781), but does not contain package github.com/Kocoro-lab/PolyAgent/go/orchestrator/internal/pb/session failed to solve: process "/bin/sh -c CGO_ENABLED=0 GOOS=linux go build..." did not complete successfully: exit code: 1 make: *** [Makefile:34: dev] Error 17
Solution:
# Regenerate protobuf files make proto # Then restart services make dev
-
Smoke Test Keeps Waiting
Error Symptoms:
make smoke Temporal UI reachable Temporal UI Agent-Core gRPC health healthAgentCore ExecuteTaskagent Wait for orchestrator gRPC (50052) to be ready waiting waiting # Waits multiple times, then errors out
Root Cause: System lacks the
netcattool, which the smoke test script uses to check port connectivitySolution:
# Install netcat tool sudo apt-get update && sudo apt-get install -y netcat-traditional # Re-run test make smoke
Successful Output Example:
[OK] Temporal UI [OK] Agent-Core health [OK] Agent-Core ExecuteTask [OK] Orchestrator gRPC ready [OK] Orchestrator SubmitTask (reflection) [OK] Orchestrator reached terminal status [OK] Orchestrator persistence verified [OK] Metrics endpoints reachable [OK] LLM ready [OK] LLM health endpoints [OK] MCP tool registered [OK] MCP tool executed [OK] Qdrant collections present [OK] Postgres query All smoke checks passed
-
Service Startup Failure
# Check Docker status systemctl status docker # Restart Docker service (if needed) sudo systemctl restart docker
-
Port Conflicts
# Check port usage netstat -tulpn | grep :8081 # Stop conflicting process or modify configuration
-
API Key Issues
# Verify environment variable loading docker compose config | grep -i api_key # Reconfigure .env file vi .env
-
Insufficient Memory
# Check system resources free -h df -h # Clean Docker resources docker system prune -f
Note: Ensure your Ubuntu system has at least 8GB of memory and 20GB of available disk space for optimal performance.