Skip to content

SimbaKingjoe/Xgent

Repository files navigation

Xgent-Go

πŸš€ High-Performance AI Agent Orchestration Platform

Features β€’ Quick Start β€’ Architecture β€’ Documentation β€’ Contributing

Go Version License PRs Welcome


Xgent-Go is an enterprise-grade AI Agent orchestration platform built with pure Golang. It provides a complete solution for defining, organizing, and running intelligent agent teams with a Kubernetes-inspired CRD (Custom Resource Definition) design.

✨ Features

  • πŸš€ Pure Golang - High performance, low memory footprint, single binary deployment
  • 🎨 CRD Resource System - Kubernetes-style declarative configuration for agents
  • πŸ€– Multi-Agent Orchestration - Support for Coordinate, Collaborate, and Route collaboration modes
  • πŸ”§ Extensible Executors - Built-in Agno executor with Python bridge, extensible for other engines
  • 🐳 Docker Sandbox - Isolated execution environment with resource limits
  • πŸ” Enterprise Features - User authentication, multi-tenancy, access control
  • πŸ“Š Real-time Monitoring - WebSocket-based task progress and log streaming
  • πŸ”— Git Integration - Deep integration with GitHub/GitLab

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Frontend (Next.js)                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚ HTTP/WebSocket
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Backend API (Gin)                         β”‚
β”‚   Routes β€’ Middlewares β€’ WebSocket Streaming                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 Task Orchestrator                            β”‚
β”‚   Task Queue β€’ Worker Pool β€’ State Management                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 CRD Resource Manager                         β”‚
β”‚   YAML Parser β€’ Validator β€’ Ghost/Model/Shell/Bot/Team       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 Executor Layer                               β”‚
β”‚   Agno Executor (Python Bridge) β€’ Docker Executor            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Storage Layer                             β”‚
β”‚   MySQL/PostgreSQL (GORM) β€’ Redis (Cache) β€’ MinIO/S3        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

  • Go 1.21+
  • Node.js 18+ (for frontend)
  • MySQL 8.0+
  • Python 3.10+ (for Agno executor)
  • Redis (optional)

Installation

# Clone the repository
git clone https://github.com/xcode-ai/xgent-go.git
cd xgent-go

# Install Go dependencies
make deps

# Install Python dependencies (for Agno executor)
pip install agno openai anthropic

# Install frontend dependencies
cd web && npm install && cd ..

Configuration

# Copy example config
cp configs/config.yaml configs/config.local.yaml

# Edit config with your settings
vim configs/config.local.yaml

Required environment variables:

export DB_PASSWORD=your_database_password
export OPENAI_API_KEY=your_openai_key        # Optional
export ANTHROPIC_API_KEY=your_anthropic_key  # Optional

Running

# Start MySQL (if using Docker)
docker-compose up -d mysql

# Start the API server
make run-server

# In another terminal, start the frontend
cd web && npm run dev

Access

Service URL
API Server http://localhost:8080
Health Check http://localhost:8080/health
Web UI http://localhost:3001

πŸ“– Core Concepts

CRD Resource Types

Resource Description
Soul Agent personality and system prompt
Mind LLM configuration (OpenAI/Claude/Gemini)
Craft Tools and capabilities (MCP Tools)
Robot Agent instance (Soul + Mind + Craft)
Team Multi-agent collaboration group

Collaboration Modes

  • Coordinate - Leader assigns tasks to specific members
  • Collaborate - All members work in parallel
  • Route - Select the most suitable member for execution

Example: Creating a Robot

# resources/examples/my-robot.yaml
apiVersion: xgent.ai/v1
kind: Robot
metadata:
  name: code-reviewer
  description: Expert code reviewer
spec:
  soul: code-review-expert
  mind: gpt-4
  craft: coding-tools

πŸ“ Project Structure

xgent-go/
β”œβ”€β”€ cmd/
β”‚   β”œβ”€β”€ server/          # API server
β”‚   β”œβ”€β”€ worker/          # Task executor
β”‚   └── cli/             # CLI tool
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ api/             # API routes and handlers
β”‚   β”œβ”€β”€ orchestrator/    # Task scheduling
β”‚   β”œβ”€β”€ crd/             # CRD resource system
β”‚   β”œβ”€β”€ executor/        # Execution engines
β”‚   β”œβ”€β”€ storage/         # Database layer
β”‚   └── git/             # Git integration
β”œβ”€β”€ pkg/                 # Public packages
β”œβ”€β”€ configs/             # Configuration files
β”œβ”€β”€ resources/           # CRD resource definitions
β”œβ”€β”€ scripts/             # Utility scripts
β”œβ”€β”€ web/                 # Frontend (Next.js)
β”œβ”€β”€ Makefile
└── docker-compose.yml

πŸ”§ Development

Build

# Build all binaries
make build

# Build specific components
make build-server
make build-worker
make build-cli

Test

# Run all tests
make test

# Run with coverage
make test-coverage

Docker

# Build Docker image
docker build -t xgent-go:latest .

# Run with Docker Compose
docker-compose up -d

🀝 Contributing

Contributions are welcome! Please read our Contributing Guide before submitting a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Agno - AI Agent framework
  • Gin - HTTP web framework
  • GORM - ORM library for Go

Made with ❀️ by the Xgent Team

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published