A production-ready AI Agent Operating System with mobile-optimized web interface. Deploy your own swarm of AI agents that can process complex tasks through simple smartphone inputs.
- Planner Agent: Breaks down complex tasks
- Researcher Agent: Web search and information gathering
- Analyst Agent: Data analysis and insights
- Writer Agent: Content creation and summarization
- General Agent: Handles miscellaneous tasks
- Progressive Web App (PWA) support
- Touch-optimized controls
- Offline capability
- Real-time updates via WebSocket
- Speech-to-text input support
- Docker & Kubernetes ready
- PostgreSQL + Redis + Vector DB
- Monitoring with Prometheus/Grafana
- API rate limiting
- Automated backups
- Health checks
- JWT authentication
- Input sanitization
- Rate limiting
- Audit logging
- Sandboxed execution
- Privacy-first design
- Docker & Docker Compose
- Python 3.11+
- Node.js 18+
- PostgreSQL 14+
- Redis 7+
# Clone the repository
git clone https://github.com/yourusername/agent-os.git
cd agent-os
# Copy environment file
cp .env.example .env
# Edit .env with your settings
# Start with Docker Compose
docker-compose up -d
# Access the application
# Web Interface: http://localhost:3000
# API Docs: http://localhost:8000/api/docs
# Grafana: http://localhost:3001 (admin/admin)Option 2: Manual Installation
# Backend
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env file
# Initialize database
alembic upgrade head
# Start backend
uvicorn src.api.main:app --reload --host 0.0.0.0 --port 8000
# Frontend (in another terminal)
cd frontend
npm install
npm startπ± Mobile Usage
PWA Installation
- Open the web interface on your smartphone
- Tap "Share" button
- Select "Add to Home Screen"
- The app will install like a native application
Features for Mobile
Β· Voice Input: Tap microphone icon to speak tasks Β· Camera Upload: Attach photos/documents Β· Offline Mode: Queue tasks when offline Β· Push Notifications: Get task completion alerts Β· Gesture Controls: Swipe to navigate
Example Mobile Tasks
π "Write a professional email to schedule a meeting"
π "Research best practices for remote team management"
π "Analyze these sales numbers from the uploaded spreadsheet"
βοΈ "Create a social media post for our new product launch"
π "Summarize this long article into key points"
ποΈ Architecture
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Mobile Web β β FastAPI API β β PostgreSQL β
β Interface βββββΊβ Layer βββββΊβ Database β
β (React PWA) β β (Python) β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β WebSocket β β Agent β β Redis Cache β
β Real-time β β Orchestrator β β β
β Updates β β (Core) β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Vector DB β β External β β Monitoring β
β (Chroma) β β APIs β β (Prometheus) β
β β β (OpenAI, etc) β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
π§ Configuration
Environment Variables
Create a .env file in the backend directory:
# Database
DATABASE_URL=postgresql+asyncpg://user:password@localhost:5432/agentos
REDIS_URL=redis://localhost:6379
# Security
SECRET_KEY=your-secret-key-here
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=1440
# External APIs
OPENAI_API_KEY=your-openai-key
SERPAPI_KEY=your-serpapi-key
# Email (Optional)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password
# Monitoring
PROMETHEUS_PORT=9090
GRAFANA_PORT=3001Agent Configuration
Edit backend/src/config/agents.yaml:
agents:
planner:
enabled: true
model: gpt-4
max_tokens: 1000
researcher:
enabled: true
max_results: 5
sources: ["web", "arxiv", "news"]
analyst:
enabled: true
tools: ["pandas", "numpy", "statistics"]
writer:
enabled: true
style: "professional"
languages: ["en", "de", "fr"]π Monitoring & Metrics
The system includes comprehensive monitoring:
Β· Prometheus: Collects metrics from all services Β· Grafana: Dashboard for visualization Β· Health Checks: Automatic service monitoring Β· Performance Metrics: Response times, error rates Β· Business Metrics: Tasks processed, user activity
Access dashboards:
Β· Grafana: http://localhost:3001 (admin/admin) Β· Prometheus: http://localhost:9090
π API Usage
Authentication
# Register
curl -X POST http://localhost:8000/api/register \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"password","name":"John Doe"}'
# Login
curl -X POST http://localhost:8000/api/login \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"password"}'
# Use token in subsequent requests
curl -H "Authorization: Bearer <token>" http://localhost:8000/api/tasksSubmit a Task
import requests
import json
token = "your-jwt-token"
headers = {"Authorization": f"Bearer {token}"}
task = {
"input_text": "Research renewable energy trends in 2024",
"priority": "high",
"metadata": {
"category": "research",
"deadline": "2024-12-31"
}
}
response = requests.post(
"http://localhost:8000/api/tasks",
headers=headers,
json=task
)
print(response.json())
# {"task_id": "uuid", "status": "accepted", "message": "Task submitted"}WebSocket Updates
const ws = new WebSocket(`ws://localhost:8000/ws/mobile_1?token=${token}`);
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'task_update') {
console.log('Task update:', data.status);
}
};
// Subscribe to task updates
ws.send(JSON.stringify({
type: 'subscribe_task',
task_id: 'your-task-id'
}));π§ͺ Testing
Run Tests
# Backend tests
cd backend
pytest tests/ -v
# Frontend tests
cd frontend
npm test
# Integration tests
docker-compose -f docker-compose.test.yml upLoad Testing
# Install k6
brew install k6
# Run load test
k6 run tests/load_test.jsπ Deployment
AWS ECS
# Build and push Docker images
docker build -t your-ecr-repo/agent-os-backend:latest ./backend
docker push your-ecr-repo/agent-os-backend:latest
# Deploy with Terraform
cd terraform
terraform init
terraform applyKubernetes
# Apply Kubernetes manifests
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/configmap.yaml
kubectl apply -f k8s/secrets.yaml
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl apply -f k8s/ingress.yamlServerless (AWS Lambda)
# Package for Lambda
cd backend
pip install -r requirements.txt -t ./package
cd package
zip -r ../lambda_deployment.zip .
# Deploy with SAM
sam deploy --guidedπ€ Contributing
- Fork the repository
- Create a feature branch (git checkout -b feature/amazing-feature)
- Commit changes (git commit -m 'Add amazing feature')
- Push to branch (git push origin feature/amazing-feature)
- Open a Pull Request
Development Guidelines
Β· Follow PEP 8 for Python code Β· Use TypeScript for frontend Β· Write tests for new features Β· Update documentation Β· Use conventional commits
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
Β· Built with FastAPI, React, and PostgreSQL Β· Uses OpenAI's GPT models for AI capabilities Β· Inspired by AutoGPT and LangChain Β· Icons by Lucide React Β· UI components with Tailwind CSS
π Support
Β· π Documentation Β· π Issue Tracker Β· π¬ Discord Community Β· π§ Email Support