Comprehensive technical architecture documentation for AutoBot enterprise AI platform.
AutoBot is a functional enterprise AI platform built with a modern microservices architecture. The system has evolved through 4 major development phases to achieve full capabilities.
graph TB
subgraph "Frontend Layer"
UI[Vue 3 UI<br/>TypeScript + Vite]
Dashboard[Real-time Dashboard<br/>Health Monitoring]
KnowledgeUI[Knowledge Manager<br/>Template System]
end
subgraph "API Gateway"
FastAPI[FastAPI Backend<br/>Python 3.14+]
WebSocket[WebSocket Support<br/>Real-time Updates]
HealthAPI[Health Check API<br/>System Monitoring]
end
subgraph "Core Services"
Orchestrator[Task Orchestrator<br/>Redis-backed]
LLMInterface[Multi-LLM Interface<br/>Ollama/OpenAI/Anthropic]
KnowledgeBase[Knowledge System<br/>ChromaDB + SQLite]
WorkerNode[Task Execution<br/>Background Workers]
end
subgraph "Data Layer"
Redis[(Redis Stack<br/>Tasks + Cache)]
ChromaDB[(ChromaDB<br/>Vector Store)]
SQLite[(SQLite<br/>Knowledge Base)]
FileSystem[(File System<br/>Chat History)]
end
subgraph "External Integrations"
Ollama[Ollama Server<br/>Local LLMs]
OpenAI[OpenAI API<br/>Cloud LLMs]
Anthropic[Anthropic API<br/>Claude Models]
end
UI --> FastAPI
Dashboard --> HealthAPI
KnowledgeUI --> FastAPI
FastAPI --> Orchestrator
FastAPI --> LLMInterface
FastAPI --> KnowledgeBase
Orchestrator --> WorkerNode
Orchestrator --> Redis
LLMInterface --> Ollama
LLMInterface --> OpenAI
LLMInterface --> Anthropic
KnowledgeBase --> ChromaDB
KnowledgeBase --> SQLite
WorkerNode --> FileSystem
Location: autobot-frontend/
Key Features:
- Modern Vue 3 with Composition API and TypeScript
- Real-time system health monitoring with 15-second intervals
- Advanced Knowledge Manager with 4 professional templates
- Glass-morphism design with responsive mobile-first approach
- Real-time WebSocket communication for live updates
Core Components:
SystemHealth.vue: Real-time monitoring dashboardKnowledgeManager.vue: Template-based knowledge entry systemChatInterface.vue: Main chat interaction componentTemplateGallery.vue: Visual template selection interface
Location: backend/
Architecture:
backend/
├── app_factory.py # Application factory pattern
├── api/ # API endpoint modules
│ ├── system.py # Health monitoring endpoints
│ ├── knowledge.py # Knowledge base operations
│ ├── llm.py # LLM management endpoints
│ ├── chat.py # Chat interaction endpoints
│ ├── agent.py # Agent control endpoints
│ └── websockets.py # Real-time communication
├── services/ # Business logic layer
├── models/ # Data models and schemas
└── utils/ # Utility functions
Key Features:
- 6/6 major API endpoints operational (100% coverage)
- Comprehensive health monitoring with detailed metrics
- WebSocket support for real-time updates
- Automated API documentation with OpenAPI/Swagger
- Production-ready error handling and logging
Location: src/orchestrator.py
Capabilities:
- Redis-backed autonomous task execution
- Advanced task planning with dependency management
- Background processing with job queues
- Task state management and persistence
- Dynamic task scaling and load balancing
Location: src/llm_interface.py
Supported Providers:
- Ollama: Local inference (tinyllama, phi, llama2, etc.)
- OpenAI: GPT-3.5, GPT-4, GPT-4 Turbo
- Anthropic: Claude 3 Sonnet, Claude 3 Haiku
- HuggingFace: Local transformer models
Features:
- Dynamic model discovery and health checking
- Automatic failover between providers
- Model-specific parameter optimization
- Token usage tracking and cost management
Location: src/knowledge_base.py
Architecture:
- ChromaDB: Vector embeddings for semantic search
- SQLite: Structured knowledge storage with metadata
- RAG Pipeline: Retrieval-Augmented Generation
- Template System: 4 professional knowledge entry templates
Templates:
- Research Article: Academic and technical documentation
- Meeting Notes: Structured meeting documentation
- Bug Report: Technical issue tracking and resolution
- Learning Notes: Educational content and tutorials
Location: src/worker_node.py
Capabilities:
- Background task execution with queue management
- System command execution with security controls
- File system operations with permission management
- GUI automation with OCR and window management
- Robust error handling and retry mechanisms
Collections:
├── knowledge_entries # Vectorized knowledge base content
├── chat_history # Conversation embeddings
└── document_chunks # Large document processing
Tables:
├── knowledge_entries # Structured knowledge metadata
├── templates # Knowledge entry templates
├── system_metrics # Health monitoring data
├── user_preferences # Configuration settings
└── audit_logs # Security and operation logsData Structures:
├── task_queue # Background job processing
├── system_cache # Performance optimization
├── session_store # User session management
├── real_time_metrics # Live system monitoring
└── worker_locks # Distributed task coordination
data/
├── chats/ # JSON chat history files
├── chromadb/ # Vector database storage
├── messages/ # System message logs
├── file_manager_root/ # Uploaded file storage
└── knowledge_base.db # SQLite database file
logs/
├── autobot.log # Application logs
├── llm_usage.log # LLM interaction logs
├── security.log # Security event logs
└── performance.log # Performance metrics
config/
├── config.yaml # Main configuration
└── settings.json # Runtime user settings
- Input Validation: All user inputs sanitized and validated
- Command Filtering: System commands filtered through security layer
- File Access Control: Restricted file system access with permissions
- API Security: Rate limiting, authentication, and CORS protection
- Data Encryption: Sensitive data encrypted at rest and in transit
Location: src/security_layer.py
Features:
- Command whitelist/blacklist filtering
- File system access restrictions
- API key encryption and secure storage
- Audit logging for compliance
- Session management and timeout controls
Location: src/diagnostics.py
Metrics Tracked:
- System Resources: CPU, memory, disk usage
- Service Health: Backend, Redis, LLM providers
- Database Status: ChromaDB, SQLite connection health
- API Performance: Response times, error rates
- Task Queue Status: Job counts, processing rates
Features:
- 15-second refresh intervals for live monitoring
- Trend indicators for system metrics
- Color-coded health status indicators
- Detailed service status descriptions
- Alert system for critical issues
- Modular Design: Clear separation of concerns
- Configuration-Driven: All settings externalized
- Data Centralization: Single data directory structure
- API-First: RESTful design with OpenAPI documentation
- Event-Driven: Asynchronous processing with event bus
graph LR
A[Development] --> B[Pre-commit Hooks]
B --> C[Automated Testing]
C --> D[Code Quality Checks]
D --> E[Security Scanning]
E --> F[Documentation Updates]
F --> G[Git Commit]
Pre-commit Hooks:
- Black: Python code formatting
- Flake8: Python linting and style checking
- detect-secrets: Prevent credential leaks
- Trailing whitespace: File cleanup
- YAML validation: Configuration file validation
Type Codegen:
Frontend TypeScript types for canonical workflow shapes and enums are generated from the Python sources via a curated MANIFEST (autobot-infrastructure/shared/scripts/gen_frontend_types.py); the frontend-codegen-drift CI job fails on any drift between the Python definitions and the committed TS. See CODEGEN_MANIFEST.md.
Components:
- Backend: FastAPI server with Gunicorn/Uvicorn
- Frontend: Static build served via nginx or CDN
- Database: Persistent volumes for data storage
- Redis: Separate Redis instance for production
- Monitoring: Health check endpoints and logging
Horizontal Scaling:
- Multiple backend instances behind load balancer
- Redis cluster for distributed task processing
- Separate worker node instances for task execution
- CDN for frontend static asset delivery
Vertical Scaling:
- GPU acceleration for local LLM inference
- Memory optimization for large knowledge bases
- SSD storage for database performance
- CPU scaling for concurrent request handling
- LLM Providers: Multi-provider support with failover
- Vector Databases: ChromaDB with backup/restore
- Message Queues: Redis-based task distribution
- File Systems: Local and cloud storage integration
- Monitoring Systems: Metrics export for observability
RESTful APIs:
- Standard HTTP methods (GET, POST, PUT, DELETE)
- JSON request/response format
- Comprehensive error handling
- Rate limiting and throttling
- API versioning support
WebSocket APIs:
- Real-time bidirectional communication
- Event-driven message patterns
- Connection lifecycle management
- Automatic reconnection handling
- Message queuing for offline clients
- Caching: Multi-layer caching with Redis
- Async Processing: Non-blocking I/O operations
- Connection Pooling: Database connection optimization
- Lazy Loading: On-demand resource initialization
- Background Tasks: Offload heavy operations
Response Times:
- API endpoints: < 200ms average
- WebSocket messages: < 50ms latency
- Database queries: < 100ms average
- LLM inference: Variable by model size
Throughput:
- Concurrent users: 100+ supported
- API requests: 1000+ req/sec
- WebSocket connections: 500+ simultaneous
- Background tasks: 50+ jobs/minute
- Microservices: Split into independent services
- Container Orchestration: Kubernetes deployment
- API Gateway: Centralized routing and security
- Event Streaming: Apache Kafka integration
- Multi-tenancy: Support for multiple organizations
Short-term (Next 3 months):
- Container deployment with Docker
- Advanced monitoring with Prometheus/Grafana
- Enhanced security with OAuth2/OIDC
- Performance optimization and caching improvements
Long-term (6-12 months):
- Microservices architecture migration
- Cloud-native deployment options
- Advanced AI capabilities and model fine-tuning
- Enterprise integration patterns
This architecture overview provides the foundation for understanding AutoBot's design and implementation. For specific implementation details, refer to the individual component documentation and API references.