Installation Guide
Detailed installation instructions for different environments.
Docker Installation (Recommended)
Prerequisites
- Docker 20.10+
- Docker Compose 2.0+
Steps
- Clone the repository:
bash
git clone https://github.com/zjxzjw/Carrot-Agent.git
cd carrot-agent- Create environment file:
bash
cp .env.example .envEdit
.envand add your API keyStart the service:
bash
docker-compose up -d- Verify:
bash
curl http://localhost:8080/healthLocal Installation
Prerequisites
- Go 1.22+
- GCC (for go-sqlite3)
- Node.js 18+ (for web UI)
Build from Source
bash
# Clone repository
git clone https://github.com/zjxzjw/Carrot-Agent.git
cd carrot-agent
# Build backend
make build
# Build frontend
cd ui
npm install
npm run build
# Run API server
./bin/carrot-agent-apiKubernetes Deployment
Create deployment.yaml:
yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: carrot-agent
spec:
replicas: 1
selector:
matchLabels:
app: carrot-agent
template:
metadata:
labels:
app: carrot-agent
spec:
containers:
- name: carrot-agent
image: carrotagent/carrot-agent:latest
ports:
- containerPort: 8080
env:
- name: CARROT_API_KEY
valueFrom:
secretKeyRef:
name: carrot-secrets
key: api-key
volumeMounts:
- name: data
mountPath: /home/carrot/.carrot
volumes:
- name: data
persistentVolumeClaim:
claimName: carrot-data-pvcConfiguration
See Configuration Guide for detailed options.
Verification
After installation, test the API:
bash
# Health check
curl http://localhost:8080/health
# Test chat
curl -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "Hello!", "session_id": "test"}'