_ _ __ __
/ \ __ _ ___ _ __ | |_ \ \/ /
/ _ \ / _` |/ _ \ '_ \| __| _____ \ /
/ ___ \ (_| | __/ | | | |_ |_____| / \
/_/ \_\__, |\___|_| |_|\__| /_/\_\
|___/
Features: Vision, research, reasoning, computer use, and code execution
Navigation: Quick Start β’ Features β’ Documentation β’ Contributing
- π¨ Modern Web UI - React 19 chat interface with real-time streaming
- π Real-Time Streaming - Token-by-token, tool execution, and status updates via WebSocket/SSE
- π€ Multi-Modal AI - Vision, research, reasoning, and code execution
- π Universal Provider Support - Anthropic, OpenAI, Google, Ollama, vLLM, HuggingFace + more
- π³ Docker First - Complete containerized deployment with hot-reload
- β‘ Fast & Scalable - Built with FastAPI, async patterns, and streaming
- π‘οΈ Production Ready - Health checks, monitoring, logging, and rate limiting
- π§ Extensible - Plugin architecture for capabilities and providers
Get started with the web UI in 3 commands:
# 1. Setup environment
./agentx.sh setup
# 2. Start all services
./agentx.sh docker:up
# 3. Open your browser
open http://localhost:8080Access Points:
- π Web UI: http://localhost:8080
- π API: http://localhost:8000
- π API Docs: http://localhost:8000/docs
# Interactive mode
./agentx.sh run
# Single command
./agentx.sh run "analyze this image: photo.png"
# Start API only
./agentx.sh api:start# Start everything
docker-compose up -d
# Start with dev mode (hot-reload)
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
# View logs
docker-compose logs -f
# Stop services
docker-compose down| Service | Port | Description |
|---|---|---|
| Web Client | 8080* | React 19 + TypeScript UI with real-time streaming |
| API Server | 8000* | FastAPI backend with WebSocket/SSE support |
| PostgreSQL | 5432* | Primary database for persistence |
| Redis | 6379* | Caching, sessions, and rate limiting |
| Nginx | 80/443 | Reverse proxy (optional, production) |
* Ports auto-resolve if conflicts detected
- πΌοΈ Vision - Image analysis and understanding
- π Research - Web search and information gathering
- π» Code Execution - Safe sandboxed execution
- π±οΈ Computer Use - Browser automation
- π§ Function Calling - Custom tool integration
- π§ Reasoning - Complex problem solving
Agent-X supports 7+ LLM providers with universal streaming:
| Provider | Models | Streaming | Vision | Tools |
|---|---|---|---|---|
| Anthropic | Claude 4 (Opus/Sonnet/Haiku), Claude 3.5 | β Native | β | β |
| OpenAI | GPT-4, GPT-4 Turbo, GPT-3.5, O1 | β Native | β | β |
| Gemini Pro, Ultra, Flash, 1.5 | β Native | β | β | |
| Ollama | Llama 2/3, Mistral, Mixtral, CodeLlama, Phi | β Native | β | β |
| vLLM | Self-hosted models | β Native | ||
| HuggingFace | Any HF model | β Fallback | ||
| Local | Legacy local models | β Fallback | β | β |
All providers support streaming through intelligent fallback mechanisms!
The agentx.sh script is your one-stop interface for everything:
./agentx.sh help # Show all commands# Setup & Environment
./agentx.sh setup # Set up development environment
./agentx.sh env # Show environment info
# Running Services
./agentx.sh run # Run agent interactively
./agentx.sh api:start # Start API server
./agentx.sh client:start # Start web client
./agentx.sh docker:up # Start all services
# Development
./agentx.sh client:dev # Client with hot-reload
./agentx.sh test # Run tests
./agentx.sh format # Format code
./agentx.sh lint # Lint code
# Docker Management
./agentx.sh docker:build # Build all images
./agentx.sh docker:logs # View logs
./agentx.sh docker:down # Stop services
./agentx.sh docker:clean # Clean up
# Database
./agentx.sh db:migrate # Run migrations
./agentx.sh db:shell # Open DB shellSee QUICKSTART.md for detailed guide.
Agent-X includes an automatic port conflict resolver that ensures smooth startup on any system:
# Automatically finds available ports when starting
./agentx.sh docker:upThe port resolver runs automatically before Docker operations:
- π Detects Conflicts - Scans default ports (5432, 6379, 8000, 8080)
- π Finds Alternatives - If a port is in use, finds the next available one
- β‘ Updates Config - Automatically updates
docker-compose.override.yml - πΎ Caches Results - Remembers port allocations for fast subsequent starts
- β¨ Transparent - All services communicate correctly with remapped ports
- β‘ Fast caching - Reuses ports from previous sessions
- π‘οΈ Safe cleanup - Stops old Agent-X containers if needed
- π§ Auto-configuration - Updates
.envand Docker config automatically - π― Smart fallback - Works even if detection tools aren't available
# Check port availability
./agentx.sh check-ports
# Force re-resolve ports
rm .ports && ./agentx.sh docker:upAccess URLs adapt automatically:
- If
8080is busy β Client might start on8081 - If
8000is busy β API might start on8001 - Check
.portsfile for your actual URLs!
ββββββββββββββββ
β Browser β
ββββββββ¬ββββββββ
β :8080 (auto-resolved)
ββββββΌββββββββββ
β agent-client β (React 19 + TypeScript)
β β WebSocket/SSE streaming
ββββββ¬ββββββββββ
β REST/WebSocket
ββββββΌββββββββββ
β agent-api β (FastAPI + Async)
β β Universal provider support
ββββββ¬ββββββββββ
β
ββββββ΄βββββ¬βββββββββ¬ββββββββββ¬βββββββββββ
β β β β β
βββΌβββ ββββΌβββ ββββΌββββ ββββΌββββ ββββΌβββββ
βCoreβ β DB β βRedis β βCache β βVector β
ββββββ βββββββ ββββββββ ββββββββ βββββββββ
- Orchestrator - ReAct pattern coordinator (Reason β Act β Observe)
- LLM Abstraction - Model-agnostic provider layer
- State Manager - Conversation & context tracking
- Decision Engine - Request routing & capability selection
- Capabilities - Specialized, pluggable modules
- π QUICKSTART.md - Quick start guide
- π³ DOCKER.md - Docker documentation
- π» client/README.md - Web client docs
- π§ CLAUDE.md - Development with Claude Code
- π docs/ - Full documentation
- Python 3.11+
- Docker & Docker Compose
- Conda or Poetry (for local Python development)
- Node.js 18+ & npm (for client development)
# Clone repository
git clone <repository-url>
cd agent-x
# Setup environment
./agentx.sh setup
# Configure API keys
cp .env.example .env
# Edit .env with your keys
# Start services
./agentx.sh docker:up# Start everything with hot-reload
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
# Or start individual services
./agentx.sh api:dev # API with auto-reload
./agentx.sh client:dev # Client with hot-reload# All tests
./agentx.sh test
# By type
./agentx.sh test:unit
./agentx.sh test:integration
./agentx.sh test:e2e
# With coverage
./agentx.sh test:cov
# Specific file
./agentx.sh test tests/unit/test_orchestrator.py# Format code
./agentx.sh format
# Lint
./agentx.sh lint
# Type check
./agentx.sh type
# Run all checks
./agentx.sh check# LLM Provider API Keys (at least one required)
ANTHROPIC_API_KEY=your_key_here
OPENAI_API_KEY=your_key_here
GOOGLE_API_KEY=your_key_here
HUGGINGFACE_API_KEY=your_key_here
# Default Provider & Model
DEFAULT_PROVIDER=anthropic
DEFAULT_MODEL=claude-sonnet-4
# Agent Behavior
MAX_ITERATIONS=10
TIMEOUT=300
ENABLE_MEMORY=true
MAX_HISTORY_LENGTH=100
# Streaming Configuration
ENABLE_STREAMING=false # Master switch for streaming features
# When enabled, provides:
# - Token-by-token streaming
# - Tool execution events
# - Status updates
# - Optional thinking process
# Service URLs (auto-resolved if ports conflict)
API_URL=http://localhost:8000
CLIENT_URL=http://localhost:8080
# Database (port auto-resolves)
DATABASE_URL=postgresql://agentx:password@localhost:5432/agentx
# Redis (port auto-resolves)
REDIS_URL=redis://localhost:6379/0
# Rate Limiting (disabled by default for development)
ENABLE_RATE_LIMITING=false
RATE_LIMIT_REQUESTS_PER_MINUTE=1000
RATE_LIMIT_TOKENS_PER_MINUTE=2000000
# Cost Controls
COST_TRACKING_ENABLED=true
MAX_COST_PER_REQUEST=1.0
MAX_COST_PER_DAY=100.0Edit docker-compose.yml or docker-compose.dev.yml:
services:
agent-api:
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- WORKERS=4
- DEBUG=trueagent-x/
βββ agentx.sh # Master control script
βββ scripts/ # Utility scripts
β βββ port-resolver.sh # Auto port conflict resolution
β βββ resolve-ports.sh # Manual port resolver
βββ client/ # Web UI (React 19 + TypeScript + Vite)
β βββ src/
β β βββ components/ # React UI components
β β βββ stores/ # Zustand state management
β β βββ api/ # API client & WebSocket
β β βββ hooks/ # Custom React hooks
β βββ vite.config.ts # Vite config with proxy
β βββ Dockerfile # Client container
βββ core/ # Core orchestrator & engine
β βββ orchestrator.py # Main ReAct loop with streaming
β βββ agent-x.py # High-level AgentX API
β βββ state_manager.py # State & conversation management
β βββ decision_engine.py # Request routing
β βββ scheduler.py # Task scheduling
βββ llm/ # LLM provider abstraction
β βββ base_provider.py # Base provider with streaming
β βββ anthropic_provider.py # Claude provider
β βββ openai_provider.py # OpenAI provider
β βββ google_provider.py # Gemini provider
β βββ ollama_provider.py # Ollama provider
β βββ vllm_provider.py # vLLM provider
β βββ hf_provider.py # HuggingFace provider
β βββ factory.py # Provider factory
β βββ model_manager.py # Model management
βββ capabilities/ # Capability modules
β βββ vision/ # Vision capability
β βββ research/ # Research capability
β βββ code_execution/ # Code execution
β βββ manager.py # Capability manager
β βββ base_capability.py # Base interface
βββ api/ # FastAPI server
β βββ app.py # Main API app
β βββ routes.py # REST API routes
β βββ streaming.py # SSE streaming endpoints
β βββ websocket.py # WebSocket handler
β βββ schemas.py # Pydantic models
β βββ middleware.py # API middleware
βββ config/ # Configuration
β βββ settings.py # Settings with streaming config
β βββ llm.py # LLM configurations
βββ safety/ # Safety & rate limiting
β βββ rate_limiter.py # Rate limiting
β βββ checker.py # Safety checks
βββ storage/ # Persistence layer
β βββ database.py # Database management
β βββ cache.py # Redis caching
βββ memory/ # Memory systems
β βββ conversation.py # Short-term memory
β βββ long_term.py # Vector store
βββ evaluation/ # Evaluation & benchmarking
β βββ evaluator.py # Task evaluator
β βββ llm_judge.py # LLM-based evaluation
βββ tests/ # Test suite
β βββ unit/ # Unit tests
β βββ integration/ # Integration tests
β βββ e2e/ # End-to-end tests
βββ docs/ # Documentation
βββ docker-compose.yml # Production compose
βββ docker-compose.dev.yml # Development compose
βββ Dockerfile # Main Python container
# Send message
curl -X POST http://localhost:8000/api/v1/agent/run \
-H "Content-Type: application/json" \
-d '{
"message": "Analyze this image",
"model": "claude-sonnet-4",
"context": {}
}'# Stream response with SSE
curl -N -X POST http://localhost:8000/api/v1/stream/agent \
-H "Content-Type: application/json" \
-d '{
"message": "Tell me a story",
"stream_tokens": true,
"stream_thinking": false
}'// Connect to WebSocket endpoint
const ws = new WebSocket('ws://localhost:8000/api/v1/ws/agent');
// Send message
ws.send(JSON.stringify({
message: "Hello, Agent-X!",
session_id: "my-session",
model: "claude-sonnet-4"
}));
// Receive streaming updates
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
switch(data.type) {
case 'token':
process.stdout.write(data.content.token);
break;
case 'tool_call':
console.log(`\nTool: ${data.content.tool_name}`);
break;
case 'status':
console.log(`Status: ${data.content.status}`);
break;
case 'complete':
console.log('\nDone!');
break;
}
};from core.agent_x import AgentX
# Initialize agent
agent = AgentX(streaming=True)
# Streaming with callbacks
def on_token(token):
print(token, end="", flush=True)
def on_tool(tool_name, params, result):
if result:
print(f"\nβ Tool {tool_name} completed")
# Stream with callbacks
for chunk in agent.stream(
"Explain quantum computing",
on_token=on_token,
on_tool=on_tool
):
if chunk["done"]:
print(f"\nMetadata: {chunk['metadata']}")Agent-X provides real-time streaming for all providers:
- Token Streaming - Token-by-token output as it's generated
- Tool Execution - Real-time notifications when tools are called
- Status Updates - Progress indicators during long operations
- Thinking Process - Optional agent reasoning visibility
- Universal Support - Works with ALL 7+ providers (native or fallback)
Streaming Protocols:
- π WebSocket - Full bidirectional communication
- π‘ SSE - Server-Sent Events for one-way streaming
- π Fallback - Automatic provider fallback for universal compatibility
# Build production images
./agentx.sh docker:build
# Start with production profile
docker-compose --profile production up -d
# Enable nginx reverse proxy
docker-compose --profile production up nginx# Required
ANTHROPIC_API_KEY=sk-...
DATABASE_URL=postgresql://...
REDIS_URL=redis://...
# Recommended
API_WORKERS=4
LOG_LEVEL=INFO
CORS_ORIGINS=https://yourdomain.com
SSL_CERT_PATH=/etc/ssl/cert.pem
SSL_KEY_PATH=/etc/ssl/key.pem# Check Docker
docker info
# Check for port conflicts
lsof -i :8000 # API
lsof -i :8080 # Client
# Clean and rebuild
./agentx.sh docker:clean
./agentx.sh docker:build
./agentx.sh docker:up# Check API is running
curl http://localhost:8000/health
# Check client environment
docker-compose exec agent-client env | grep API_URL
# Check logs
./agentx.sh api:logs
./agentx.sh client:logs# Reset database
./agentx.sh db:reset
# Run migrations
./agentx.sh db:migrate
# Check connection
docker-compose exec postgres psql -U agentx -d agentxSee QUICKSTART.md for more solutions.
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Test your changes (
./agentx.sh check && ./agentx.sh test) - Commit (
git commit -m 'Add amazing feature') - Push (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow the code style (use
./agentx.sh format) - Add tests for new features
- Update documentation
- Ensure all checks pass
See CLAUDE.md for detailed development guidelines.
[Your License Here]
- Issues: GitHub Issues
- Documentation: Run
./agentx.sh help - Quick Start: QUICKSTART.md
- Development: CLAUDE.md
- Built with Anthropic Claude
- Powered by FastAPI
- UI built with React and Vite
- Streaming support inspired by modern real-time architectures
- Universal Provider Support - 7+ LLM providers with automatic fallback
- Real-Time Streaming - WebSocket and SSE with token-by-token output
- Intelligent Port Resolution - Zero-config startup on any system
- Docker-First Design - Complete containerization with hot-reload
- Modern Web UI - React 19 with real-time streaming interface
- Rate Limiting - Token and request-based rate limiting with Redis
- Cost Tracking - Per-request, daily, and monthly cost controls
- Health Checks - Comprehensive monitoring and diagnostics
- Database Persistence - PostgreSQL with automatic migrations
- Vector Store - Long-term memory with Chroma
- Caching - Redis-based caching for performance
- Master Control Script (
agentx.sh) - One command for everything - Hot-Reload - Auto-reload for API and client during development
- Comprehensive Tests - Unit, integration, and E2E test suites
- Type Safety - Full type hints and mypy checking
- Code Quality - Black, isort, ruff, and pre-commit hooks
- REST API - Full-featured HTTP API
- WebSocket - Real-time bidirectional communication
- SSE Streaming - Server-Sent Events for one-way streaming
- Python SDK - High-level AgentX class with streaming support
- OpenAPI Docs - Auto-generated API documentation
Current version: 0.1.0
./agentx.sh version- Enhanced multi-modal capabilities (audio, video)
- Advanced reasoning modes (chain-of-thought, tree-of-thought)
- Distributed execution for parallel tool use
- Plugin marketplace for custom capabilities
- Cloud deployment templates (AWS, GCP, Azure)
- Enterprise SSO and RBAC
Made with β€οΈ by the Agent-X Team