Architecture
Lillo is built on a serverless-first architecture using Next.js 15 and Vercel, designed for scalable AI agent deployment and management.
System Architecture
Core Components
Lillo Framework
βββ Frontend (Next.js 15 App Router)
βββ API Layer (Vercel Edge Functions)
βββ Service Layer
β βββ LLM Factory
β βββ Agent Configuration
β βββ Model Preferences
βββ Storage Layer
β βββ Vercel Postgres
β βββ Redis KV Store
βββ Integration Layer
βββ Telegram Bot API
βββ OpenAI API
βββ External ServicesComponent Architecture
1. Frontend Layer
2. Service Layer
3. Database Layer
Data Flow Architecture
1. Message Processing
2. State Management
3. Function Calling
Security Architecture
1. Authentication
2. Permission System
Performance Architecture
1. Caching Strategy
Redis KV Store
Agent configurations
Command metrics
Rate limiting
Session data
2. Database Optimization
Indexed queries
Connection pooling
Prepared statements
Type safety
3. Edge Functions
Webhook handling
API routes
Static generation
Response streaming
Development Architecture
1. Project Structure
2. Type Safety
Best Practices
1. Code Organization
Feature-based structure
Clear separation of concerns
Dependency injection
Type safety
2. Error Handling
Global error boundary
Service-level recovery
Logging and monitoring
User feedback
3. Performance
Edge function optimization
Response streaming
Cache management
Query optimization
Related Documentation
Last updated