Skip to content

Mobile-first AI Agent Operating System with web interface for smartphones. Deploy your own swarm of AI agents accessible through any browser - no app install required.

License

Notifications You must be signed in to change notification settings

Napiersnotes/agent-os-mobile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Agent OS - Mobile First AI Agent Platform

License: MIT Python 3.11 React FastAPI

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.

πŸš€ Features

πŸ€– Multi-Agent Architecture

  • 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

πŸ“± Mobile-First Interface

  • Progressive Web App (PWA) support
  • Touch-optimized controls
  • Offline capability
  • Real-time updates via WebSocket
  • Speech-to-text input support

πŸ—οΈ Production Ready

  • Docker & Kubernetes ready
  • PostgreSQL + Redis + Vector DB
  • Monitoring with Prometheus/Grafana
  • API rate limiting
  • Automated backups
  • Health checks

πŸ”’ Security Features

  • JWT authentication
  • Input sanitization
  • Rate limiting
  • Audit logging
  • Sandboxed execution
  • Privacy-first design

πŸ“‹ Quick Start

Prerequisites

  • Docker & Docker Compose
  • Python 3.11+
  • Node.js 18+
  • PostgreSQL 14+
  • Redis 7+

Option 1: Docker (Recommended)

# 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

  1. Open the web interface on your smartphone
  2. Tap "Share" button
  3. Select "Add to Home Screen"
  4. 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=3001

Agent 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/tasks

Submit 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 up

Load 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 apply

Kubernetes

# 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.yaml

Serverless (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

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. 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


Made with ❀️ by the Agent OS Team (So, from me, 1 employee πŸ€·πŸ»β€β™‚οΈ)
```

About

Mobile-first AI Agent Operating System with web interface for smartphones. Deploy your own swarm of AI agents accessible through any browser - no app install required.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published